@cesdk/cesdk-js 1.4.5 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/.browserslistrc +4 -4
  2. package/ThirdPartyLicenses.md +59 -256
  3. package/assets/core/cesdk.data +0 -0
  4. package/assets/core/cesdk.wasm +0 -0
  5. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_ad1920_5_5_128.png +0 -0
  6. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_ancient_5_5_128.png +0 -0
  7. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_bw_5_5_128.png +0 -0
  8. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_chestnut_8_8_512.png +0 -0
  9. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_classic_5_5_128.png +0 -0
  10. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_colla_5_5_128.png +0 -0
  11. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_colorful_5_5_128.png +0 -0
  12. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_cottoncandy_5_5_128.png +0 -0
  13. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_creamy_5_5_128.png +0 -0
  14. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_dusty_5_5_128.png +0 -0
  15. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_fixie_8_8_512.png +0 -0
  16. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_flat_black_8_8_512.png +0 -0
  17. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_food_5_5_128.png +0 -0
  18. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_fridge_8_8_512.png +0 -0
  19. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_glam_5_5_128.png +0 -0
  20. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_gobblin_5_5_128.png +0 -0
  21. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_golden_5_5_128.png +0 -0
  22. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_green_gap_5_5_128.png +0 -0
  23. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_greyed_5_5_128.png +0 -0
  24. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_hard_stuff_8_8_512.png +0 -0
  25. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_highcarb_5_5_128.png +0 -0
  26. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_highcontrast_5_5_128.png +0 -0
  27. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_identity_5_5_128.png +0 -0
  28. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_inferno_8_8_512.png +0 -0
  29. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_joran_5_5_128.png +0 -0
  30. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_k1_5_5_128.png +0 -0
  31. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_k6_5_5_128.png +0 -0
  32. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_kalmen_5_5_128.png +0 -0
  33. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_keen_5_5_128.png +0 -0
  34. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_lemon_5_5_128.png +0 -0
  35. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_levante_5_5_128.png +0 -0
  36. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_litho_5_5_128.png +0 -0
  37. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_lomo100_5_5_128.png +0 -0
  38. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_low_fire_5_5_128.png +0 -0
  39. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_lucid_5_5_128.png +0 -0
  40. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_mellow_8_8_512.png +0 -0
  41. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_moss_5_5_128.png +0 -0
  42. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_neat_5_5_128.png +0 -0
  43. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_oldtimer_8_8_512.png +0 -0
  44. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_pale_5_5_128.png +0 -0
  45. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_pebble_5_5_128.png +0 -0
  46. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_pitched_5_5_128.png +0 -0
  47. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_polaroid_5_5_128.png +0 -0
  48. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_polasx_5_5_128.png +0 -0
  49. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_pro400_5_5_128.png +0 -0
  50. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_pumpkin_5_5_128.png +0 -0
  51. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_quozi_5_5_128.png +0 -0
  52. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_sepia_5_5_128.png +0 -0
  53. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_settled_5_5_128.png +0 -0
  54. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_seventies_5_5_128.png +0 -0
  55. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_snappy_5_5_128.png +0 -0
  56. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_soft_5_5_128.png +0 -0
  57. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_softly_5_5_128.png +0 -0
  58. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_solanus_5_5_128.png +0 -0
  59. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_steel_5_5_128.png +0 -0
  60. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_summer_5_5_128.png +0 -0
  61. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_sunny_70s_8_8_512.png +0 -0
  62. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_sunrise_5_5_128.png +0 -0
  63. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_tender_5_5_128.png +0 -0
  64. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_twilight_5_5_128.png +0 -0
  65. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_weathered_5_5_128.png +0 -0
  66. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_zephyr_5_5_128.png +0 -0
  67. package/assets/extensions/ly.img.cesdk.fonts/fonts/imgly_font_abril_fatface_regular.ttf +0 -0
  68. package/assets/extensions/ly.img.cesdk.fonts/fonts/imgly_font_bungee_inline.ttf +0 -0
  69. package/assets/extensions/ly.img.cesdk.fonts/fonts/imgly_font_kumar_one_outline.otf +0 -0
  70. package/assets/extensions/ly.img.cesdk.fonts/fonts/imgly_font_permanent_marker.ttf +0 -0
  71. package/assets/extensions/ly.img.cesdk.fonts/fonts/imgly_font_petit_formal_script.ttf +0 -0
  72. package/assets/extensions/ly.img.cesdk.fonts/fonts/imgly_font_ultra.ttf +0 -0
  73. package/assets/extensions/ly.img.cesdk.fonts/manifest.json +2 -2
  74. package/assets/extensions/ly.img.cesdk.stickers.openmoji/genmoji.mjs +1 -108
  75. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/manifest.json +199 -0
  76. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/frame.png +0 -0
  77. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/halfcircle.png +0 -0
  78. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/organic1.png +0 -0
  79. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/organic2.png +0 -0
  80. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/organic3.png +0 -0
  81. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/organic4.png +0 -0
  82. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/organicdot1.png +0 -0
  83. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/organicdot2.png +0 -0
  84. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/quartercircle-outline.png +0 -0
  85. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/quartercircle.png +0 -0
  86. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/rectanglemask.png +0 -0
  87. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/roundmask.png +0 -0
  88. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/splash1.png +0 -0
  89. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/splash2.png +0 -0
  90. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/splash3.png +0 -0
  91. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/splash4.png +0 -0
  92. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/wiggle.png +0 -0
  93. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/ziczac.png +0 -0
  94. package/assets/extensions/ly.img.fonts/README.md +3 -0
  95. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Light-Web/Font-EULA.pdf +0 -0
  96. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Light-Web/Supply-Light.eot +0 -0
  97. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Light-Web/Supply-Light.otf +0 -0
  98. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Light-Web/Supply-Light.ttf +0 -0
  99. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Light-Web/Supply-Light.woff +0 -0
  100. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Light-Web/Supply-Light.woff2 +0 -0
  101. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Regular-Web/Font-EULA.pdf +0 -0
  102. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Regular-Web/Supply-Regular.eot +0 -0
  103. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Regular-Web/Supply-Regular.otf +0 -0
  104. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Regular-Web/Supply-Regular.ttf +0 -0
  105. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Regular-Web/Supply-Regular.woff +0 -0
  106. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Regular-Web/Supply-Regular.woff2 +0 -0
  107. package/assets/extensions/ly.img.fonts/manifest.json +24 -0
  108. package/assets/extensions/ly.img.fonts/preview.png +0 -0
  109. package/assets/i18n/de.json +76 -9
  110. package/assets/i18n/en.json +92 -25
  111. package/assets/ui/stylesheets/cesdk.css +40 -41
  112. package/cesdk-engine.umd.d.ts +1494 -38
  113. package/cesdk-engine.umd.js +1 -2
  114. package/cesdk.umd.js +1 -1
  115. package/index.d.ts +1798 -0
  116. package/index.html +3 -24
  117. package/package.json +2 -2
  118. package/BlockAPI.d.ts +0 -785
  119. package/SceneAPI.d.ts +0 -52
  120. package/VariableAPI.d.ts +0 -27
  121. package/api.d.ts +0 -11
  122. package/assets/extensions/ly.img.cesdk.fonts/fonts/imgly_font_kumar_one_outline.ttf +0 -0
  123. package/types.d.ts +0 -759
