1
1
/**
2
2
* An asset URI which will always be passed as a `string` to the native platform SDKs.
3
3
* In React Native an `AssetURI` can be assigned with an asset reference which can be
4
- * optained by, e.g., `require('./pathToStaticAssetResource.withExtension')` as `number`.
4
+ * obtained by, e.g., `require('./pathToStaticAssetResource.withExtension')` as `number`.
5
5
* Every `AssetURI` as `number` contained in the `Configuration` will be resolved to a URI
6
6
* as `string` when passed to the SDK.
7
7
*/
@@ -12,9 +12,9 @@ export type AssetURI = string | number
12
12
*/
13
13
export interface Configuration {
14
14
/**
15
- * When set to `true`, the user is forced to crop the asset to one of the allowed crop aspects in
15
+ * When set to `true`, the user is forced to crop the asset to one of the allowed crop ratios in
16
16
* `transform.items` before being able to use other features of the editor.
17
- * The transform tool will only be presented if the image does not already fit one of those allowed
17
+ * The transform tool will only be presented if the image does not already fit one of the allowed
18
18
* aspect ratios. It will be presented automatically, if the user changes the orientation of the asset
19
19
* and the result does not match an allowed aspect ratio.
20
20
*
@@ -77,35 +77,35 @@ export interface Configuration {
77
77
*/
78
78
snapToVerticalCenter ?: boolean ;
79
79
/**
80
- * The left side of a sprite's bounding box snaps to a vertical line which is shifted by this value
81
- * from the left side of the edited image towards its center. This value is measured in normalized
80
+ * The left side of a sprite's bounding box snaps to a vertical line which is shifted
81
+ * from the left side of the edited image towards its center by this value. The value is measured in normalized
82
82
* coordinates relative to the smaller side of the edited image.
83
83
* If this value is explicitly set to `null` this snapping line is disabled.
84
84
* @example // Defaults to:
85
85
* 0.1
86
86
*/
87
87
snapToLeft ?: number | null ;
88
88
/**
89
- * The right side of a sprite's bounding box snaps to a vertical line which is shifted by this value
90
- * from the right side of the edited image towards its center. This value is measured in normalized
89
+ * The right side of a sprite's bounding box snaps to a vertical line which is shifted
90
+ * from the right side of the edited image towards its center by this value. The value is measured in normalized
91
91
* coordinates relative to the smaller side of the edited image.
92
92
* If this value is explicitly set to `null` this snapping line is disabled.
93
93
* @example // Defaults to:
94
94
* 0.1
95
95
*/
96
96
snapToRight ?: number | null ;
97
97
/**
98
- * The top side of a sprite's bounding box snaps to a horizontal line which is shifted by this value
99
- * from the top side of the edited image towards its center. This value is measured in normalized
98
+ * The top side of a sprite's bounding box snaps to a horizontal line which is shifted
99
+ * from the top side of the edited image towards its center by this value. The value is measured in normalized
100
100
* coordinates relative to the smaller side of the edited image.
101
101
* If this value is explicitly set to `null` this snapping line is disabled.
102
102
* @example // Defaults to:
103
103
* 0.1
104
104
*/
105
105
snapToTop ?: number | null ;
106
106
/**
107
- * The bottom side of a sprite's bounding box snaps to a horizontal line which is shifted by this value
108
- * from the bottom side of the edited image towards its center. This value is measured in normalized
107
+ * The bottom side of a sprite's bounding box snaps to a horizontal line which is shifted
108
+ * from the bottom side of the edited image towards its center by this value. The value is measured in normalized
109
109
* coordinates relative to the smaller side of the edited image.
110
110
* If this value is explicitly set to `null` this snapping line is disabled.
111
111
* @example // Defaults to:
@@ -152,7 +152,7 @@ export interface Configuration {
152
152
*/
153
153
transform ?: {
154
154
/**
155
- * Whether to show a reset button to reset the applied crop, rotation and straighten angle.
155
+ * Whether to show a reset button to reset the applied crop, rotation and tilt angle.
156
156
* @example // Defaults to:
157
157
* true
158
158
*/
@@ -182,7 +182,7 @@ export interface Configuration {
182
182
filter ?: {
183
183
/**
184
184
* Defines all available filters. Each filter must be assigned to a category.
185
- * New items and categories can be mixed and matched with existing predefined ones.
185
+ * New items and categories can be mixed and matched with existing ones.
186
186
* `NONE` is always added.
187
187
* @example // Defaults to:
188
188
* [
@@ -319,7 +319,7 @@ export interface Configuration {
319
319
sticker ?: {
320
320
/**
321
321
* Defines all available stickers. Each sticker must be assigned to a category.
322
- * New items and categories can be mixed and matched with existing predefined ones.
322
+ * New items and categories can be mixed and matched with existing ones.
323
323
* @example // Defaults to:
324
324
* [
325
325
* { identifier: "imgly_sticker_category_emoticons", items: [
@@ -408,7 +408,7 @@ export interface Configuration {
408
408
*/
409
409
categories ?: ( StickerCategory | ExistingStickerCategory ) [ ] ;
410
410
/**
411
- * Defines all available colors that can be applied to stickers with a `tintMode` other than `none `.
411
+ * Defines all available colors that can be applied to stickers with a `tintMode` other than `TintMode.NONE `.
412
412
* The color pipette is always added.
413
413
* @example // Defaults to:
414
414
* [
@@ -451,6 +451,21 @@ export interface Configuration {
451
451
CanvasAction . ADD |
452
452
CanvasAction . FLIP
453
453
> ;
454
+ /**
455
+ * If enabled the user can create personal stickers from the device's photo library. A button is added as first item
456
+ * in the menu in front of the sticker categories which modally presents an image selection dialog for personal sticker creation.
457
+ * Personal stickers will be added to a personal sticker category with the identifier `"imgly_sticker_category_personal"` which
458
+ * will be added between the button and the regular sticker categories if it does not exist.
459
+ * @example // Defaults to:
460
+ * false
461
+ */
462
+ personalStickers ?: boolean ;
463
+ /**
464
+ * The default tint mode for personal stickers.
465
+ * @example // Defaults to:
466
+ * TintMode.NONE
467
+ */
468
+ defaultPersonalStickerTintMode ?: TintMode ;
454
469
}
455
470
456
471
/**
@@ -459,7 +474,7 @@ export interface Configuration {
459
474
text ?: {
460
475
/**
461
476
* Defines all available fonts.
462
- * New items can be mixed and matched with existing predefined ones.
477
+ * New items can be mixed and matched with existing ones.
463
478
* @example // Defaults to:
464
479
* [
465
480
* { identifier: "imgly_font_open_sans_bold" },
@@ -561,7 +576,7 @@ export interface Configuration {
561
576
textdesign ?: {
562
577
/**
563
578
* Defines all available text designs.
564
- * New items can be mixed and matched with existing predefined ones.
579
+ * New items can be mixed and matched with existing ones.
565
580
* @example // Defaults to:
566
581
* [
567
582
* { identifier: "imgly_text_design_blocks" },
@@ -626,7 +641,7 @@ export interface Configuration {
626
641
overlay ?: {
627
642
/**
628
643
* Defines all available overlays.
629
- * New items can be mixed and matched with existing predefined ones.
644
+ * New items can be mixed and matched with existing ones.
630
645
* `NONE` is always added.
631
646
* @example // Defaults to:
632
647
* [
@@ -653,7 +668,7 @@ export interface Configuration {
653
668
frame ?: {
654
669
/**
655
670
* Defines all available frames.
656
- * New items can be mixed and matched with existing predefined ones.
671
+ * New items can be mixed and matched with existing ones.
657
672
* `NONE` is always added.
658
673
* @example // Defaults to:
659
674
* [
@@ -724,21 +739,22 @@ export interface Configuration {
724
739
*/
725
740
defaultColor ?: Color ;
726
741
/**
727
- * The minimum size that a brush can have. This value is measured relative to the
728
- * smaller side of the image that the user is editing.
742
+ * The minimum size that a brush can have. This value is measured in relation to the
743
+ * smaller side of the image that the user is editing. If the value is `null` the
744
+ * minimum brush size is set to the absolute size of a single pixel of the edited image.
729
745
* @example // Defaults to:
730
- * 0.001
746
+ * null
731
747
*/
732
748
minimumSize ?: number ;
733
749
/**
734
- * The maximum size that a brush can have. This value is measured relative to the
750
+ * The maximum size that a brush can have. This value is measured in relation to the
735
751
* smaller side of the image that the user is editing.
736
752
* @example // Defaults to:
737
753
* 0.125
738
754
*/
739
755
maximumSize ?: number ;
740
756
/**
741
- * The default size of the brush. This value is measured relative to the
757
+ * The default size of the brush. This value is measured in relation to the
742
758
* smaller side of the image that the user is editing.
743
759
* @example // Defaults to:
744
760
* 0.05
@@ -881,8 +897,8 @@ export interface Configuration {
881
897
*/
882
898
custom ?: {
883
899
/**
884
- * Theming options to change the user interafce appearance. This allows to alter predefined existing
885
- * theme presents or to create new themes which can be enabled when their corresponding key (name)
900
+ * Theming options to change the user interface appearance. This allows to alter predefined existing
901
+ * theme presets or to create new themes which can be enabled when their corresponding key (name)
886
902
* is set as the `Configuration.theme`.
887
903
*/
888
904
themes ?: {
@@ -901,7 +917,7 @@ export enum Tool {
901
917
FILTER = "filter" ,
902
918
/** A tool to apply image adjustments. */
903
919
ADJUSTMENT = "adjustment" ,
904
- /** A tool to add defocus . */
920
+ /** A tool to add blur . */
905
921
FOCUS = "focus" ,
906
922
/** A tool to add stickers. */
907
923
STICKER = "sticker" ,
@@ -913,7 +929,7 @@ export enum Tool {
913
929
OVERLAY = "overlay" ,
914
930
/** A tool to add a frame. */
915
931
FRAME = "frame" ,
916
- /** A tool to add paintings . */
932
+ /** A tool to add drawings . */
917
933
BRUSH = "brush" ,
918
934
}
919
935
@@ -969,7 +985,7 @@ export enum AdjustmentTool {
969
985
SHARPNESS = "sharpness" ,
970
986
}
971
987
972
- /** A focus tool. */
988
+ /** A blur tool. */
973
989
export enum FocusTool {
974
990
NONE = "none" ,
975
991
RADIAL = "radial" ,
@@ -1054,7 +1070,7 @@ export enum BrushAction {
1054
1070
HARDNESS = "hardness" ,
1055
1071
}
1056
1072
1057
- /** A predefined existing theme preset to define the user interface appearance. */
1073
+ /** A predefined theme preset to define the user interface appearance. */
1058
1074
export enum ExistingTheme {
1059
1075
/** A user interface style with dark appearance. */
1060
1076
DARK = "dark" ,
@@ -1079,7 +1095,7 @@ export type Color = number[] | number | string | null;
1079
1095
export interface NamedColor {
1080
1096
/** The color. */
1081
1097
color : Color ;
1082
- /** The name of the color which is also used for accessabliblity . */
1098
+ /** The name of the color which is also used for accessibliblity . */
1083
1099
name : string ;
1084
1100
}
1085
1101
@@ -1099,7 +1115,7 @@ export interface CropRatio {
1099
1115
*/
1100
1116
toggleable ?: boolean ;
1101
1117
/**
1102
- * A displayable name for the item which is also used for accessabliblity .
1118
+ * A displayable name for the item which is also used for accessibliblity .
1103
1119
* If `null` the name is automatically generated from the `width` and `height` values and
1104
1120
* the name will always be overwritten by this auto-generated name if the user toggles the
1105
1121
* aspect when `toggleable` is enabled.
@@ -1120,7 +1136,7 @@ export interface ExistingItem extends UniqueItem {}
1120
1136
1121
1137
/** A named and unique identifiable item. */
1122
1138
export interface NamedItem extends UniqueItem {
1123
- /** A displayable name for the item which is also used for accessabliblity . */
1139
+ /** A displayable name for the item which is also used for accessibliblity . */
1124
1140
name : string ;
1125
1141
}
1126
1142
@@ -1198,7 +1214,7 @@ export interface StickerCategory extends NamedItem {
1198
1214
export interface Sticker extends NamedItem {
1199
1215
/**
1200
1216
* A URI for the thumbnail image of the sticker.
1201
- * If `null` the thumbnail will be automatically generated form the `stickerURI`.
1217
+ * If `null` the thumbnail will be automatically generated from the `stickerURI`.
1202
1218
* @example // Defaults to:
1203
1219
* null
1204
1220
*/
@@ -1260,7 +1276,7 @@ export interface Frame extends NamedItem {
1260
1276
* FrameLayoutMode.HORIZONTAL_INSIDE
1261
1277
*/
1262
1278
layoutMode ?: FrameLayoutMode ;
1263
- /** The relative scale of the frame which is defined relative to the shorter side of the
1279
+ /** The relative scale of the frame which is defined in relatation to the shorter side of the
1264
1280
* resulting output image. */
1265
1281
relativeScale : number ;
1266
1282
/** Images for the 12-patch layout of a dynamic frame that automatically adapts to
@@ -1329,36 +1345,36 @@ export interface FrameImageGroup {
1329
1345
export interface Theme {
1330
1346
/**
1331
1347
* The tint color of highlighted user interface elements.
1332
- * If `null` it defaults to the system tint color if available or the vaule of the theme that is modified.
1348
+ * If `null` it defaults to the system tint color if available or the value of the theme that is modified.
1333
1349
* @example // Defaults to:
1334
1350
* null
1335
1351
*/
1336
1352
tint ?: Color ;
1337
1353
/**
1338
1354
* The primary color which is mainly used for the text and the icons on the menu bar.
1339
- * If `null` it defaults to the `ExistingTheme.DARK`'s value or the vaule of the theme that is modified.
1355
+ * If `null` it defaults to the `ExistingTheme.DARK`'s value or the value of the theme that is modified.
1340
1356
* @example // Defaults to:
1341
1357
* null
1342
1358
*/
1343
1359
primary ?: Color ;
1344
1360
/**
1345
1361
* The background color of the canvas.
1346
- * If `null` it defaults to the `ExistingTheme.DARK`'s value or the vaule of the theme that is modified.
1362
+ * If `null` it defaults to the `ExistingTheme.DARK`'s value or the value of the theme that is modified.
1347
1363
* @example // Defaults to:
1348
1364
* null
1349
1365
*/
1350
1366
background ?: Color ;
1351
1367
/**
1352
1368
* The background color of the menu and accesory controls above the menu.
1353
- * If `null` it defaults to the `ExistingTheme.DARK`'s value or the vaule of the theme that is modified.
1369
+ * If `null` it defaults to the `ExistingTheme.DARK`'s value or the value of the theme that is modified.
1354
1370
* @example // Defaults to:
1355
1371
* null
1356
1372
*/
1357
1373
menuBackground ?: Color ;
1358
1374
/**
1359
1375
* The background color of the toolbar that hosts the title of the active tool, the discard,
1360
1376
* and the apply button.
1361
- * If `null` it defaults to the `ExistingTheme.DARK`'s value or the vaule of the theme that is modified.
1377
+ * If `null` it defaults to the `ExistingTheme.DARK`'s value or the value of the theme that is modified.
1362
1378
* @example // Defaults to:
1363
1379
* null
1364
1380
*/
@@ -1602,6 +1618,8 @@ export function createDefaultConfiguration(): Configuration {
1602
1618
] ,
1603
1619
actions : [ StickerAction . REPLACE , StickerAction . OPACITY , StickerAction . COLOR ] ,
1604
1620
canvasActions : [ CanvasAction . ADD , CanvasAction . DELETE , CanvasAction . FLIP , CanvasAction . BRING_TO_FRONT , CanvasAction . UNDO , CanvasAction . REDO ] ,
1621
+ personalStickers : false ,
1622
+ defaultPersonalStickerTintMode : TintMode . NONE ,
1605
1623
} ,
1606
1624
text : {
1607
1625
fonts : [
0 commit comments