package/index.d.ts ADDED
@@ -0,0 +1,1798 @@
1
+ /** A11 Settings
2
+ *
3
+ */
4
+ declare type A11y = {
5
+ /**
6
+ * The option define a level of heading to start from (in a range 1-6)
7
+ */
8
+ headingsHierarchyStart: 1 | 2 | 3 | 4 | 5 | 6;
9
+ };
10
+
11
+ /** @public */
12
+ export declare class API {
13
+ block: BlockAPI;
14
+ scene: SceneAPI;
15
+ event: EventAPI;
16
+ variable: VariableAPI;
17
+ }
18
+
19
+ declare type Asset = {
20
+ src: string;
21
+ };
22
+
23
+ declare interface AssetElement {
24
+ id: string;
25
+ name: string;
26
+ uri: string;
27
+ thumbUri: string;
28
+ }
29
+
30
+ /**
31
+ * Single asset result of a query from the engine.
32
+ */
33
+ declare interface AssetResult {
34
+ /**
35
+ * A unique id of this asset
36
+ */
37
+ id: string;
38
+ /**
39
+ * E.g. `ly.img.image`
40
+ */
41
+ type: string;
42
+ /**
43
+ * URI to a thumbnail of the asset used e.g. in the content library UI
44
+ */
45
+ thumbUri: string;
46
+ /**
47
+ * Original size of the asset.
48
+ */
49
+ size: {
50
+ width: number;
51
+ height: number;
52
+ };
53
+ /**
54
+ * Asset-specific and custom meta information
55
+ */
56
+ meta?: {
57
+ uri?: string;
58
+ filename?: string;
59
+ } & Record<string, unknown>;
60
+ /**
61
+ * The locale of the label and tags
62
+ */
63
+ locale?: string;
64
+ /**
65
+ * The label of the result. Used for description and tooltips.
66
+ */
67
+ label?: string;
68
+ /**
69
+ * The tags of this asset. Used for filtering and free-text searching.
70
+ */
71
+ tags?: string[];
72
+ context: {
73
+ sourceId: string;
74
+ };
75
+ /**
76
+ * Credits for the artist of the asset
77
+ */
78
+ credits?: {
79
+ name: string;
80
+ url?: string;
81
+ };
82
+ /**
83
+ * License for this asset. Overwrites the source license if present
84
+ */
85
+ license?: {
86
+ name: string;
87
+ url?: string;
88
+ };
89
+ }
90
+
91
+ declare type Assets = {
92
+ [id: string]: Asset;
93
+ };
94
+
95
+ /**
96
+ * API to query for assets
97
+ */
98
+ declare interface AssetSource {
99
+ /**
100
+ * The asset types returned by this source. Will default to ['ly.img.image'].
101
+ */
102
+ types?: string[];
103
+ /**
104
+ * Find all asset for the given type and the provided query data.
105
+ */
106
+ findAssets(type: string, queryData?: QueryData): Promise<AssetsQueryResult | undefined>;
107
+ /**
108
+ * Indicates if the asset shall be downloaded to handle the raw data instead
109
+ * of an URL reference. Do this if you do not want to depend on
110
+ * a service after adding the asset to the scene. If this is your own API
111
+ * with your own service, you do not need to set this and avoid downloading /
112
+ * re-uploading the assets.
113
+ */
114
+ downloadAssets?: (asset: AssetResult) => Promise<Blob>;
115
+ /**
116
+ * Credits for the source/api
117
+ */
118
+ credits?: {
119
+ name: string;
120
+ url?: string;
121
+ };
122
+ /**
123
+ * General license for all asset from this source
124
+ */
125
+ license?: {
126
+ name: string;
127
+ url?: string;
128
+ };
129
+ }
130
+
131
+ declare type AssetSources = {
132
+ [id: string]: AssetSource;
133
+ };
134
+
135
+ /**
136
+ * Return type of a `findAssets` query.
137
+ */
138
+ declare interface AssetsQueryResult {
139
+ /**
140
+ * The assets in the requested page
141
+ */
142
+ assets: AssetResult[];
143
+ /**
144
+ * The current, requested page
145
+ */
146
+ currentPage: number;
147
+ /**
148
+ * The next page to query if it exists
149
+ */
150
+ nextPage: number | undefined;
151
+ /**
152
+ * How many assets are there in total for the current query regardless of the page
153
+ */
154
+ total: number;
155
+ }
156
+
157
+ declare type Block = number;
158
+
159
+ /**
160
+ * @public
161
+ */
162
+ export declare class BlockAPI {
163
+ #private;
164
+
165
+ /**
166
+ * Exports a design block element as a file of the given mime type.
167
+ * Performs an internal update to resolve the final layout for the blocks.
168
+ * @param handle - The design block element to export.
169
+ * @param mimeType - The mime type of the output file.
170
+ * @returns A promise that resolves with the exported image or is rejected with an error.
171
+ */
172
+ export(handle: DesignElementId, mimeType?: MimeType_2): Promise<Blob>;
173
+ /**
174
+ * Loads existing blocks from the given string.
175
+ * The blocks are not attached by default and won't be visible until attached to a page or the scene.
176
+ * @param content - A string representing the given blocks.
177
+ * @returns A promise that resolves with a list of handles representing the found blocks or an error.
178
+ */
179
+ loadFromString(content: string): Promise<DesignElementId[]>;
180
+ /**
181
+ * Saves the given blocks into a string. If given the root of a block hierarchy, e.g. a
182
+ * page with multiple children, the entire hierarchy is saved.
183
+ * @param blocks - The blocks to save
184
+ * @returns A promise that resolves to a string representing the blocks or an error.
185
+ */
186
+ saveToString(blocks: DesignElementId[]): Promise<string>;
187
+ /**
188
+ * Create a new block, fails if type is unknown.
189
+ * @param type - The type of the block that shall be created.
190
+ * @returns The created blocks handle.
191
+ */
192
+ create(type: DesignElementType): DesignElementId;
193
+ /**
194
+
195
+ * Get the type of the given block, fails if the block is invalid.
196
+ * @param id - The block to query.
197
+ * @returns The blocks type.
198
+ */
199
+ getType(id: DesignElementId): DesignElementType;
200
+ /**
201
+ * Update the selection state of a block.
202
+ * Fails for invalid blocks.
203
+ * @param id - The block to query.
204
+ * @param selected - Whether or not the block should be selected.
205
+ */
206
+ setSelected(id: DesignElementId, selected: boolean): void;
207
+ /**
208
+ * Get the selected state of a block.
209
+ * @param id - The block to query.
210
+ * @returns True if the block is selected, false otherwise.
211
+ */
212
+ isSelected(id: DesignElementId): boolean;
213
+ /**
214
+ * Get all currently selected blocks.
215
+ * @returns An array of block ids.
216
+ */
217
+ findAllSelected(): DesignElementId[];
218
+ /**
219
+ * Confirms that a given set of blocks can be grouped together.
220
+ * @param ids - A non-empty array of block ids.
221
+ * @returns Whether the blocks can be grouped together.
222
+ */
223
+ isGroupable(ids: DesignElementId[]): boolean;
224
+ /**
225
+ * Group blocks together.
226
+ * @param ids - A non-empty array of block ids.
227
+ * @returns The block id of the created group.
228
+ */
229
+ group(ids: DesignElementId[]): DesignElementId;
230
+ /**
231
+ * Ungroups a group.
232
+ * @param id - The group id from a previous call to `group`.
233
+ */
234
+ ungroup(id: DesignElementId): void;
235
+ /**
236
+ * Changes selection from selected group to a block within that group.
237
+ * Nothing happens if `group` is not a group.
238
+ * @param id - The group id from a previous call to `group`.
239
+ */
240
+ enterGroup(id: DesignElementId): void;
241
+ /**
242
+ * Changes selection from a group's selected block to that group.
243
+ * Nothing happens if the `id` is not part of a group.
244
+ * @param id - A block id.
245
+ */
246
+ exitGroup(id: DesignElementId): void;
247
+ /**
248
+ * Update a block's name.
249
+ * @param id - The block to update.
250
+ * @param name - The name to set.
251
+ */
252
+ setName(id: DesignElementId, name: string): void;
253
+ /**
254
+ * Get a block's name.
255
+ * @param id - The block to update.
256
+ */
257
+ getName(id: DesignElementId): string;
258
+ /**
259
+ * Finds all blocks with the given name.
260
+ * @param name - The name to search for.
261
+ * @returns A list of block ids.
262
+ */
263
+ findByName(name: string): DesignElementId[];
264
+ /**
265
+ * Finds all blocks with the given type.
266
+ * @param type - The type to search for.
267
+ * @returns A list of block ids.
268
+ */
269
+ findByType(type: DesignElementType): DesignElementId[];
270
+ /**
271
+ * Return all blocks currently known to the engine.
272
+ * @returns A list of block ids.
273
+ */
274
+ findAll(): DesignElementId[];
275
+ /**
276
+ * Query a block's visibility.
277
+ * @param id - The block to query.
278
+ * @returns True if visible, false otherwise.
279
+ */
280
+ isVisible(id: DesignElementId): boolean;
281
+ /**
282
+ * Update a block's visibility.
283
+ * @param id - The block to update.
284
+ * @param visible - Whether the block shall be visible.
285
+ */
286
+ setVisible(id: DesignElementId, visible: boolean): void;
287
+ /**
288
+ * Query a block's clipped state. If true, the block should clip
289
+ * its contents to its frame.
290
+ * @param id - The block to query.
291
+ * @returns True if clipped, false otherwise.
292
+ */
293
+ isClipped(id: DesignElementId): boolean;
294
+ /**
295
+ * Update a block's clipped state.
296
+ * @param id - The block to update.
297
+ * @param clipped - Whether the block should clips its contents to its frame.
298
+ */
299
+ setClipped(id: DesignElementId, clipped: boolean): void;
300
+ /**
301
+ * Query a block's x position.
302
+ * @param id - The block to query.
303
+ * @returns The value of the x position.
304
+ */
305
+ getPositionX(id: DesignElementId): number;
306
+ /**
307
+ * Query a block's mode for its x position.
308
+ * @param id - The block to query.
309
+ * @returns The current mode for the x position: absolute, percent or undefined.
310
+ */
311
+ getPositionXMode(id: DesignElementId): PositionMode;
312
+ /**
313
+ * Query a block's y position.
314
+ * @param id - The block to query.
315
+ * @returns The value of the y position.
316
+ */
317
+ getPositionY(id: DesignElementId): number;
318
+ /**
319
+ * Query a block's mode for its y position.
320
+ * @param id - The block to query.
321
+ * @returns The current mode for the y position: absolute, percent or undefined.
322
+ */
323
+ getPositionYMode(id: DesignElementId): PositionMode;
324
+ /**
325
+ * Update a block's x position.
326
+ * The position refers to the block's local space, relative to its parent with the origin at the top left.
327
+ * @param id - The block to update.
328
+ * @param value - The value of the x position.
329
+ */
330
+ setPositionX(id: DesignElementId, value: number): void;
331
+ /**
332
+ * Set a block's mode for its x position.
333
+ * @param id - The block to update.
334
+ * @param mode - The x position mode: absolute, percent or undefined.
335
+ */
336
+ setPositionXMode(id: DesignElementId, mode: PositionMode): void;
337
+ /**
338
+ * Update a block's y position.
339
+ * The position refers to the block's local space, relative to its parent with the origin at the top left.
340
+ * @param id - The block to update.
341
+ * @param value - The value of the y position.
342
+ */
343
+ setPositionY(id: DesignElementId, value: number): void;
344
+ /**
345
+ * Set a block's mode for its y position.
346
+ * @param id - The block to update.
347
+ * @param mode - The y position mode: absolute, percent or undefined.
348
+ */
349
+ setPositionYMode(id: DesignElementId, mode: PositionMode): void;
350
+ /**
351
+ * Query a block's rotation in radians.
352
+ * @param id - The block to query.
353
+ * @returns The block's rotation around its center in radians.
354
+ */
355
+ getRotation(id: DesignElementId): number;
356
+ /**
357
+ * Update a block's rotation.
358
+ * @param id - The block to update.
359
+ * @param radians - The new rotation in radians. Rotation is applied around the block's center.
360
+ */
361
+ setRotation(id: DesignElementId, radians: number): void;
362
+ /**
363
+ * Query a block's horizontal flip state.
364
+ * @param id - The block to query.
365
+ * @returns A boolean indicating for whether the block is flipped in the queried direction
366
+ */
367
+ getFlipHorizontal(id: DesignElementId): boolean;
368
+ /**
369
+ * Query a block's vertical flip state.
370
+ * @param id - The block to query.
371
+ * @returns A boolean indicating for whether the block is flipped in the queried direction
372
+ */
373
+ getFlipVertical(id: DesignElementId): boolean;
374
+ /**
375
+ * Update a block's horizontal flip.
376
+ * @param id - The block to update.
377
+ * @param horizontal - Whether the block should be flipped along its x-axis.
378
+ */
379
+ setFlipHorizontal(id: DesignElementId, flip: boolean): void;
380
+ /**
381
+ * Update a block's vertical flip.
382
+ * @param id - The block to update.
383
+ * @param vertical - Whether the block should be flipped along its y-axis.
384
+ */
385
+ setFlipVertical(id: DesignElementId, flip: boolean): void;
386
+ /**
387
+ * Query a block's width.
388
+ * @param id - The block to query.
389
+ * @returns The value of the block's width.
390
+ */
391
+ getWidth(id: DesignElementId): number;
392
+ /**
393
+ * Query a block's mode for its width.
394
+ * @param id - The block to query.
395
+ * @returns The current mode for the width: absolute, percent or auto.
396
+ */
397
+ getWidthMode(id: DesignElementId): SizeMode;
398
+ /**
399
+ * Query a block's height.
400
+ * @param id - The block to query.
401
+ * @returns The value of the block's height.
402
+ */
403
+ getHeight(id: DesignElementId): number;
404
+ /**
405
+ * Query a block's mode for its height.
406
+ * @param id - The block to query.
407
+ * @returns The current mode for the height: absolute, percent or auto.
408
+ */
409
+ getHeightMode(id: DesignElementId): SizeMode;
410
+ /**
411
+ * Update a block's width.
412
+ * @param id - The block to update.
413
+ * @param value - The new width of the block.
414
+ */
415
+ setWidth(id: DesignElementId, value: number): void;
416
+ /**
417
+ * Set a block's mode for its width.
418
+ * @param id - The block to update.
419
+ * @param mode - The width mode: absolute, percent or auto.
420
+ */
421
+ setWidthMode(id: DesignElementId, mode: SizeMode): void;
422
+ /**
423
+ * Update a block's height.
424
+ * @param id - The block to update.
425
+ * @param value - The new height of the block.
426
+ */
427
+ setHeight(id: DesignElementId, value: number): void;
428
+ /**
429
+ * Set a block's mode for its height.
430
+ * @param id - The block to update.
431
+ * @param mode - The height mode: absolute, percent or auto.
432
+ */
433
+ setHeightMode(id: DesignElementId, mode: SizeMode): void;
434
+ /**
435
+ * Get a block's layouted width. The layouted width is only available after an
436
+ * internal update loop, which may not happen immediately.
437
+ * @param id - The block to query.
438
+ * @returns The layouted width.
439
+ */
440
+ getFrameWidth(id: DesignElementId): number;
441
+ /**
442
+ * Get a block's layouted height. The layouted height is only available after an
443
+ * internal update loop, which may not happen immediately.
444
+ * @param id - The block to query.
445
+ * @returns The layouted height.
446
+ */
447
+ getFrameHeight(id: DesignElementId): number;
448
+ /**
449
+ * Duplicates a block including its children.
450
+ * @param id - The block to duplicate.
451
+ * @returns The handle of the duplicate.
452
+ */
453
+ duplicate(id: DesignElementId): DesignElementId;
454
+ /**
455
+ * Destroys a block.
456
+ * @param id - The block to destroy.
457
+ */
458
+ destroy(id: DesignElementId): void;
459
+ /**
460
+ * Check if a block is valid. A block becomes invalid once it has been destroyed.
461
+ * @param id - The block to query.
462
+ * @returns True, if the block is valid.
463
+ */
464
+ isValid(id: DesignElementId): boolean;
465
+ /**
466
+ * Query a block's parent.
467
+ * @param id - The block to query.
468
+ * @returns The parent's handle.
469
+ */
470
+ getParent(id: DesignElementId): DesignElementId;
471
+ /**
472
+ * Get all children of the given block. Children
473
+ * are sorted in their rendering order: Last child is rendered
474
+ * in front of other children.
475
+ * @param id - The block to query.
476
+ * @returns A list of block ids.
477
+ */
478
+ getChildren(id: DesignElementId): DesignElementId[];
479
+ /**
480
+ * Insert a new or existing child at a certain position in the parent's children.
481
+ * @param parent - The block whose children should be updated.
482
+ * @param child - The child to insert. Can be an existing child of `parent`.
483
+ * @param index - The index to insert or move to.
484
+ */
485
+ insertChild(parent: DesignElementId, child: DesignElementId, index: number): void;
486
+ /**
487
+ * Appends a new or existing child to a block's children.
488
+ * @param parent - The block whose children should be updated.
489
+ * @param child - The child to insert. Can be an existing child of `parent`.
490
+ */
491
+ appendChild(parent: DesignElementId, child: DesignElementId): void;
492
+ /** Checks whether the given block references any variables. Doesn't check the block's children.
493
+ *
494
+ * @param id - The block to inspect.
495
+ * @returns true if the block references variables and false otherwise.
496
+ */
497
+ referencesAnyVariables(id: DesignElementId): boolean;
498
+ /**
499
+ * Get the x position of the block's axis-aligned bounding box in the scene's global coordinate space.
500
+ * The scene's global coordinate space has its origin at the top left.
501
+ * @param id - The block whose bounding box should be calculated.
502
+ * @returns float The x coordinate of the position of the axis-aligned bounding box.
503
+ */
504
+ getGlobalBoundingBoxX(id: DesignElementId): number;
505
+ /**
506
+ * Get the y position of the block's axis-aligned bounding box in the scene's global coordinate space.
507
+ * The scene's global coordinate space has its origin at the top left.
508
+ * @param id - The block whose bounding box should be calculated.
509
+ * @returns float The y coordinate of the position of the axis-aligned bounding box.
510
+ */
511
+ getGlobalBoundingBoxY(id: DesignElementId): number;
512
+ /**
513
+ * Get the width of the block's axis-aligned bounding box in the scene's global coordinate space.
514
+ * The scene's global coordinate space has its origin at the top left.
515
+ * @param id - The block whose bounding box should be calculated.
516
+ * @returns float The width of the axis-aligned bounding box.
517
+ */
518
+ getGlobalBoundingBoxWidth(id: DesignElementId): number;
519
+ /**
520
+ * Get the height of the block's axis-aligned bounding box in the scene's global coordinate space.
521
+ * The scene's global coordinate space has its origin at the top left.
522
+ * @param id - The block whose bounding box should be calculated.
523
+ * @returns float The height of the axis-aligned bounding box.
524
+ */
525
+ getGlobalBoundingBoxHeight(id: DesignElementId): number;
526
+ /**
527
+ * Get all available properties of a block.
528
+ * @param id - The block whose properties should be queried.
529
+ * @returns A list of the property names.
530
+ */
531
+ findAllProperties(id: DesignElementId): string[];
532
+ /**
533
+ * Get the type of a property given its name.
534
+ * @param property - The name of the property whose type should be queried.
535
+ * @returns The property type.
536
+ */
537
+ getPropertyType(property: string): PropertyType;
538
+ /**
539
+ * Get all the possible values of an enum given an enum property.
540
+ * @param enumProperty - The name of the property whose enum values should be queried.
541
+ * @returns A list of the enum value names as string.
542
+ */
543
+ getEnumValues<T = string>(enumProperty: string): T[];
544
+ /**
545
+ * Set a bool property of the given design block to the given value.
546
+ * @param id - The block whose property should be set.
547
+ * @param property - The name of the property to set.
548
+ * @param value - The value to set.
549
+ */
550
+ setBool(id: DesignElementId, property: string, value: boolean): void;
551
+ /**
552
+ * Get the value of a bool property of the given design block.
553
+ * @param id - The block whose property should be queried.
554
+ * @param property - The name of the property to query.
555
+ * @returns The value of the property.
556
+ */
557
+ getBool(id: DesignElementId, property: string): boolean;
558
+ /**
559
+ * Set an int property of the given design block to the given value.
560
+ * @param id - The block whose property should be set.
561
+ * @param property - The name of the property to set.
562
+ * @param value - The value to set.
563
+ */
564
+ setInt(id: DesignElementId, property: string, value: number): void;
565
+ /**
566
+ * Get the value of an int property of the given design block.
567
+ * @param id - The block whose property should be queried.
568
+ * @param property - The name of the property to query.
569
+ * @returns The value of the property.
570
+ */
571
+ getInt(id: DesignElementId, property: string): number;
572
+ /**
573
+ * Set a float property of the given design block to the given value.
574
+ * @param id - The block whose property should be set.
575
+ * @param property - The name of the property to set.
576
+ * @param value - The value to set.
577
+ */
578
+ setFloat(id: DesignElementId, property: string, value: number): void;
579
+ /**
580
+ * Get the value of a float property of the given design block.
581
+ * @param id - The block whose property should be queried.
582
+ * @param property - The name of the property to query.
583
+ * @returns The value of the property.
584
+ */
585
+ getFloat(id: DesignElementId, property: string): number;
586
+ /**
587
+ * Set a string property of the given design block to the given value.
588
+ * @param id - The block whose property should be set.
589
+ * @param property - The name of the property to set.
590
+ * @param value - The value to set.
591
+ */
592
+ setString(id: DesignElementId, property: string, value: string): void;
593
+ /**
594
+ * Get the value of a string property of the given design block.
595
+ * @param id - The block whose property should be queried.
596
+ * @param property - The name of the property to query.
597
+ * @returns The value of the property.
598
+ */
599
+ getString(id: DesignElementId, property: string): string;
600
+ /**
601
+ * Set a color property of the given design block to the given value.
602
+ * @param id - The block whose property should be set.
603
+ * @param property - The name of the property to set.
604
+ * @param r - The red color component in the range of 0 to 1.
605
+ * @param g - The green color component in the range of 0 to 1.
606
+ * @param b - The blue color component in the range of 0 to 1.
607
+ * @param a - The alpha color component in the range of 0 to 1.
608
+ */
609
+ setColorRGBA(id: DesignElementId, property: string, r: number, g: number, b: number, a: number): void;
610
+ /**
611
+ * Get the value of a string property of the given design block.
612
+ * @param id - The block whose property should be queried.
613
+ * @param property - The name of the property to query.
614
+ * @returns A tuple of channels red, green, blue and alpha in the range of 0 to 1.
615
+ */
616
+ getColorRGBA(id: DesignElementId, property: string): RGBA;
617
+ /**
618
+ * Set an enum property of the given design block to the given value.
619
+ * @param block - The block whose property should be set.
620
+ * @param property - The name of the property to set.
621
+ * @param value - The enum value as string.
622
+ */
623
+ setEnum(id: DesignElementId, property: string, value: string): void;
624
+ /**
625
+ * Get the value of an enum property of the given design block.
626
+ * @param block - The block whose property should be queried.
627
+ * @param property - The name of the property to query.
628
+ * @returns The value as string.
629
+ */
630
+ getEnum(id: DesignElementId, property: string): string;
631
+ /**
632
+ * Query if the given block has crop properties.
633
+ * @param id - The block to query.
634
+ * @returns true, if the block has crop properties.
635
+ */
636
+ hasCrop(id: DesignElementId): boolean;
637
+ /**
638
+ * Set the crop scale in x direction of the given design block.
639
+ * @param id - The block whose crop should be set.
640
+ * @param scaleX - The scale in x direction.
641
+ */
642
+ setCropScaleX(id: DesignElementId, scaleX: number): void;
643
+ /**
644
+ * Set the crop scale in y direction of the given design block.
645
+ * @param id - The block whose crop should be set.
646
+ * @param scaleY - The scale in y direction.
647
+ */
648
+ setCropScaleY(id: DesignElementId, scaleY: number): void;
649
+ /**
650
+ * Set the crop rotation of the given design block.
651
+ * @param id - The block whose crop should be set.
652
+ * @param rotation - The rotation in radians.
653
+ */
654
+ setCropRotation(id: DesignElementId, rotation: number): void;
655
+ /**
656
+ * Set the crop translation in x direction of the given design block.
657
+ * @param id - The block whose crop should be set.
658
+ * @param translationY - The translation in x direction.
659
+ */
660
+ setCropTranslationX(id: DesignElementId, translationX: number): void;
661
+ /**
662
+ * Set the crop translation in y direction of the given design block.
663
+ * @param id - The block whose crop should be set.
664
+ * @param translationY - The translation in y direction.
665
+ */
666
+ setCropTranslationY(id: DesignElementId, translationY: number): void;
667
+ /**
668
+ * Resets the manually set crop of the given design block.
669
+ * The block's content fill mode is set to 'cover'.
670
+ * @param id - The block whose crop should be reset.
671
+ */
672
+ resetCrop(id: DesignElementId): void;
673
+ /**
674
+ * Get the crop scale on the x axis of the given design block.
675
+ * @param id - The block whose scale should be queried.
676
+ * @returns The scale on the x axis.
677
+ */
678
+ getCropScaleX(id: DesignElementId): number;
679
+ /**
680
+ * Get the crop scale on the y axis of the given design block.
681
+ * @param id - The block whose scale should be queried.
682
+ * @returns The scale on the y axis.
683
+ */
684
+ getCropScaleY(id: DesignElementId): number;
685
+ /**
686
+ * Get the crop rotation of the given design block.
687
+ * @param id - The block whose crop rotation should be queried.
688
+ * @returns The crop rotation.
689
+ */
690
+ getCropRotation(id: DesignElementId): number;
691
+ /**
692
+ * Get the crop translation on the x axis of the given design block.
693
+ * @param id - The block whose translation should be queried.
694
+ * @returns The translation on the x axis.
695
+ */
696
+ getCropTranslationX(id: DesignElementId): number;
697
+ /**
698
+ * Get the crop translation on the y axis of the given design block.
699
+ * @param id - The block whose translation should be queried.
700
+ * @returns The translation on the y axis.
701
+ */
702
+ getCropTranslationY(id: DesignElementId): number;
703
+ /**
704
+ * Query if the given block has an opacity.
705
+ * @param id - The block to query.
706
+ * @returns true, if the block has an opcity.
707
+ */
708
+ hasOpacity(id: DesignElementId): boolean;
709
+ /**
710
+ * Set the opacity of the given design block.
711
+ * @param id - The block whose opacity should be set.
712
+ * @param opacity - The opacity to be set. The valid range is 0 to 1.
713
+ */
714
+ setOpacity(id: DesignElementId, opacity: number): void;
715
+ /**
716
+ * Get the opacity of the given design block.
717
+ * @param id - The block whose opacity should be queried.
718
+ * @returns The opacity.
719
+ */
720
+ getOpacity(id: DesignElementId): number;
721
+ /**
722
+ * Query if the given block has fill color properties.
723
+ * @param id - The block to query.
724
+ * @returns true, if the block has fill color properties.
725
+ */
726
+ hasFillColor(id: DesignElementId): boolean;
727
+ /**
728
+ * Set the fill color of the given design block.
729
+ * @param id - The block whose fill color should be set.
730
+ * @param color - The fill color to be set, a tuple of
731
+ * @param r - The red color component in the range of 0 to 1.
732
+ * @param g - The green color component in the range of 0 to 1.
733
+ * @param b - The blue color component in the range of 0 to 1.
734
+ * @param a - The alpha color component in the range of 0 to 1.
735
+ */
736
+ setFillColorRGBA(id: DesignElementId, r: number, g: number, b: number, a: number): void;
737
+ /**
738
+ * Get the fill color of the given design block.
739
+ * @param id - The block whose fill color should be queried.
740
+ * @returns The fill color.
741
+ */
742
+ getFillColorRGBA(id: DesignElementId): RGBA;
743
+ /**
744
+ * Enable or disable the fill of the given design block.
745
+ * @param id - The block whose fill should be enabled or disabled.
746
+ * @param enabled - If true, the fill will be enabled.
747
+ */
748
+ setFillColorEnabled(id: DesignElementId, enabled: boolean): void;
749
+ /**
750
+ * Query if the fill of the given design block is enabled.
751
+ * @param id - The block whose fill state should be queried.
752
+ * @returns True, if fill is enabled.
753
+ */
754
+ isFillColorEnabled(id: DesignElementId): boolean;
755
+ /**
756
+ * Query if the given block has background color properties.
757
+ * @param id - The block to query.
758
+ * @returns true, if the block has background color properties.
759
+ */
760
+ hasBackgroundColor(id: DesignElementId): boolean;
761
+ /**
762
+ * Set the background color of the given design block.
763
+ * @param id - The block whose background color should be set.
764
+ * @param color - The background color to be set, a tuple of
765
+ * @param r - The red color component in the range of 0 to 1.
766
+ * @param g - The green color component in the range of 0 to 1.
767
+ * @param b - The blue color component in the range of 0 to 1.
768
+ * @param a - The alpha color component in the range of 0 to 1.
769
+ */
770
+ setBackgroundColorRGBA(id: DesignElementId, r: number, g: number, b: number, a: number): void;
771
+ /**
772
+ * Get the background color of the given design block.
773
+ * @param id - The block whose background color should be queried.
774
+ * @returns The background color.
775
+ */
776
+ getBackgroundColorRGBA(id: DesignElementId): RGBA;
777
+ /**
778
+ * Enable or disable the background of the given design block.
779
+ * @param id - The block whose background should be enabled or disabled.
780
+ * @param enabled - If true, the background will be enabled.
781
+ */
782
+ setBackgroundColorEnabled(id: DesignElementId, enabled: boolean): void;
783
+ /**
784
+ * Query if the background of the given design block is enabled.
785
+ * @param id - The block whose background state should be queried.
786
+ * @returns True, if background is enabled.
787
+ */
788
+ isBackgroundColorEnabled(id: DesignElementId): boolean;
789
+ /**
790
+ * Query if the given block has a stroke property.
791
+ * @param id - The block to query.
792
+ * @returns True if the block has a stroke property.
793
+ */
794
+ hasStroke(id: DesignElementId): boolean;
795
+ /**
796
+ * Enable or disable the stroke of the given design block.
797
+ * @param id - The block whose stroke should be enabled or disabled.
798
+ * @param enabled - If true, the stroke will be enabled.
799
+ */
800
+ setStrokeEnabled(id: DesignElementId, enabled: boolean): void;
801
+ /**
802
+ * Query if the stroke of the given design block is enabled.
803
+ * @param id - The block whose stroke state should be queried.
804
+ * @returns True if the block's stroke is enabled.
805
+ */
806
+ isStrokeEnabled(id: DesignElementId): boolean;
807
+ /**
808
+ * Set the stroke color of the given design block.
809
+ * @param id - The block whose stroke color should be set.
810
+ * @param r - The red color component in the range of 0 to 1.
811
+ * @param g - The green color component in the range of 0 to 1.
812
+ * @param b - The blue color component in the range of 0 to 1.
813
+ * @param a - The alpha color component in the range of 0 to 1.
814
+ */
815
+ setStrokeColorRGBA(id: DesignElementId, r: number, g: number, b: number, a: number): void;
816
+ /**
817
+ * Get the stroke color of the given design block.
818
+ * @param id - The block whose background color should be queried.
819
+ * @returns The background color.
820
+ */
821
+ getStrokeColorRGBA(id: DesignElementId): RGBA;
822
+ /**
823
+ * Set the stroke width of the given design block.
824
+ * @param id - The block whose stroke width should be set.
825
+ * @param width - The stroke width to be set.
826
+ */
827
+ setStrokeWidth(id: DesignElementId, width: number): void;
828
+ /**
829
+ * Get the stroke width of the given design block.
830
+ * @param id - The block whose stroke width should be queried.
831
+ * @returns The stroke's width.
832
+ */
833
+ getStrokeWidth(id: DesignElementId): number;
834
+ /**
835
+ * Set the stroke style of the given design block.
836
+ * @param id - The block whose stroke style should be set.
837
+ * @param style - The stroke style to be set.
838
+ */
839
+ setStrokeStyle(id: DesignElementId, style: StrokeStyle): void;
840
+ /**
841
+ * Get the stroke style of the given design block.
842
+ * @param id - The block whose stroke style should be queried.
843
+ * @returns The stroke's style.
844
+ */
845
+ getStrokeStyle(id: DesignElementId): StrokeStyle;
846
+ /**
847
+ * Set the stroke position of the given design block.
848
+ * @param id - The block whose stroke position should be set.
849
+ * @param position - The stroke position to be set.
850
+ */
851
+ setStrokePosition(id: DesignElementId, position: StrokePosition): void;
852
+ /**
853
+ * Get the stroke position of the given design block.
854
+ * @param id - The block whose stroke position should be queried.
855
+ * @returns The stroke position.
856
+ */
857
+ getStrokePosition(id: DesignElementId): StrokePosition;
858
+ /**
859
+ * Set the stroke corner geometry of the given design block.
860
+ * @param id - The block whose stroke join geometry should be set.
861
+ * @param cornerGeometry - The stroke join geometry to be set.
862
+ */
863
+ setStrokeCornerGeometry(id: DesignElementId, cornerGeometry: StrokeCornerGeometry): void;
864
+ /**
865
+ * Get the stroke corner geometry of the given design block.
866
+ * @param id - The block whose stroke join geometry should be queried.
867
+ * @returns The stroke join geometry.
868
+ */
869
+ getStrokeCornerGeometry(id: DesignElementId): StrokeCornerGeometry;
870
+ /**
871
+ * Query if the given block has outline properties.
872
+ * @param id - The block to query.
873
+ * @returns true, if the block has outline properties.
874
+ * @deprecated Use `hasStroke`.
875
+ */
876
+ hasOutline(id: DesignElementId): boolean;
877
+ /**
878
+ * Set the outline color of the given design block.
879
+ * @param id - The block whose outline color should be set.
880
+ * @param color - The outline color to be set, a tuple of
881
+ * @param r - The red color component in the range of 0 to 1.
882
+ * @param g - The green color component in the range of 0 to 1.
883
+ * @param b - The blue color component in the range of 0 to 1.
884
+ * @param a - The alpha color component in the range of 0 to 1.
885
+ * @deprecated Use `setStrokeColorRGBA`.
886
+ */
887
+ setOutlineColorRGBA(id: DesignElementId, r: number, g: number, b: number, a: number): void;
888
+ /**
889
+ * Get the outline color of the given design block.
890
+ * @param id - The block whose outline color should be queried.
891
+ * @returns The outline color.
892
+ * @deprecated Use `getStrokeColorRGBA`.
893
+ */
894
+ getOutlineColorRGBA(id: DesignElementId): RGBA;
895
+ /**
896
+ * Enable or disable the outline of the given design block.
897
+ * @param id - The block whose outline should be enabled or disabled.
898
+ * @param enabled - If true, the outline will be enabled.
899
+ * @deprecated Use `setStrokeEnabled`.
900
+ */
901
+ setOutlineEnabled(id: DesignElementId, enabled: boolean): void;
902
+ /**
903
+ * Query if the outline of the given design block is enabled.
904
+ * @param id - The block whose outline state should be queried.
905
+ * @returns True, if outline is enabled.
906
+ * @deprecated Use `isStrokeEnabled`.
907
+ */
908
+ isOutlineEnabled(id: DesignElementId): boolean;
909
+ /**
910
+ * Set the outline width of the given design block.
911
+ * @param id - The block whose outline width should be set.
912
+ * @param width - The outline width to be set.
913
+ * @deprecated Use `setStrokeWidth`.
914
+ */
915
+ setOutlineWidth(id: DesignElementId, width: number): void;
916
+ /**
917
+ * Get the outline width of the given design block.
918
+ * @param id - The block whose outline width should be queried.
919
+ * @returns The outline width.
920
+ * @deprecated Use the Stroke function
921
+ * @deprecated Use `getStrokeWidth`.
922
+ */
923
+ getOutlineWidth(id: DesignElementId): number;
924
+ }
925
+
926
+ declare interface BlockEvent {
927
+ block: Block;
928
+ type: 'Created' | 'Updated' | 'Destroyed';
929
+ }
930
+
931
+ /**
932
+ * @public
933
+ */
934
+ declare type BlockEvent_2 = {
935
+ block: DesignElementId;
936
+ type: 'Created' | 'Updated' | 'Destroyed';
937
+ };
938
+
939
+ declare type Callbacks = {
940
+ log?: Logger;
941
+ };
942
+
943
+ declare type Callbacks_2 = Callbacks & {
944
+ onBack?: () => void;
945
+ onClose?: () => void;
946
+ onShare?: (s: string) => void | Promise<void>;
947
+ onSave?: (s: string) => void | Promise<void>;
948
+ onLoad?: (() => Promise<string>) | 'upload';
949
+ onDownload?: ((s: string) => void | Promise<void>) | 'download';
950
+ onExport?: ((blobs: Blob[], options: ExportOptions_2) => void | Promise<void>) | 'download';
951
+ onUpload?: OnUploadCallback | 'local' | (Partial<OnUploadOptions> & {
952
+ callback: OnUploadCallback;
953
+ });
954
+ onUnsupportedBrowser?: () => void;
955
+ };
956
+
957
+ /** All components between 0 and 1 */
958
+ declare interface CMYKColor {
959
+ c: number;
960
+ m: number;
961
+ y: number;
962
+ k: number;
963
+ }
964
+
965
+ declare type ColorDefinition = Preset & {
966
+ value: ColorPaletteColor;
967
+ };
968
+
969
+ /**
970
+ * A color definition for the custom color palette.
971
+ * The RGB and CMYK components must all be specified in the range [0-1].
972
+ */
973
+ declare type ColorPaletteColor = HexColorString | RGBColor | RGBAColor | SpotColor;
974
+
975
+ declare type ColorPaletteDefinition = Preset & {
976
+ entries: ColorPaletteColor[];
977
+ };
978
+
979
+ declare type Command = {
980
+ identifier: string;
981
+ argumentTypes: string[];
982
+ returnType: string;
983
+ };
984
+
985
+ /**
986
+ * @public
987
+ *
988
+ * @privateRemarks
989
+ * The config provided by the user has different types regarding what is
990
+ * optional and what mandatory. This is Configuration, but `ui` is recursively
991
+ * optional, and all other props are non-recursively optional
992
+ */
993
+ export declare type Configuration = Partial<DeepOptional<Configuration_2, 'ui'>>;
994
+
995
+ declare interface Configuration_2 extends Configuration_3 {
996
+ initialSceneString?: string;
997
+ initialSceneURL?: string;
998
+ initialImageURL?: string;
999
+ locale: string;
1000
+ theme: Theme;
1001
+ devMode: boolean;
1002
+ ui: UserInterface;
1003
+ i18n: I18n;
1004
+ a11y: A11y;
1005
+ callbacks: Callbacks_2;
1006
+ }
1007
+
1008
+ /**
1009
+ * @public
1010
+ */
1011
+ declare interface Configuration_3 {
1012
+ baseURL: string;
1013
+ license?: string;
1014
+ role: string;
1015
+ featureFlags?: Record<string, string | boolean>;
1016
+ extensions: Extensions;
1017
+ core: Core;
1018
+ scene: Scene;
1019
+ page: Page;
1020
+ assets: Assets;
1021
+ assetSources: AssetSources;
1022
+ presets: Presets;
1023
+ variables: Variables;
1024
+ callbacks: Callbacks;
1025
+ /**
1026
+ * The default font used by a text added to the scene. Needs to be the id of
1027
+ * the font from a extension pack including namespace, e.g.
1028
+ *
1029
+ * '//ly.img.cesdk.fonts/roboto_regular'
1030
+ *
1031
+ * If not configured the fallback font is used.
1032
+ */
1033
+ defaultFont?: string;
1034
+ }
1035
+
1036
+ declare type Core = {
1037
+ baseURL: string;
1038
+ };
1039
+
1040
+ declare interface CreateSceneOptions {
1041
+ layout: SceneLayout;
1042
+ }
1043
+
1044
+ /**
1045
+ * @public
1046
+ */
1047
+ declare class CreativeEditorSDK {
1048
+ #private;
1049
+ static PositionMode: typeof PositionMode;
1050
+ static SizeMode: typeof SizeMode;
1051
+ static PropertyType: typeof PropertyType;
1052
+ engine: API;
1053
+ /**
1054
+ * Exports one or multiple page(s) as an file in the given mimeType
1055
+ *
1056
+ * Please note: the `onExport` callback provided in the configuration will be
1057
+ * not called. This callback is for exports triggered by an user interaction.
1058
+ *
1059
+ * @param options - options for the export
1060
+ *
1061
+ * @returns a promise with an object holding `blobs` of the export pages and the provided `options`.
1062
+ */
1063
+ export(options: ExportOptions_2): Promise<{
1064
+ blobs: Blob[];
1065
+ options: ExportOptions_2;
1066
+ }>;
1067
+ /**
1068
+ * Load an encoded scene from the provided string.
1069
+ * @deprecated Use `loadFromString` instead.
1070
+ * @param scene - A string starting with UBQ1 and containing the encoded scene.
1071
+ */
1072
+ load(scene: string): Promise<void>;
1073
+ /**
1074
+ * Load an encoded scene from the provided string.
1075
+ * @param scene - A string starting with UBQ1 and containing the encoded scene.
1076
+ * @returns a promise which resolves if the scene was successfully loaded.
1077
+ */
1078
+ loadFromString(scene: string): Promise<void>;
1079
+ /**
1080
+ * Load the scene stored in the file at the given URL.
1081
+ * @param url - The url to fetch to acquire the scene string.
1082
+ * @returns a promise which resolves if the scene was successfully loaded.
1083
+ */
1084
+ loadFromURL(url: string): Promise<void>;
1085
+ /**
1086
+ * Save and return a scene as a base64 encoded string.
1087
+ *
1088
+ * @returns a promise with the scene as a string
1089
+ */
1090
+ save(): Promise<string>;
1091
+ /**
1092
+ * Adds or update text variable definition.
1093
+ *
1094
+ * Translations can be added inside the custom locale translations under the
1095
+ * key `variables.${id}.label`.
1096
+ *
1097
+ * @param definitions - text variable definitions to add or update
1098
+ *
1099
+ * @returns a resolved promise if all variables were set successfully.
1100
+ */
1101
+ setVariableDefinitions(definitions: {
1102
+ [id: string]: VariableDefinition;
1103
+ }): Promise<void>;
1104
+ /**
1105
+ * Adds an image definition which can be used in the image library.
1106
+ *
1107
+ * @param definitions - image definitions
1108
+ *
1109
+ * @returns a resolved promise if all images were add successfully
1110
+ */
1111
+ setImageDefinitions(definitions: {
1112
+ [id: string]: ImageDefinition;
1113
+ }): Promise<void[]>;
1114
+ /**
1115
+ * Adds translations to be used by the editor.
1116
+ *
1117
+ * @param translations - locale to a translation object
1118
+ *
1119
+ * @example
1120
+ * ```
1121
+ * setTranslations({
1122
+ * en: {
1123
+ * presets: {
1124
+ * scene: ...
1125
+ * }
1126
+ * }
1127
+ * })
1128
+ * ```
1129
+ */
1130
+ setTranslations(definition: {
1131
+ [locale: string]: object;
1132
+ }): void;
1133
+ unstable_switchPage(pageId: number): void;
1134
+ unstable_getPages(): Promise<number[]>;
1135
+ unstable_getActivePage(): Promise<number>;
1136
+ unstable_onActivePageChanged(callback: (id: number) => void): () => void;
1137
+ /**
1138
+ * Disposes the editor and engine if no longer needed.
1139
+ */
1140
+ dispose(): void;
1141
+ /**
1142
+ * Initializes the editor and renders it for the given container.
1143
+ *
1144
+ * @param container - the container to mount the editor as a HTML element or selector
1145
+ * @param config - the initial configuration to start the editor
1146
+ *
1147
+ * @returns a promise which resolves after the engine is ready to receive further commands on the CreativeEditorSDK instance
1148
+ */
1149
+ static init(container: HTMLDivElement | string, config?: Configuration): Promise<CreativeEditorSDK>;
1150
+ }
1151
+ export default CreativeEditorSDK;
1152
+
1153
+ declare type DeepOptional<T, K extends keyof T> = Pick<DeepPartial<T>, K> & Omit<T, K>;
1154
+
1155
+ /** Recursively makes all properties of an object Partial */
1156
+ declare type DeepPartial<T> = {
1157
+ [P in keyof T]?: DeepPartial<T[P]>;
1158
+ };
1159
+
1160
+ /**
1161
+ * A numerical identifier for a design block
1162
+ * @public
1163
+ */
1164
+ declare type DesignElementId = number;
1165
+
1166
+ /**
1167
+ * @public
1168
+ */
1169
+ declare enum DesignElementType {
1170
+ Scene = "//ly.img.ubq/scene",
1171
+ Camera = "//ly.img.ubq/camera",
1172
+ Page = "//ly.img.ubq/page",
1173
+ Image = "//ly.img.ubq/image",
1174
+ Video = "//ly.img.ubq/video",
1175
+ Text = "//ly.img.ubq/text",
1176
+ Sticker = "//ly.img.ubq/sticker",
1177
+ VectorPath = "//ly.img.ubq/vector_path",
1178
+ RectShape = "//ly.img.ubq/shapes/rect",
1179
+ LineShape = "//ly.img.ubq/shapes/line",
1180
+ StarShape = "//ly.img.ubq/shapes/star",
1181
+ PolygonShape = "//ly.img.ubq/shapes/polygon",
1182
+ EllipseShape = "//ly.img.ubq/shapes/ellipse",
1183
+ Group = "//ly.img.ubq/group"
1184
+ }
1185
+
1186
+ declare enum DesignUnit {
1187
+ Pixel = "px",
1188
+ Millimeter = "mm",
1189
+ Inch = "in"
1190
+ }
1191
+
1192
+ /**
1193
+ * @public
1194
+ */
1195
+ export declare class EventAPI {
1196
+ #private;
1197
+
1198
+ /**
1199
+ * Subscribe to block life-cycle events.
1200
+ * @param blocks - A list of blocks to filter events by. If the list is empty, events for every block are sent.
1201
+ * @param callback - The event callback. Events are bundled and sent at the end of each engine update.
1202
+ * @returns A method to unsubscribe.
1203
+ */
1204
+ subscribe(blocks: DesignElementId[], callback: (events: BlockEvent_2[]) => void): () => void;
1205
+ }
1206
+
1207
+ declare type EventSubscription = number;
1208
+
1209
+ declare type ExportFormat = 'image/png' | 'application/pdf';
1210
+
1211
+ declare interface ExportOptions {
1212
+ jpegQuality: number;
1213
+ pngCompressionLevel: number;
1214
+ useTargetSize: boolean;
1215
+ targetWidth: number;
1216
+ targetHeight: number;
1217
+ }
1218
+
1219
+ declare interface ExportOptions_2 {
1220
+ /** The mime type of the exported blob */
1221
+ mimeType: MimeType_2;
1222
+ 'image/png'?: {
1223
+ /**
1224
+ * The PNG compression level to use, when exporting to PNG.
1225
+ *
1226
+ * Valid values are 0 to 9, higher means smaller, but slower.
1227
+ * Quality is not affected.
1228
+ * Ignored for other encodings.
1229
+ * @defaultValue 5.
1230
+ */
1231
+ compression: number;
1232
+ };
1233
+ 'image/jpeg'?: {
1234
+ /**
1235
+ * The JPEG quality to use when encoding to JPEG.
1236
+ *
1237
+ * Valid values are (0-1], higher means better quality.
1238
+ * Ignored for other encodings.
1239
+ *
1240
+ * @defaultValue 0.9
1241
+ */
1242
+ quality: number;
1243
+ };
1244
+ /** The pages to export with the selected page as the default */
1245
+ pages?: number[];
1246
+ }
1247
+
1248
+ declare type Extensions = {
1249
+ baseURL: string;
1250
+ entries: string[];
1251
+ };
1252
+
1253
+ declare interface Flip {
1254
+ horizontal: boolean;
1255
+ vertical: boolean;
1256
+ }
1257
+
1258
+ declare type FontStyle = 'normal' | 'italic';
1259
+
1260
+ declare type FontWeight = 'thin' | 'extraLight' | 'Light' | 'normal' | 'medium' | 'semiBold' | 'bold' | 'extraBold' | 'heavy';
1261
+
1262
+ /**
1263
+ * A hexadecimal color value (RGB or RGBA) that starts with a '#'
1264
+ * @example #6686FF or #6686FFFF
1265
+ */
1266
+ declare type HexColorString = string;
1267
+
1268
+ /** I18n Settings
1269
+ * Note: this will append keys and not override keys
1270
+ */
1271
+ declare type I18n = Record<string, Translations>;
1272
+
1273
+ declare type ImageDefinition = Preset & {
1274
+ imageURL: string;
1275
+ thumbnailURL?: string;
1276
+ width: number;
1277
+ height: number;
1278
+ levelOfDetail?: {
1279
+ [lod: number]: string;
1280
+ };
1281
+ };
1282
+
1283
+ declare interface ImageElement extends AssetElement {
1284
+ previewUri?: string;
1285
+ size: {
1286
+ width: number;
1287
+ height: number;
1288
+ };
1289
+ }
1290
+
1291
+ declare type Logger = (message: string, level: LogLevel) => void;
1292
+
1293
+ declare enum LogLevel {
1294
+ Info = "Info",
1295
+ Warning = "Warning",
1296
+ Error = "Error"
1297
+ }
1298
+
1299
+ /** @public */
1300
+ declare enum MimeType_2 {
1301
+ Png = "image/png",
1302
+ Jpeg = "image/jpeg",
1303
+ Tga = "image/x-tga",
1304
+ Binary = "application/octet-stream",
1305
+ Pdf = "application/pdf",
1306
+ Zip = "application/zip"
1307
+ }
1308
+
1309
+ declare enum NavigationPosition {
1310
+ Top = "top",
1311
+ Bottom = "bottom"
1312
+ }
1313
+
1314
+ declare interface NotificationEvent {
1315
+ type: NotificationType;
1316
+ i18n: string;
1317
+ }
1318
+
1319
+ declare enum NotificationType {
1320
+ Information = 0,
1321
+ Warning = 1,
1322
+ Error = 2
1323
+ }
1324
+
1325
+ declare type OnUploadCallback = (file: File, onProgress: (progress: number) => void) => Promise<PartialImageElement>;
1326
+
1327
+ declare type OnUploadOptions = {
1328
+ supportedMimeTypes: string[];
1329
+ };
1330
+
1331
+ /** Turn value at K of T into a Partial */
1332
+ declare type Optional<T, K extends keyof T> = Omit<T, K> & Partial<T>;
1333
+
1334
+ declare type Page = {
1335
+ title: {
1336
+ /**
1337
+ * Whether newly created pages should show a title.
1338
+ */
1339
+ show?: boolean;
1340
+ /**
1341
+ * The font file to use to render the page titles.
1342
+ */
1343
+ fontFileUri?: string;
1344
+ };
1345
+ /**
1346
+ * Whether the opacity of the region outside of all
1347
+ * pages should be reduced.
1348
+ */
1349
+ dimOutOfPageAreas?: boolean;
1350
+ };
1351
+
1352
+ declare type PageFormatDefinition = Preset & {
1353
+ width: number;
1354
+ height: number;
1355
+ unit: DesignUnit;
1356
+ dpi?: number;
1357
+ bleedMargin?: number;
1358
+ };
1359
+
1360
+ declare enum PanelPosition {
1361
+ Left = "left",
1362
+ Right = "right"
1363
+ }
1364
+
1365
+ declare type PartialImageElement = Optional<ImageElement, 'size'>;
1366
+
1367
+ /**
1368
+ * @public
1369
+ */
1370
+ export declare enum PositionMode {
1371
+ /** Position in absolute design units. */
1372
+ Absolute = "Absolute",
1373
+ /** Position in relation to the block's parent's size in percent, where 1.0 means 100%. */
1374
+ Percent = "Percent",
1375
+ /** Position is automatically determined. */
1376
+ Undefined = "Auto"
1377
+ }
1378
+
1379
+ declare type Preset = {
1380
+ meta?: {
1381
+ default?: boolean;
1382
+ library?: string;
1383
+ categories?: string[];
1384
+ };
1385
+ };
1386
+
1387
+ declare type Presets = {
1388
+ colors?: {
1389
+ [id: string]: ColorDefinition;
1390
+ };
1391
+ typefaces?: {
1392
+ [id: string]: TypefaceDefinition;
1393
+ };
1394
+ images?: {
1395
+ [id: string]: ImageDefinition;
1396
+ };
1397
+ pageFormats?: {
1398
+ [id: string]: PageFormatDefinition;
1399
+ };
1400
+ colorPalettes?: {
1401
+ [id: string]: ColorPaletteDefinition;
1402
+ };
1403
+ templates?: {
1404
+ [id: string]: TemplateDefinition;
1405
+ };
1406
+ };
1407
+
1408
+ /**
1409
+ * @public
1410
+ */
1411
+ export declare enum PropertyType {
1412
+ Bool = "Bool",
1413
+ Int = "Int",
1414
+ Float = "Float",
1415
+ String = "String",
1416
+ Color = "Color",
1417
+ Enum = "Enum",
1418
+ Struct = "Struct"
1419
+ }
1420
+
1421
+ /**
1422
+ * Please read this before you change anything in this file.
1423
+ *
1424
+ * Types in here are a sub-set of the types in `api/asset.ts` and are meant to be
1425
+ * exposed publicly.
1426
+ *
1427
+ * We do not use the types from `asset.ts` directly to handle (copy&paste) the
1428
+ * syncing of the public type declarations and what we actually use in the config.
1429
+ * This makes it easier to ensure that the customer is using the correct types and
1430
+ * any missmatch between this and the `asset.ts` file will be shown by our
1431
+ * type-checker.
1432
+ *
1433
+ * PLEASE NOTE: If you change anything in here, make the according changes in
1434
+ * the `release/types.d.ts` file.
1435
+ */
1436
+ declare interface QueryData {
1437
+ /**
1438
+ * A query string used for (fuzzy) searching of labels and tags
1439
+ */
1440
+ query?: string;
1441
+ /**
1442
+ * The number of results queried. How many assets shall be returned regardless
1443
+ * of the total number of assets available.
1444
+ *
1445
+ * Together with `page` this can be used for pagination.
1446
+ */
1447
+ perPage: number;
1448
+ /**
1449
+ * The current page queried for paginated views.
1450
+ */
1451
+ page: number;
1452
+ }
1453
+
1454
+ declare type RGBA = [r: number, g: number, b: number, a: number];
1455
+
1456
+ /** All components between 0 and 1 */
1457
+ declare interface RGBAColor {
1458
+ r: number;
1459
+ g: number;
1460
+ b: number;
1461
+ a: number;
1462
+ }
1463
+
1464
+ /** All components between 0 and 1 */
1465
+ declare interface RGBColor {
1466
+ r: number;
1467
+ g: number;
1468
+ b: number;
1469
+ }
1470
+
1471
+ /**
1472
+ * Enum for the engine-internal numerical representations of the roles
1473
+ */
1474
+ declare const enum Role {
1475
+ Creator = 0,
1476
+ Adopter = 1,
1477
+ Viewer = 2,
1478
+ Presenter = 3
1479
+ }
1480
+
1481
+ declare type Scale = 'normal' | 'large';
1482
+
1483
+ /** Export Settings
1484
+ *
1485
+ */
1486
+ declare type Scene = {
1487
+ maskSpotColor?: SpotColor;
1488
+ /**
1489
+ * The DPI value to use when exporting and when converting between pixels and inches or millimeter units.
1490
+ * (In the CESDK, this value is synonymous with PPI).
1491
+ *
1492
+ * This is only relevant for new scenes that are created in the editor. Loaded scenes will use the
1493
+ * value stored in their serialization file.
1494
+ */
1495
+ dpi: number;
1496
+ /**
1497
+ * A scale factor that is applied to the final export resolution.
1498
+ *
1499
+ * This is only relevant for new scenes that are created in the editor. Loaded scenes will use the
1500
+ * value stored in their serialization file.
1501
+ */
1502
+ pixelScaleFactor: number;
1503
+ };
1504
+
1505
+ /**
1506
+ * @public
1507
+ */
1508
+ export declare class SceneAPI {
1509
+ #private;
1510
+
1511
+ /**
1512
+ * Load the contents of a scene file.
1513
+ * @param sceneContent - The scene file contents, a base64 string.
1514
+ * @returns A handle to the loaded scene.
1515
+ */
1516
+ loadFromString(sceneContent: string): Promise<DesignElementId>;
1517
+ /**
1518
+ * Load a scene from the URL to the scene file.
1519
+ * The scene file will be fetched asynchronously by the engine. This requires continous `render`
1520
+ * calls on this engines instance.
1521
+ * @param url - The URL of the scene file.
1522
+ * @returns scene A promise that resolves once the scene was loaded or rejects with an error otherwise.
1523
+ */
1524
+ loadFromURL(url: string): Promise<DesignElementId>;
1525
+ /**
1526
+ * Serializes the current scene into a string. Selection is discarded.
1527
+ * @returns A promise that resolves with a string on success or an error on failure.
1528
+ */
1529
+ saveToString(): Promise<string>;
1530
+ /**
1531
+ * Saves the current scene and all of its referenced assets into an archive.
1532
+ * The archive contains all assets, that were accessible when this function was called.
1533
+ * Blocks in the archived scene reference assets relative from to the location of the scene
1534
+ * file. These references are resolved when loading such a scene via `loadSceneFromURL`.
1535
+ *
1536
+ * @returns A promise that resolves with a Blob on success or an error on failure.
1537
+ */
1538
+ saveToArchive(): Promise<Blob>;
1539
+ /**
1540
+ * Create a new scene, along with its own camera.
1541
+ * @returns The scenes handle.
1542
+ */
1543
+ create(): DesignElementId;
1544
+ /**
1545
+ * Loads the given image and creates a scene with a single page showing the image.
1546
+ * Fetching the image may take an arbitrary amount of time, so the scene isn't immediately
1547
+ * available.
1548
+ * @param url - The image URL.
1549
+ * @param dpi - The scenes DPI.
1550
+ * @param pixelScaleFactor - The displays pixel scale factor.
1551
+ * @returns A promise that resolves with the scene ID on success or rejected with an error otherwise.
1552
+ */
1553
+ createFromImage(url: string, dpi?: number, pixelScaleFactor?: number): Promise<DesignElementId>;
1554
+ /**
1555
+ * Return the currently active scene.
1556
+ * @returns The scene or null, if none was created yet.
1557
+ */
1558
+ get(): DesignElementId | null;
1559
+ }
1560
+
1561
+ declare enum SceneLayout {
1562
+ Free = 0,
1563
+ VerticalStack = 1,
1564
+ HorizontalStack = 2
1565
+ }
1566
+
1567
+ /**
1568
+ * @public
1569
+ */
1570
+ export declare enum SizeMode {
1571
+ /** Size in absolute design units. */
1572
+ Absolute = "Absolute",
1573
+ /** Size in relation to the block's parent's size in percent, where 1.0 means 100%. */
1574
+ Percent = "Percent",
1575
+ /** Size is determined by the block's content. */
1576
+ Auto = "Auto"
1577
+ }
1578
+
1579
+ declare type SpotColor = {
1580
+ name: string;
1581
+ rgbApproximation: RGBColor;
1582
+ cmykApproximation: CMYKColor;
1583
+ };
1584
+
1585
+ /**
1586
+ * @public
1587
+ */
1588
+ declare enum StrokeCornerGeometry {
1589
+ Bevel = "Bevel",
1590
+ Miter = "Miter",
1591
+ Round = "Round"
1592
+ }
1593
+
1594
+ /**
1595
+ * @public
1596
+ */
1597
+ declare enum StrokePosition {
1598
+ Center = "Center",
1599
+ Inner = "Inner",
1600
+ Outer = "Outer"
1601
+ }
1602
+
1603
+ /**
1604
+ * @public
1605
+ */
1606
+ declare enum StrokeStyle {
1607
+ Dashed = "Dashed",
1608
+ DashedRound = "DashedRound",
1609
+ Dotted = "Dotted",
1610
+ LongDashed = "LongDashed",
1611
+ LongDashedRound = "LongDashedRound",
1612
+ Solid = "Solid"
1613
+ }
1614
+
1615
+ declare type TemplateDefinition = Preset & {
1616
+ scene: string | URL | (() => Promise<string>);
1617
+ thumbnailURL?: string | URL;
1618
+ };
1619
+
1620
+ declare type Theme = 'light' | 'dark';
1621
+
1622
+ declare interface Translations {
1623
+ [key: string]: string | Translations;
1624
+ }
1625
+
1626
+ declare interface TypeDescription {
1627
+ name: string;
1628
+ members: Array<TypeMemberDescription>;
1629
+ }
1630
+
1631
+ declare type TypefaceDefinition = Preset & {
1632
+ family: string;
1633
+ fonts: [
1634
+ {
1635
+ fontURL: string;
1636
+ weight: FontWeight;
1637
+ style: FontStyle;
1638
+ }
1639
+ ];
1640
+ };
1641
+
1642
+ declare interface TypeMemberDescription {
1643
+ name: string;
1644
+ type: string;
1645
+ props: Array<TypeProp>;
1646
+ }
1647
+
1648
+ declare interface TypeProp {
1649
+ key: string;
1650
+ value: number | string;
1651
+ }
1652
+
1653
+ declare interface UserInterface {
1654
+ baseURL: string;
1655
+ scale?: Scale;
1656
+ elements: UserInterfaceElements;
1657
+ stylesheets?: {
1658
+ disableShadowDOM?: boolean;
1659
+ disableTagInsertion?: boolean;
1660
+ disableFontInsertion?: boolean;
1661
+ };
1662
+ hide?: boolean;
1663
+ }
1664
+
1665
+ declare interface UserInterfaceElement {
1666
+ show?: boolean;
1667
+ }
1668
+
1669
+ declare interface UserInterfaceElements {
1670
+ view?: {
1671
+ adopter?: {
1672
+ style?: 'default' | 'advanced';
1673
+ };
1674
+ };
1675
+ panels?: {
1676
+ inspector?: UserInterfaceInspector | boolean;
1677
+ settings?: UserInterfaceSettings | boolean;
1678
+ assetLibrary?: UserInterfaceSettings | boolean;
1679
+ };
1680
+ templates?: UserInterfaceElement | boolean;
1681
+ dock?: {
1682
+ iconSize?: Scale;
1683
+ hideLabels?: boolean;
1684
+ };
1685
+ libraries?: {
1686
+ image?: UserInterfaceElement | boolean;
1687
+ text?: UserInterfaceElement | boolean;
1688
+ element?: UserInterfaceElement | boolean;
1689
+ };
1690
+ blocks?: UserInterfaceInspectorBlocks;
1691
+ navigation: UserInterfaceNavigation;
1692
+ }
1693
+
1694
+ declare interface UserInterfaceExportAction extends UserInterfaceElement {
1695
+ format?: ExportFormat[];
1696
+ }
1697
+
1698
+ declare interface UserInterfaceInspector extends UserInterfaceElement {
1699
+ position?: PanelPosition;
1700
+ }
1701
+
1702
+ declare interface UserInterfaceInspectorBlock {
1703
+ }
1704
+
1705
+ declare interface UserInterfaceInspectorBlockImage extends UserInterfaceInspectorBlock {
1706
+ crop?: UserInterfaceElement | boolean;
1707
+ filters?: UserInterfaceElement | boolean;
1708
+ adjustments?: UserInterfaceElement | boolean;
1709
+ effects?: UserInterfaceElement | boolean;
1710
+ blur?: UserInterfaceElement | boolean;
1711
+ }
1712
+
1713
+ declare interface UserInterfaceInspectorBlocks {
1714
+ opacity?: UserInterfaceElement | boolean;
1715
+ transform?: UserInterfaceElement | boolean;
1716
+ '//ly.img.ubq/image': UserInterfaceInspectorBlockImage;
1717
+ '//ly.img.ubq/text': UserInterfaceInspectorBlockText;
1718
+ }
1719
+
1720
+ declare interface UserInterfaceInspectorBlockText extends UserInterfaceInspectorBlock {
1721
+ advanced?: UserInterfaceElement | boolean;
1722
+ color?: UserInterfaceElement | boolean;
1723
+ backgroundColor?: UserInterfaceElement | boolean;
1724
+ }
1725
+
1726
+ declare interface UserInterfaceNavigation extends UserInterfaceElement {
1727
+ position: NavigationPosition;
1728
+ title?: string | null;
1729
+ action?: {
1730
+ close: UserInterfaceElement | boolean;
1731
+ back: UserInterfaceElement | boolean;
1732
+ save: UserInterfaceElement | boolean;
1733
+ export: UserInterfaceExportAction | boolean;
1734
+ share: UserInterfaceElement | boolean;
1735
+ load: UserInterfaceElement | boolean;
1736
+ download: UserInterfaceElement | boolean;
1737
+ };
1738
+ }
1739
+
1740
+ declare interface UserInterfaceSettings extends UserInterfaceElement {
1741
+ }
1742
+
1743
+ /**
1744
+ * @public
1745
+ */
1746
+ export declare class VariableAPI {
1747
+ #private;
1748
+
1749
+ /**
1750
+ * Get all text variables currently stored in the engine.
1751
+ * @returns Return a list of variable names
1752
+ */
1753
+ findAll(): string[];
1754
+ /**
1755
+ * Set a text variable.
1756
+ * @param key - The variable's key.
1757
+ * @param value - The text to replace the variable with.
1758
+ */
1759
+ setString(key: string, value: string): void;
1760
+ /**
1761
+ * Set a text variable.
1762
+ * @param key - The variable's key.
1763
+ * @returns The text value of the variable.
1764
+ */
1765
+ getString(key: string): string;
1766
+ /**
1767
+ * Destroy a text variable.
1768
+ * @param key - The variable's key.
1769
+ */
1770
+ remove(key: string): void;
1771
+ }
1772
+
1773
+ declare type VariableDefinition = Preset & {
1774
+ value: string | number;
1775
+ };
1776
+
1777
+ declare type Variables = {
1778
+ [id: string]: VariableDefinition;
1779
+ };
1780
+
1781
+ declare interface Vec2 {
1782
+ x: number;
1783
+ y: number;
1784
+ }
1785
+
1786
+ declare interface Vec3 {
1787
+ x: number;
1788
+ y: number;
1789
+ z: number;
1790
+ }
1791
+
1792
+ declare interface Vector<T> {
1793
+ size: () => number;
1794
+ get: (index: number) => T;
1795
+ delete: () => void;
1796
+ }
1797
+
1798
+ export { }