@cesdk/cesdk-js 1.6.1 → 1.7.0-alpha.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.
@@ -5,23 +5,23 @@
5
5
  * @public
6
6
  */
7
7
  export declare interface Asset {
8
- /**
9
- * Is a combination of source id, extension pack id (optional), type and asset id
10
- * e.g. "extension://ly.img.cesdk.images.samples/ly.img.image/sample.1"
11
- */
12
- id: string;
13
- /** E.g. `ly.img.image` */
14
- type: string;
15
- /** Groups of the asset. */
16
- groups?: Groups;
17
- /** URI to a thumbnail of the asset used e.g. in the content library UI */
18
- thumbUri: string;
19
-
20
- /** Asset-specific and custom meta information */
21
- meta?: {
22
- uri?: string;
23
- filename?: string;
24
- } & Record<string, unknown>;
8
+ /**
9
+ * Is a combination of source id, extension pack id (optional), type and asset id
10
+ * e.g. "extension://ly.img.cesdk.images.samples/ly.img.image/sample.1"
11
+ */
12
+ id: string;
13
+ /** E.g. `ly.img.image` */
14
+ type: string;
15
+ /** Groups of the asset. */
16
+ groups?: Groups;
17
+ /** URI to a thumbnail of the asset used e.g. in the content library UI */
18
+ thumbUri: string;
19
+
20
+ /** Asset-specific and custom meta information */
21
+ meta?: {
22
+ uri?: string;
23
+ filename?: string;
24
+ } & Record<string, unknown>;
25
25
  }
26
26
 
27
27
  /**
@@ -33,26 +33,26 @@ export declare interface Asset {
33
33
  * @public
34
34
  */
35
35
  export declare interface AssetAPI<QData extends AssetQueryData> {
36
- /** The unique id of the API */
37
- id: string;
38
- /** Find all asset for the given type and the provided query data. */
39
- findAssets(type: string, queryData?: QData): Promise<AssetsQueryResult>;
40
- /** For a given type return every available group */
41
- getGroups: (type: string) => Promise<string[]>;
42
- /** Return all registered/available types */
43
- getTypes: () => string[];
44
- /** The given type is registered. */
45
- hasType: (type: string) => boolean;
46
- /** Credits for the source/api */
47
- credits?: {
48
- name: string;
49
- url?: string;
50
- };
51
- /** General license for all asset from this source */
52
- license?: {
53
- name: string;
54
- url?: string;
55
- };
36
+ /** The unique id of the API */
37
+ id: string;
38
+ /** Find all asset for the given type and the provided query data. */
39
+ findAssets(type: string, queryData?: QData): Promise<AssetsQueryResult>;
40
+ /** For a given type return every available group */
41
+ getGroups: (type: string) => Promise<string[]>;
42
+ /** Return all registered/available types */
43
+ getTypes: () => string[];
44
+ /** The given type is registered. */
45
+ hasType: (type: string) => boolean;
46
+ /** Credits for the source/api */
47
+ credits?: {
48
+ name: string;
49
+ url?: string;
50
+ };
51
+ /** General license for all asset from this source */
52
+ license?: {
53
+ name: string;
54
+ url?: string;
55
+ };
56
56
  }
57
57
 
58
58
  /**
@@ -60,18 +60,18 @@ export declare interface AssetAPI<QData extends AssetQueryData> {
60
60
  * @public
61
61
  */
62
62
  export declare interface AssetDefinition extends Asset {
63
- /**
64
- * Label used to display in aria-label and as a tooltip.
65
- * Will be also searched in a query and should be localized
66
- */
67
- label?: Record<Locale, string>;
68
- /**
69
- * Tags for this asset. Can be used for filtering, but is also useful for
70
- * free-text search. Since the label is searched as well as used for tooltips
71
- * you do not want to overdo it, but still add things which are searched.
72
- * Thus, it should be localized similar to the `label`.
73
- */
74
- tags?: Record<Locale, string[]>;
63
+ /**
64
+ * Label used to display in aria-label and as a tooltip.
65
+ * Will be also searched in a query and should be localized
66
+ */
67
+ label?: Record<Locale, string>;
68
+ /**
69
+ * Tags for this asset. Can be used for filtering, but is also useful for
70
+ * free-text search. Since the label is searched as well as used for tooltips
71
+ * you do not want to overdo it, but still add things which are searched.
72
+ * Thus, it should be localized similar to the `label`.
73
+ */
74
+ tags?: Record<Locale, string[]>;
75
75
  }
76
76
 
77
77
  /**
@@ -79,27 +79,27 @@ export declare interface AssetDefinition extends Asset {
79
79
  * @public
80
80
  */
81
81
  export declare interface AssetQueryData {
82
- /** A query string used for (fuzzy) searching of labels and tags */
83
- query?: string;
84
- /**
85
- * Tags are searched with the query parameter, but this search is fuzzy.
86
- * If one needs to get assets with exactly the tag (from a tag cloud or filter)
87
- * this query parameter should be used.
88
- */
89
- tags?: string | string[];
90
- /** Query only these groups */
91
- groups?: Groups;
92
- /** Filter out assets with this groups */
93
- excludeGroups?: Groups;
94
- /** Choose the locale of the labels and tags for localized search and filtering */
95
- locale?: Locale;
96
- /**
97
- * The number of results queried. How many assets shall be returned regardless
98
- * of the total number of assets available.
99
- *
100
- * Together with `page` this can be used for pagination.
101
- */
102
- perPage: number;
82
+ /** A query string used for (fuzzy) searching of labels and tags */
83
+ query?: string;
84
+ /**
85
+ * Tags are searched with the query parameter, but this search is fuzzy.
86
+ * If one needs to get assets with exactly the tag (from a tag cloud or filter)
87
+ * this query parameter should be used.
88
+ */
89
+ tags?: string | string[];
90
+ /** Query only these groups */
91
+ groups?: Groups;
92
+ /** Filter out assets with this groups */
93
+ excludeGroups?: Groups;
94
+ /** Choose the locale of the labels and tags for localized search and filtering */
95
+ locale?: Locale;
96
+ /**
97
+ * The number of results queried. How many assets shall be returned regardless
98
+ * of the total number of assets available.
99
+ *
100
+ * Together with `page` this can be used for pagination.
101
+ */
102
+ perPage: number;
103
103
  }
104
104
 
105
105
  /**
@@ -107,14 +107,14 @@ export declare interface AssetQueryData {
107
107
  * @public
108
108
  */
109
109
  export declare interface AssetRegistry {
110
- /** Returns all sources available in the engine */
111
- getSources(type?: string): AssetSource[];
112
- /** Returns a source with the given id or undefined if not found */
113
- getSource(id: string): AssetSource | undefined;
114
- /** Adds a source to this registry. */
115
- addSource(source: AssetSource): void;
116
- /** Removes a source from this registry. */
117
- removeSource(id: string): void;
110
+ /** Returns all sources available in the engine */
111
+ getSources(type?: string): AssetSource[];
112
+ /** Returns a source with the given id or undefined if not found */
113
+ getSource(id: string): AssetSource | undefined;
114
+ /** Adds a source to this registry. */
115
+ addSource(source: AssetSource): void;
116
+ /** Removes a source from this registry. */
117
+ removeSource(id: string): void;
118
118
  }
119
119
 
120
120
  /**
@@ -122,28 +122,28 @@ export declare interface AssetRegistry {
122
122
  * @public
123
123
  */
124
124
  export declare interface AssetResult extends Asset {
125
- /** The locale of the label and tags */
126
- locale?: Locale;
127
- /** The label of the result. Used for description and tooltips. */
128
- label?: string;
129
- /** The tags of this asset. Used for filtering and free-text searching. */
130
- tags?: string[];
131
-
132
- /** Credits for the artist of the asset */
133
- credits?: {
134
- name: string;
135
- url?: string;
136
- };
137
- /** License for this asset. Overwrites the source license if present */
138
- license?: {
139
- name: string;
140
- url?: string;
141
- };
142
- /** UTM parameters for the links inside the credits */
143
- utm?: {
144
- source?: string;
145
- medium?: string;
146
- };
125
+ /** The locale of the label and tags */
126
+ locale?: Locale;
127
+ /** The label of the result. Used for description and tooltips. */
128
+ label?: string;
129
+ /** The tags of this asset. Used for filtering and free-text searching. */
130
+ tags?: string[];
131
+
132
+ /** Credits for the artist of the asset */
133
+ credits?: {
134
+ name: string;
135
+ url?: string;
136
+ };
137
+ /** License for this asset. Overwrites the source license if present */
138
+ license?: {
139
+ name: string;
140
+ url?: string;
141
+ };
142
+ /** UTM parameters for the links inside the credits */
143
+ utm?: {
144
+ source?: string;
145
+ medium?: string;
146
+ };
147
147
  }
148
148
 
149
149
  /**
@@ -151,41 +151,41 @@ export declare interface AssetResult extends Asset {
151
151
  * @public
152
152
  */
153
153
  declare interface AssetResult_2 {
154
- /** A unique id of this asset */
155
- id: string;
156
- /** E.g. `ly.img.image` */
157
- type: string;
158
- /** URI to a thumbnail of the asset used e.g. in the content library UI */
159
- thumbUri: string;
160
- /** Original size of the asset. */
161
- size: {
162
- width: number;
163
- height: number;
164
- };
165
- /** Asset-specific and custom meta information */
166
- meta?: {
167
- uri?: string;
168
- filename?: string;
169
- } & Record<string, unknown>;
170
- /** The locale of the label and tags */
171
- locale?: string;
172
- /** The label of the result. Used for description and tooltips. */
173
- label?: string;
174
- /** The tags of this asset. Used for filtering and free-text searching. */
175
- tags?: string[];
176
- context: {
177
- sourceId: string;
178
- };
179
- /** Credits for the artist of the asset */
180
- credits?: {
181
- name: string;
182
- url?: string;
183
- };
184
- /** License for this asset. Overwrites the source license if present */
185
- license?: {
186
- name: string;
187
- url?: string;
188
- };
154
+ /** A unique id of this asset */
155
+ id: string;
156
+ /** E.g. `ly.img.image` */
157
+ type: string;
158
+ /** URI to a thumbnail of the asset used e.g. in the content library UI */
159
+ thumbUri: string;
160
+ /** Original size of the asset. */
161
+ size: {
162
+ width: number;
163
+ height: number;
164
+ };
165
+ /** Asset-specific and custom meta information */
166
+ meta?: {
167
+ uri?: string;
168
+ filename?: string;
169
+ } & Record<string, unknown>;
170
+ /** The locale of the label and tags */
171
+ locale?: string;
172
+ /** The label of the result. Used for description and tooltips. */
173
+ label?: string;
174
+ /** The tags of this asset. Used for filtering and free-text searching. */
175
+ tags?: string[];
176
+ context: {
177
+ sourceId: string;
178
+ };
179
+ /** Credits for the artist of the asset */
180
+ credits?: {
181
+ name: string;
182
+ url?: string;
183
+ };
184
+ /** License for this asset. Overwrites the source license if present */
185
+ license?: {
186
+ name: string;
187
+ url?: string;
188
+ };
189
189
  }
190
190
 
191
191
  /**
@@ -193,44 +193,44 @@ declare interface AssetResult_2 {
193
193
  * @public
194
194
  */
195
195
  export declare interface AssetSource extends AssetAPI<PaginatedAssetQueryData> {
196
- /**
197
- * Can the source add, update and remove assets dynamically? If `false`
198
- * methods like `addAsset` `updateAsset` and `removeAsset` will throw and
199
- * error.
200
- */
201
- canManageAssets?: boolean;
202
- /**
203
- * Indicates if the asset shall be downloaded to handle the raw data instead
204
- * of an URL reference. Do this if you do not want to depend on
205
- * a service after adding the asset to the scene. If this is your own API
206
- * with your own service, you do not need to set this and avoid downloading /
207
- * re-uploading the assets.
208
- */
209
- downloadAssets?: (asset: AssetResult) => Promise<Blob>;
210
- /**
211
- * @returns the asset or undefined if no asset with the given id could be found
212
- */
213
- getAsset(id: string): Promise<AssetResult | undefined>;
214
- /**
215
- * Adds the given asset to this source. Throws an error if `canManageAssets`
216
- * is `false`.
217
- *
218
- * @returns the id of the added asset
219
- */
220
- addAsset(type: string, asset: AssetDefinition): Promise<string>;
221
- /**
222
- * Updates the asset of this source. Throws an error if `canManageAssets`
223
- * is `false` or no asset with the given id could not be found.
224
- *
225
- * @returns the id of the added asset
226
- */
227
- updateAsset(assetId: string, asset: AssetDefinition): Promise<void>;
228
- /**
229
- * Removes the given asset from this source.
230
- *
231
- * @returns true if asset was found and removed, and false otherwise
232
- */
233
- removeAsset(assetId: string): Promise<boolean>;
196
+ /**
197
+ * Can the source add, update and remove assets dynamically? If `false`
198
+ * methods like `addAsset` `updateAsset` and `removeAsset` will throw and
199
+ * error.
200
+ */
201
+ canManageAssets?: boolean;
202
+ /**
203
+ * Indicates if the asset shall be downloaded to handle the raw data instead
204
+ * of an URL reference. Do this if you do not want to depend on
205
+ * a service after adding the asset to the scene. If this is your own API
206
+ * with your own service, you do not need to set this and avoid downloading /
207
+ * re-uploading the assets.
208
+ */
209
+ downloadAssets?: (asset: AssetResult) => Promise<Blob>;
210
+ /**
211
+ * @returns the asset or undefined if no asset with the given id could be found
212
+ */
213
+ getAsset(id: string): Promise<AssetResult | undefined>;
214
+ /**
215
+ * Adds the given asset to this source. Throws an error if `canManageAssets`
216
+ * is `false`.
217
+ *
218
+ * @returns the id of the added asset
219
+ */
220
+ addAsset(type: string, asset: AssetDefinition): Promise<string>;
221
+ /**
222
+ * Updates the asset of this source. Throws an error if `canManageAssets`
223
+ * is `false` or no asset with the given id could not be found.
224
+ *
225
+ * @returns the id of the added asset
226
+ */
227
+ updateAsset(assetId: string, asset: AssetDefinition): Promise<void>;
228
+ /**
229
+ * Removes the given asset from this source.
230
+ *
231
+ * @returns true if asset was found and removed, and false otherwise
232
+ */
233
+ removeAsset(assetId: string): Promise<boolean>;
234
234
  }
235
235
 
236
236
  /**
@@ -238,36 +238,33 @@ export declare interface AssetSource extends AssetAPI<PaginatedAssetQueryData> {
238
238
  * @public
239
239
  */
240
240
  declare interface AssetSource_2 {
241
- /** The asset types returned by this source. Will default to ['ly.img.image']. */
242
- types?: string[];
243
- /** Find all asset for the given type and the provided query data. */
244
- findAssets(
245
- type: string,
246
- queryData?: QueryData
247
- ): Promise<AssetsQueryResult_2 | undefined>;
248
- /**
249
- * Indicates if the asset shall be downloaded to handle the raw data instead
250
- * of an URL reference. Do this if you do not want to depend on
251
- * a service after adding the asset to the scene. If this is your own API
252
- * with your own service, you do not need to set this and avoid downloading /
253
- * re-uploading the assets.
254
- */
255
- downloadAssets?: (asset: AssetResult_2) => Promise<Blob>;
256
- /** Credits for the source/api */
257
- credits?: {
258
- name: string;
259
- url?: string;
260
- };
261
- /** General license for all asset from this source */
262
- license?: {
263
- name: string;
264
- url?: string;
265
- };
241
+ /** The asset types returned by this source. Will default to ['ly.img.image']. */
242
+ types?: string[];
243
+ /** Find all asset for the given type and the provided query data. */
244
+ findAssets(type: string, queryData?: QueryData): Promise<AssetsQueryResult_2 | undefined>;
245
+ /**
246
+ * Indicates if the asset shall be downloaded to handle the raw data instead
247
+ * of an URL reference. Do this if you do not want to depend on
248
+ * a service after adding the asset to the scene. If this is your own API
249
+ * with your own service, you do not need to set this and avoid downloading /
250
+ * re-uploading the assets.
251
+ */
252
+ downloadAssets?: (asset: AssetResult_2) => Promise<Blob>;
253
+ /** Credits for the source/api */
254
+ credits?: {
255
+ name: string;
256
+ url?: string;
257
+ };
258
+ /** General license for all asset from this source */
259
+ license?: {
260
+ name: string;
261
+ url?: string;
262
+ };
266
263
  }
267
264
 
268
265
  /** @public */
269
266
  declare type AssetSources = {
270
- [id: string]: AssetSource_2;
267
+ [id: string]: AssetSource_2;
271
268
  };
272
269
 
273
270
  /**
@@ -275,14 +272,14 @@ declare type AssetSources = {
275
272
  * @public
276
273
  */
277
274
  export declare interface AssetsQueryResult {
278
- /** The assets in the requested page */
279
- assets: AssetResult[];
280
- /** The current, requested page */
281
- currentPage: number;
282
- /** The next page to query if it exists */
283
- nextPage?: number;
284
- /** How many assets are there in total for the current query regardless of the page */
285
- total: number;
275
+ /** The assets in the requested page */
276
+ assets: AssetResult[];
277
+ /** The current, requested page */
278
+ currentPage: number;
279
+ /** The next page to query if it exists */
280
+ nextPage?: number;
281
+ /** How many assets are there in total for the current query regardless of the page */
282
+ total: number;
286
283
  }
287
284
 
288
285
  /**
@@ -290,37 +287,20 @@ export declare interface AssetsQueryResult {
290
287
  * @public
291
288
  */
292
289
  declare interface AssetsQueryResult_2 {
293
- /** The assets in the requested page */
294
- assets: AssetResult_2[];
295
- /** The current, requested page */
296
- currentPage: number;
297
- /** The next page to query if it exists */
298
- nextPage?: number;
299
- /** How many assets are there in total for the current query regardless of the page */
300
- total: number;
290
+ /** The assets in the requested page */
291
+ assets: AssetResult_2[];
292
+ /** The current, requested page */
293
+ currentPage: number;
294
+ /** The next page to query if it exists */
295
+ nextPage?: number;
296
+ /** How many assets are there in total for the current query regardless of the page */
297
+ total: number;
301
298
  }
302
299
 
303
300
  /**
304
301
  * @public
305
302
  */
306
- export declare type BlendMode =
307
- | 'PassThrough'
308
- | 'Normal'
309
- | 'Darken'
310
- | 'Multiply'
311
- | 'ColorBurn'
312
- | 'Lighten'
313
- | 'Screen'
314
- | 'ColorDodge'
315
- | 'Overlay'
316
- | 'SoftLight'
317
- | 'HardLight'
318
- | 'Difference'
319
- | 'Exclusion'
320
- | 'Hue'
321
- | 'Saturation'
322
- | 'Color'
323
- | 'Luminosity';
303
+ export declare type BlendMode = 'PassThrough' | 'Normal' | 'Darken' | 'Multiply' | 'ColorBurn' | 'Lighten' | 'Screen' | 'ColorDodge' | 'Overlay' | 'SoftLight' | 'HardLight' | 'Difference' | 'Exclusion' | 'Hue' | 'Saturation' | 'Color' | 'Luminosity';
324
304
 
325
305
  /** @public */
326
306
  declare type Block = number;
@@ -329,1026 +309,981 @@ declare type Block = number;
329
309
  * @public
330
310
  */
331
311
  export declare class BlockAPI {
332
- #private;
333
-
334
- /**
335
- * Exports a design block element as a file of the given mime type.
336
- * Performs an internal update to resolve the final layout for the blocks.
337
- * @param handle - The design block element to export.
338
- * @param mimeType - The mime type of the output file.
339
- * @returns A promise that resolves with the exported image or is rejected with an error.
340
- */
341
- export(handle: DesignBlockId, mimeType?: MimeType_2): Promise<Blob>;
342
-
343
- /**
344
- * Loads existing blocks from the given string.
345
- * The blocks are not attached by default and won't be visible until attached to a page or the scene.
346
- * @param content - A string representing the given blocks.
347
- * @returns A promise that resolves with a list of handles representing the found blocks or an error.
348
- */
349
- loadFromString(content: string): Promise<DesignBlockId[]>;
350
- /**
351
- * Saves the given blocks into a string. If given the root of a block hierarchy, e.g. a
352
- * page with multiple children, the entire hierarchy is saved.
353
- * @param blocks - The blocks to save
354
- * @returns A promise that resolves to a string representing the blocks or an error.
355
- */
356
- saveToString(blocks: DesignBlockId[]): Promise<string>;
357
- /**
358
- * Create a new block, fails if type is unknown.
359
- * @param type - The type of the block that shall be created.
360
- * @returns The created blocks handle.
361
- */
362
- create(type: DesignBlockType): DesignBlockId;
363
-
364
- /**
365
- * Get the type of the given block, fails if the block is invalid.
366
- * @param id - The block to query.
367
- * @returns The blocks type.
368
- */
369
- getType(id: DesignBlockId): DesignBlockType;
370
- /**
371
- * Update the selection state of a block.
372
- * Fails for invalid blocks.
373
- * @param id - The block to query.
374
- * @param selected - Whether or not the block should be selected.
375
- */
376
- setSelected(id: DesignBlockId, selected: boolean): void;
377
- /**
378
- * Get the selected state of a block.
379
- * @param id - The block to query.
380
- * @returns True if the block is selected, false otherwise.
381
- */
382
- isSelected(id: DesignBlockId): boolean;
383
- /**
384
- * Get all currently selected blocks.
385
- * @returns An array of block ids.
386
- */
387
- findAllSelected(): DesignBlockId[];
388
- /**
389
- * Confirms that a given set of blocks can be grouped together.
390
- * @param ids - A non-empty array of block ids.
391
- * @returns Whether the blocks can be grouped together.
392
- */
393
- isGroupable(ids: DesignBlockId[]): boolean;
394
- /**
395
- * Group blocks together.
396
- * @param ids - A non-empty array of block ids.
397
- * @returns The block id of the created group.
398
- */
399
- group(ids: DesignBlockId[]): DesignBlockId;
400
- /**
401
- * Ungroups a group.
402
- * @param id - The group id from a previous call to `group`.
403
- */
404
- ungroup(id: DesignBlockId): void;
405
- /**
406
- * Changes selection from selected group to a block within that group.
407
- * Nothing happens if `group` is not a group.
408
- * @param id - The group id from a previous call to `group`.
409
- */
410
- enterGroup(id: DesignBlockId): void;
411
- /**
412
- * Changes selection from a group's selected block to that group.
413
- * Nothing happens if the `id` is not part of a group.
414
- * @param id - A block id.
415
- */
416
- exitGroup(id: DesignBlockId): void;
417
- /**
418
- * Update a block's name.
419
- * @param id - The block to update.
420
- * @param name - The name to set.
421
- */
422
- setName(id: DesignBlockId, name: string): void;
423
- /**
424
- * Get a block's name.
425
- * @param id - The block to update.
426
- */
427
- getName(id: DesignBlockId): string;
428
- /**
429
- * Finds all blocks with the given name.
430
- * @param name - The name to search for.
431
- * @returns A list of block ids.
432
- */
433
- findByName(name: string): DesignBlockId[];
434
- /**
435
- * Finds all blocks with the given type.
436
- * @param type - The type to search for.
437
- * @returns A list of block ids.
438
- */
439
- findByType(type: DesignBlockType): DesignBlockId[];
440
- /**
441
- * Return all blocks currently known to the engine.
442
- * @returns A list of block ids.
443
- */
444
- findAll(): DesignBlockId[];
445
- /**
446
- * Return all placeholder blocks in the current scene.
447
- * @returns A list of block ids.
448
- */
449
- findAllPlaceholders(): DesignBlockId[];
450
- /**
451
- * Query a block's visibility.
452
- * @param id - The block to query.
453
- * @returns True if visible, false otherwise.
454
- */
455
- isVisible(id: DesignBlockId): boolean;
456
- /**
457
- * Update a block's visibility.
458
- * @param id - The block to update.
459
- * @param visible - Whether the block shall be visible.
460
- */
461
- setVisible(id: DesignBlockId, visible: boolean): void;
462
- /**
463
- * Query a block's clipped state. If true, the block should clip
464
- * its contents to its frame.
465
- * @param id - The block to query.
466
- * @returns True if clipped, false otherwise.
467
- */
468
- isClipped(id: DesignBlockId): boolean;
469
- /**
470
- * Update a block's clipped state.
471
- * @param id - The block to update.
472
- * @param clipped - Whether the block should clips its contents to its frame.
473
- */
474
- setClipped(id: DesignBlockId, clipped: boolean): void;
475
- /**
476
- * Query a block's x position.
477
- * @param id - The block to query.
478
- * @returns The value of the x position.
479
- */
480
- getPositionX(id: DesignBlockId): number;
481
- /**
482
- * Query a block's mode for its x position.
483
- * @param id - The block to query.
484
- * @returns The current mode for the x position: absolute, percent or undefined.
485
- */
486
- getPositionXMode(id: DesignBlockId): PositionMode;
487
- /**
488
- * Query a block's y position.
489
- * @param id - The block to query.
490
- * @returns The value of the y position.
491
- */
492
- getPositionY(id: DesignBlockId): number;
493
- /**
494
- * Query a block's mode for its y position.
495
- * @param id - The block to query.
496
- * @returns The current mode for the y position: absolute, percent or undefined.
497
- */
498
- getPositionYMode(id: DesignBlockId): PositionMode;
499
- /**
500
- * Update a block's x position.
501
- * The position refers to the block's local space, relative to its parent with the origin at the top left.
502
- * @param id - The block to update.
503
- * @param value - The value of the x position.
504
- */
505
- setPositionX(id: DesignBlockId, value: number): void;
506
- /**
507
- * Set a block's mode for its x position.
508
- * @param id - The block to update.
509
- * @param mode - The x position mode: absolute, percent or undefined.
510
- */
511
- setPositionXMode(id: DesignBlockId, mode: PositionMode): void;
512
- /**
513
- * Update a block's y position.
514
- * The position refers to the block's local space, relative to its parent with the origin at the top left.
515
- * @param id - The block to update.
516
- * @param value - The value of the y position.
517
- */
518
- setPositionY(id: DesignBlockId, value: number): void;
519
- /**
520
- * Set a block's mode for its y position.
521
- * @param id - The block to update.
522
- * @param mode - The y position mode: absolute, percent or undefined.
523
- */
524
- setPositionYMode(id: DesignBlockId, mode: PositionMode): void;
525
- /**
526
- * Query a block's rotation in radians.
527
- * @param id - The block to query.
528
- * @returns The block's rotation around its center in radians.
529
- */
530
- getRotation(id: DesignBlockId): number;
531
- /**
532
- * Update a block's rotation.
533
- * @param id - The block to update.
534
- * @param radians - The new rotation in radians. Rotation is applied around the block's center.
535
- */
536
- setRotation(id: DesignBlockId, radians: number): void;
537
- /**
538
- * Query a block's horizontal flip state.
539
- * @param id - The block to query.
540
- * @returns A boolean indicating for whether the block is flipped in the queried direction
541
- */
542
- getFlipHorizontal(id: DesignBlockId): boolean;
543
- /**
544
- * Query a block's vertical flip state.
545
- * @param id - The block to query.
546
- * @returns A boolean indicating for whether the block is flipped in the queried direction
547
- */
548
- getFlipVertical(id: DesignBlockId): boolean;
549
- /**
550
- * Update a block's horizontal flip.
551
- * @param id - The block to update.
552
- * @param flip - If the flip should be enabled.
553
- */
554
- setFlipHorizontal(id: DesignBlockId, flip: boolean): void;
555
- /**
556
- * Update a block's vertical flip.
557
- * @param id - The block to update.
558
- * @param flip - If the flip should be enabled.
559
- */
560
- setFlipVertical(id: DesignBlockId, flip: boolean): void;
561
- /**
562
- * Query a block's width.
563
- * @param id - The block to query.
564
- * @returns The value of the block's width.
565
- */
566
- getWidth(id: DesignBlockId): number;
567
- /**
568
- * Query a block's mode for its width.
569
- * @param id - The block to query.
570
- * @returns The current mode for the width: absolute, percent or auto.
571
- */
572
- getWidthMode(id: DesignBlockId): SizeMode;
573
- /**
574
- * Query a block's height.
575
- * @param id - The block to query.
576
- * @returns The value of the block's height.
577
- */
578
- getHeight(id: DesignBlockId): number;
579
- /**
580
- * Query a block's mode for its height.
581
- * @param id - The block to query.
582
- * @returns The current mode for the height: absolute, percent or auto.
583
- */
584
- getHeightMode(id: DesignBlockId): SizeMode;
585
- /**
586
- * Query a block's content fill mode.
587
- * @param id - The block to query.
588
- * @returns The current mode: crop, cover or contain.
589
- */
590
- getContentFillMode(id: DesignBlockId): ContentFillMode;
591
- /**
592
- * Update a block's width.
593
- * @param id - The block to update.
594
- * @param value - The new width of the block.
595
- */
596
- setWidth(id: DesignBlockId, value: number): void;
597
- /**
598
- * Set a block's mode for its width.
599
- * @param id - The block to update.
600
- * @param mode - The width mode: absolute, percent or auto.
601
- */
602
- setWidthMode(id: DesignBlockId, mode: SizeMode): void;
603
- /**
604
- * Update a block's height.
605
- * @param id - The block to update.
606
- * @param value - The new height of the block.
607
- */
608
- setHeight(id: DesignBlockId, value: number): void;
609
- /**
610
- * Set a block's mode for its height.
611
- * @param id - The block to update.
612
- * @param mode - The height mode: absolute, percent or auto.
613
- */
614
- setHeightMode(id: DesignBlockId, mode: SizeMode): void;
615
- /**
616
- * Set a block's content fill mode.
617
- * @param id - The block to update.
618
- * @param mode - The content fill mode mode: crop, cover or contain.
619
- */
620
- setContentFillMode(id: DesignBlockId, mode: ContentFillMode): void;
621
- /**
622
- * Get a block's layouted width. The layouted width is only available after an
623
- * internal update loop, which may not happen immediately.
624
- * @param id - The block to query.
625
- * @returns The layouted width.
626
- */
627
- getFrameWidth(id: DesignBlockId): number;
628
- /**
629
- * Get a block's layouted height. The layouted height is only available after an
630
- * internal update loop, which may not happen immediately.
631
- * @param id - The block to query.
632
- * @returns The layouted height.
633
- */
634
- getFrameHeight(id: DesignBlockId): number;
635
- /**
636
- * Duplicates a block including its children.
637
- * @param id - The block to duplicate.
638
- * @returns The handle of the duplicate.
639
- */
640
- duplicate(id: DesignBlockId): DesignBlockId;
641
- /**
642
- * Destroys a block.
643
- * @param id - The block to destroy.
644
- */
645
- destroy(id: DesignBlockId): void;
646
- /**
647
- * Check if a block is valid. A block becomes invalid once it has been destroyed.
648
- * @param id - The block to query.
649
- * @returns True, if the block is valid.
650
- */
651
- isValid(id: DesignBlockId): boolean;
652
- /**
653
- * Query a block's parent.
654
- * @param id - The block to query.
655
- * @returns The parent's handle.
656
- */
657
- getParent(id: DesignBlockId): DesignBlockId;
658
- /**
659
- * Get all children of the given block. Children
660
- * are sorted in their rendering order: Last child is rendered
661
- * in front of other children.
662
- * @param id - The block to query.
663
- * @returns A list of block ids.
664
- */
665
- getChildren(id: DesignBlockId): DesignBlockId[];
666
- /**
667
- * Insert a new or existing child at a certain position in the parent's children.
668
- * @param parent - The block whose children should be updated.
669
- * @param child - The child to insert. Can be an existing child of `parent`.
670
- * @param index - The index to insert or move to.
671
- */
672
- insertChild(parent: DesignBlockId, child: DesignBlockId, index: number): void;
673
- /**
674
- * Appends a new or existing child to a block's children.
675
- * @param parent - The block whose children should be updated.
676
- * @param child - The child to insert. Can be an existing child of `parent`.
677
- */
678
- appendChild(parent: DesignBlockId, child: DesignBlockId): void;
679
- /** Checks whether the given block references any variables. Doesn't check the block's children.
680
- *
681
- * @param id - The block to inspect.
682
- * @returns true if the block references variables and false otherwise.
683
- */
684
- referencesAnyVariables(id: DesignBlockId): boolean;
685
- /**
686
- * Get the x position of the block's axis-aligned bounding box in the scene's global coordinate space.
687
- * The scene's global coordinate space has its origin at the top left.
688
- * @param id - The block whose bounding box should be calculated.
689
- * @returns float The x coordinate of the position of the axis-aligned bounding box.
690
- */
691
- getGlobalBoundingBoxX(id: DesignBlockId): number;
692
- /**
693
- * Get the y position of the block's axis-aligned bounding box in the scene's global coordinate space.
694
- * The scene's global coordinate space has its origin at the top left.
695
- * @param id - The block whose bounding box should be calculated.
696
- * @returns float The y coordinate of the position of the axis-aligned bounding box.
697
- */
698
- getGlobalBoundingBoxY(id: DesignBlockId): number;
699
- /**
700
- * Get the width of the block's axis-aligned bounding box in the scene's global coordinate space.
701
- * The scene's global coordinate space has its origin at the top left.
702
- * @param id - The block whose bounding box should be calculated.
703
- * @returns float The width of the axis-aligned bounding box.
704
- */
705
- getGlobalBoundingBoxWidth(id: DesignBlockId): number;
706
- /**
707
- * Get the height of the block's axis-aligned bounding box in the scene's global coordinate space.
708
- * The scene's global coordinate space has its origin at the top left.
709
- * @param id - The block whose bounding box should be calculated.
710
- * @returns float The height of the axis-aligned bounding box.
711
- */
712
- getGlobalBoundingBoxHeight(id: DesignBlockId): number;
713
- /**
714
- * Scales the block and all of its children proportionally around the specified
715
- * relative anchor point.
716
- *
717
- * This updates the position, size and style properties (e.g. stroke width) of
718
- * the block and its children.
719
- *
720
- * @param id - The block that should be scaled.
721
- * @param scale - The scale factor to be applied to the current properties of the block.
722
- * @param anchorX - The relative position along the width of the block around which the
723
- * scaling should occur. (0 = left edge, 0.5 = center, 1 = right edge)
724
- * @param anchorY - The relative position along the height of the block around which the
725
- * scaling should occur. (0 = top edge, 0.5 = center, 1 = bottom edge)
726
- */
727
- scale(
728
- id: DesignBlockId,
729
- scale: number,
730
- anchorX?: number,
731
- anchorY?: number
732
- ): void;
733
- /**
734
- * Get all available properties of a block.
735
- * @param id - The block whose properties should be queried.
736
- * @returns A list of the property names.
737
- */
738
- findAllProperties(id: DesignBlockId): string[];
739
- /**
740
- * Get the type of a property given its name.
741
- * @param property - The name of the property whose type should be queried.
742
- * @returns The property type.
743
- */
744
- getPropertyType(property: string): PropertyType;
745
- /**
746
- * Get all the possible values of an enum given an enum property.
747
- * @param enumProperty - The name of the property whose enum values should be queried.
748
- * @returns A list of the enum value names as string.
749
- */
750
- getEnumValues<T = string>(enumProperty: string): T[];
751
- /**
752
- * Set a bool property of the given design block to the given value.
753
- * @param id - The block whose property should be set.
754
- * @param property - The name of the property to set.
755
- * @param value - The value to set.
756
- */
757
- setBool(id: DesignBlockId, property: string, value: boolean): void;
758
- /**
759
- * Get the value of a bool property of the given design block.
760
- * @param id - The block whose property should be queried.
761
- * @param property - The name of the property to query.
762
- * @returns The value of the property.
763
- */
764
- getBool(id: DesignBlockId, property: string): boolean;
765
- /**
766
- * Set an int property of the given design block to the given value.
767
- * @param id - The block whose property should be set.
768
- * @param property - The name of the property to set.
769
- * @param value - The value to set.
770
- */
771
- setInt(id: DesignBlockId, property: string, value: number): void;
772
- /**
773
- * Get the value of an int property of the given design block.
774
- * @param id - The block whose property should be queried.
775
- * @param property - The name of the property to query.
776
- * @returns The value of the property.
777
- */
778
- getInt(id: DesignBlockId, property: string): number;
779
- /**
780
- * Set a float property of the given design block to the given value.
781
- * @param id - The block whose property should be set.
782
- * @param property - The name of the property to set.
783
- * @param value - The value to set.
784
- */
785
- setFloat(id: DesignBlockId, property: string, value: number): void;
786
- /**
787
- * Get the value of a float property of the given design block.
788
- * @param id - The block whose property should be queried.
789
- * @param property - The name of the property to query.
790
- * @returns The value of the property.
791
- */
792
- getFloat(id: DesignBlockId, property: string): number;
793
- /**
794
- * Set a string property of the given design block to the given value.
795
- * @param id - The block whose property should be set.
796
- * @param property - The name of the property to set.
797
- * @param value - The value to set.
798
- */
799
- setString(id: DesignBlockId, property: string, value: string): void;
800
- /**
801
- * Get the value of a string property of the given design block.
802
- * @param id - The block whose property should be queried.
803
- * @param property - The name of the property to query.
804
- * @returns The value of the property.
805
- */
806
- getString(id: DesignBlockId, property: string): string;
807
- /**
808
- * Set a color property of the given design block to the given value.
809
- * @param id - The block whose property should be set.
810
- * @param property - The name of the property to set.
811
- * @param r - The red color component in the range of 0 to 1.
812
- * @param g - The green color component in the range of 0 to 1.
813
- * @param b - The blue color component in the range of 0 to 1.
814
- * @param a - The alpha color component in the range of 0 to 1.
815
- */
816
- setColorRGBA(
817
- id: DesignBlockId,
818
- property: string,
819
- r: number,
820
- g: number,
821
- b: number,
822
- a: number
823
- ): void;
824
- /**
825
- * Get the value of a string property of the given design block.
826
- * @param id - The block whose property should be queried.
827
- * @param property - The name of the property to query.
828
- * @returns A tuple of channels red, green, blue and alpha in the range of 0 to 1.
829
- */
830
- getColorRGBA(id: DesignBlockId, property: string): RGBA;
831
- /**
832
- * Set an enum property of the given design block to the given value.
833
- * @param id - The block whose property should be set.
834
- * @param property - The name of the property to set.
835
- * @param value - The enum value as string.
836
- */
837
- setEnum(id: DesignBlockId, property: string, value: string): void;
838
- /**
839
- * Get the value of an enum property of the given design block.
840
- * @param id - The block whose property should be queried.
841
- * @param property - The name of the property to query.
842
- * @returns The value as string.
843
- */
844
- getEnum(id: DesignBlockId, property: string): string;
845
- /**
846
- * Query if the given block has crop properties.
847
- * @param id - The block to query.
848
- * @returns true, if the block has crop properties.
849
- */
850
- hasCrop(id: DesignBlockId): boolean;
851
- /**
852
- * Set the crop scale in x direction of the given design block.
853
- * @param id - The block whose crop should be set.
854
- * @param scaleX - The scale in x direction.
855
- */
856
- setCropScaleX(id: DesignBlockId, scaleX: number): void;
857
- /**
858
- * Set the crop scale in y direction of the given design block.
859
- * @param id - The block whose crop should be set.
860
- * @param scaleY - The scale in y direction.
861
- */
862
- setCropScaleY(id: DesignBlockId, scaleY: number): void;
863
- /**
864
- * Set the crop rotation of the given design block.
865
- * @param id - The block whose crop should be set.
866
- * @param rotation - The rotation in radians.
867
- */
868
- setCropRotation(id: DesignBlockId, rotation: number): void;
869
- /**
870
- * Set the crop translation in x direction of the given design block.
871
- * @param id - The block whose crop should be set.
872
- * @param translationY - The translation in y direction.
873
- */
874
- setCropTranslationX(id: DesignBlockId, translationX: number): void;
875
- /**
876
- * Set the crop translation in y direction of the given design block.
877
- * @param id - The block whose crop should be set.
878
- * @param translationY - The translation in y direction.
879
- */
880
- setCropTranslationY(id: DesignBlockId, translationY: number): void;
881
- /**
882
- * Resets the manually set crop of the given design block.
883
- * The block's content fill mode is set to 'cover'.
884
- * @param id - The block whose crop should be reset.
885
- */
886
- resetCrop(id: DesignBlockId): void;
887
- /**
888
- * Get the crop scale on the x axis of the given design block.
889
- * @param id - The block whose scale should be queried.
890
- * @returns The scale on the x axis.
891
- */
892
- getCropScaleX(id: DesignBlockId): number;
893
- /**
894
- * Get the crop scale on the y axis of the given design block.
895
- * @param id - The block whose scale should be queried.
896
- * @returns The scale on the y axis.
897
- */
898
- getCropScaleY(id: DesignBlockId): number;
899
- /**
900
- * Get the crop rotation of the given design block.
901
- * @param id - The block whose crop rotation should be queried.
902
- * @returns The crop rotation.
903
- */
904
- getCropRotation(id: DesignBlockId): number;
905
- /**
906
- * Get the crop translation on the x axis of the given design block.
907
- * @param id - The block whose translation should be queried.
908
- * @returns The translation on the x axis.
909
- */
910
- getCropTranslationX(id: DesignBlockId): number;
911
- /**
912
- * Get the crop translation on the y axis of the given design block.
913
- * @param id - The block whose translation should be queried.
914
- * @returns The translation on the y axis.
915
- */
916
- getCropTranslationY(id: DesignBlockId): number;
917
- /**
918
- * Query if the given block has an opacity.
919
- * @param id - The block to query.
920
- * @returns true, if the block has an opacity.
921
- */
922
- hasOpacity(id: DesignBlockId): boolean;
923
- /**
924
- * Set the opacity of the given design block.
925
- * @param id - The block whose opacity should be set.
926
- * @param opacity - The opacity to be set. The valid range is 0 to 1.
927
- */
928
- setOpacity(id: DesignBlockId, opacity: number): void;
929
- /**
930
- * Get the opacity of the given design block.
931
- * @param id - The block whose opacity should be queried.
932
- * @returns The opacity.
933
- */
934
- getOpacity(id: DesignBlockId): number;
935
- /**
936
- * Set the blend mode of the given design block.
937
- * @param id - The block whose blend mode should be set.
938
- * @param blendMode - The blend mode to be set.
939
- * @returns
940
- */
941
- setBlendMode(id: DesignBlockId, blendMode: BlendMode): void;
942
- /**
943
- * Get the blend mode of the given design block.
944
- * @param id - The block whose blend mode should be queried.
945
- * @returns The blend mode.
946
- */
947
- getBlendMode(id: DesignBlockId): BlendMode;
948
- /**
949
- * Query if the given block has fill color properties.
950
- * @param id - The block to query.
951
- * @returns true, if the block has fill color properties.
952
- */
953
- hasFillColor(id: DesignBlockId): boolean;
954
- /**
955
- * Set the fill color of the given design block.
956
- * @param id - The block whose fill color should be set.
957
- * @param color - The fill color to be set, a tuple of
958
- * @param r - The red color component in the range of 0 to 1.
959
- * @param g - The green color component in the range of 0 to 1.
960
- * @param b - The blue color component in the range of 0 to 1.
961
- * @param a - The alpha color component in the range of 0 to 1.
962
- */
963
- setFillColorRGBA(
964
- id: DesignBlockId,
965
- r: number,
966
- g: number,
967
- b: number,
968
- a: number
969
- ): void;
970
- /**
971
- * Get the fill color of the given design block.
972
- * @param id - The block whose fill color should be queried.
973
- * @returns The fill color.
974
- */
975
- getFillColorRGBA(id: DesignBlockId): RGBA;
976
- /**
977
- * Enable or disable the fill of the given design block.
978
- * @param id - The block whose fill should be enabled or disabled.
979
- * @param enabled - If true, the fill will be enabled.
980
- */
981
- setFillColorEnabled(id: DesignBlockId, enabled: boolean): void;
982
- /**
983
- * Query if the fill of the given design block is enabled.
984
- * @param id - The block whose fill state should be queried.
985
- * @returns True, if fill is enabled.
986
- */
987
- isFillColorEnabled(id: DesignBlockId): boolean;
988
- /**
989
- * Query if the given block has background color properties.
990
- * @param id - The block to query.
991
- * @returns true, if the block has background color properties.
992
- */
993
- hasBackgroundColor(id: DesignBlockId): boolean;
994
- /**
995
- * Set the background color of the given design block.
996
- * @param id - The block whose background color should be set.
997
- * @param color - The background color to be set, a tuple of
998
- * @param r - The red color component in the range of 0 to 1.
999
- * @param g - The green color component in the range of 0 to 1.
1000
- * @param b - The blue color component in the range of 0 to 1.
1001
- * @param a - The alpha color component in the range of 0 to 1.
1002
- */
1003
- setBackgroundColorRGBA(
1004
- id: DesignBlockId,
1005
- r: number,
1006
- g: number,
1007
- b: number,
1008
- a: number
1009
- ): void;
1010
- /**
1011
- * Get the background color of the given design block.
1012
- * @param id - The block whose background color should be queried.
1013
- * @returns The background color.
1014
- */
1015
- getBackgroundColorRGBA(id: DesignBlockId): RGBA;
1016
- /**
1017
- * Enable or disable the background of the given design block.
1018
- * @param id - The block whose background should be enabled or disabled.
1019
- * @param enabled - If true, the background will be enabled.
1020
- */
1021
- setBackgroundColorEnabled(id: DesignBlockId, enabled: boolean): void;
1022
- /**
1023
- * Query if the background of the given design block is enabled.
1024
- * @param id - The block whose background state should be queried.
1025
- * @returns True, if background is enabled.
1026
- */
1027
- isBackgroundColorEnabled(id: DesignBlockId): boolean;
1028
- /**
1029
- * Query if the given block has a stroke property.
1030
- * @param id - The block to query.
1031
- * @returns True if the block has a stroke property.
1032
- */
1033
- hasStroke(id: DesignBlockId): boolean;
1034
- /**
1035
- * Enable or disable the stroke of the given design block.
1036
- * @param id - The block whose stroke should be enabled or disabled.
1037
- * @param enabled - If true, the stroke will be enabled.
1038
- */
1039
- setStrokeEnabled(id: DesignBlockId, enabled: boolean): void;
1040
- /**
1041
- * Query if the stroke of the given design block is enabled.
1042
- * @param id - The block whose stroke state should be queried.
1043
- * @returns True if the block's stroke is enabled.
1044
- */
1045
- isStrokeEnabled(id: DesignBlockId): boolean;
1046
- /**
1047
- * Set the stroke color of the given design block.
1048
- * @param id - The block whose stroke color should be set.
1049
- * @param r - The red color component in the range of 0 to 1.
1050
- * @param g - The green color component in the range of 0 to 1.
1051
- * @param b - The blue color component in the range of 0 to 1.
1052
- * @param a - The alpha color component in the range of 0 to 1.
1053
- */
1054
- setStrokeColorRGBA(
1055
- id: DesignBlockId,
1056
- r: number,
1057
- g: number,
1058
- b: number,
1059
- a: number
1060
- ): void;
1061
- /**
1062
- * Get the stroke color of the given design block.
1063
- * @param id - The block whose background color should be queried.
1064
- * @returns The background color.
1065
- */
1066
- getStrokeColorRGBA(id: DesignBlockId): RGBA;
1067
- /**
1068
- * Set the stroke width of the given design block.
1069
- * @param id - The block whose stroke width should be set.
1070
- * @param width - The stroke width to be set.
1071
- */
1072
- setStrokeWidth(id: DesignBlockId, width: number): void;
1073
- /**
1074
- * Get the stroke width of the given design block.
1075
- * @param id - The block whose stroke width should be queried.
1076
- * @returns The stroke's width.
1077
- */
1078
- getStrokeWidth(id: DesignBlockId): number;
1079
- /**
1080
- * Set the stroke style of the given design block.
1081
- * @param id - The block whose stroke style should be set.
1082
- * @param style - The stroke style to be set.
1083
- */
1084
- setStrokeStyle(id: DesignBlockId, style: StrokeStyle): void;
1085
- /**
1086
- * Get the stroke style of the given design block.
1087
- * @param id - The block whose stroke style should be queried.
1088
- * @returns The stroke's style.
1089
- */
1090
- getStrokeStyle(id: DesignBlockId): StrokeStyle;
1091
- /**
1092
- * Set the stroke position of the given design block.
1093
- * @param id - The block whose stroke position should be set.
1094
- * @param position - The stroke position to be set.
1095
- */
1096
- setStrokePosition(id: DesignBlockId, position: StrokePosition): void;
1097
- /**
1098
- * Get the stroke position of the given design block.
1099
- * @param id - The block whose stroke position should be queried.
1100
- * @returns The stroke position.
1101
- */
1102
- getStrokePosition(id: DesignBlockId): StrokePosition;
1103
- /**
1104
- * Set the stroke corner geometry of the given design block.
1105
- * @param id - The block whose stroke join geometry should be set.
1106
- * @param cornerGeometry - The stroke join geometry to be set.
1107
- */
1108
- setStrokeCornerGeometry(
1109
- id: DesignBlockId,
1110
- cornerGeometry: StrokeCornerGeometry
1111
- ): void;
1112
- /**
1113
- * Get the stroke corner geometry of the given design block.
1114
- * @param id - The block whose stroke join geometry should be queried.
1115
- * @returns The stroke join geometry.
1116
- */
1117
- getStrokeCornerGeometry(id: DesignBlockId): StrokeCornerGeometry;
1118
- /**
1119
- * Query if the given block has outline properties.
1120
- * @param id - The block to query.
1121
- * @returns true, if the block has outline properties.
1122
- * @deprecated Use `hasStroke`.
1123
- */
1124
- hasOutline(id: DesignBlockId): boolean;
1125
- /**
1126
- * Set the outline color of the given design block.
1127
- * @param id - The block whose outline color should be set.
1128
- * @param color - The outline color to be set, a tuple of
1129
- * @param r - The red color component in the range of 0 to 1.
1130
- * @param g - The green color component in the range of 0 to 1.
1131
- * @param b - The blue color component in the range of 0 to 1.
1132
- * @param a - The alpha color component in the range of 0 to 1.
1133
- * @deprecated Use `setStrokeColorRGBA`.
1134
- */
1135
- setOutlineColorRGBA(
1136
- id: DesignBlockId,
1137
- r: number,
1138
- g: number,
1139
- b: number,
1140
- a: number
1141
- ): void;
1142
- /**
1143
- * Get the outline color of the given design block.
1144
- * @param id - The block whose outline color should be queried.
1145
- * @returns The outline color.
1146
- * @deprecated Use `getStrokeColorRGBA`.
1147
- */
1148
- getOutlineColorRGBA(id: DesignBlockId): RGBA;
1149
- /**
1150
- * Enable or disable the outline of the given design block.
1151
- * @param id - The block whose outline should be enabled or disabled.
1152
- * @param enabled - If true, the outline will be enabled.
1153
- * @deprecated Use `setStrokeEnabled`.
1154
- */
1155
- setOutlineEnabled(id: DesignBlockId, enabled: boolean): void;
1156
- /**
1157
- * Query if the outline of the given design block is enabled.
1158
- * @param id - The block whose outline state should be queried.
1159
- * @returns True, if outline is enabled.
1160
- * @deprecated Use `isStrokeEnabled`.
1161
- */
1162
- isOutlineEnabled(id: DesignBlockId): boolean;
1163
- /**
1164
- * Set the outline width of the given design block.
1165
- * @param id - The block whose outline width should be set.
1166
- * @param width - The outline width to be set.
1167
- * @deprecated Use `setStrokeWidth`.
1168
- */
1169
- setOutlineWidth(id: DesignBlockId, width: number): void;
1170
- /**
1171
- * Get the outline width of the given design block.
1172
- * @param id - The block whose outline width should be queried.
1173
- * @returns The outline width.
1174
- * @deprecated Use the Stroke function
1175
- * @deprecated Use `getStrokeWidth`.
1176
- */
1177
- getOutlineWidth(id: DesignBlockId): number;
1178
- /**
1179
- * Query if the given block has fill color properties.
1180
- * @param id - The block to query.
1181
- * @returns true, if the block has fill color properties, an error otherwise.
1182
- */
1183
- hasFill(id: DesignBlockId): boolean;
1184
- /**
1185
- * Query if the fill of the given design block is enabled.
1186
- * @param id - The block whose fill state should be queried.
1187
- * @returns A result holding the fill state or an error.
1188
- */
1189
- isFillEnabled(id: DesignBlockId): boolean;
1190
- /**
1191
- * Enable or disable the fill of the given design block.
1192
- * @param id - The block whose fill should be enabled or disabled.
1193
- * @param enabled - If true, the fill will be enabled.
1194
- * @returns An empty result on success, an error otherwise.
1195
- */
1196
- setFillEnabled(id: DesignBlockId, enabled: boolean): void;
1197
- /**
1198
- * Set the fill type of the given design block.
1199
- * @param id - The block whose fill type should be set.
1200
- * @param type - The fill type to set.
1201
- * @returns An empty result on success, an error otherwise.
1202
- */
1203
- setFillType(id: DesignBlockId, fillType: FillType): void;
1204
- /**
1205
- * Get the fill type of the given design block.
1206
- * @param id - The block whose fill type should be queried.
1207
- * @returns The block's fill type or an error.
1208
- */
1209
- getFillType(id: DesignBlockId): FillType;
1210
- /**
1211
- * Set the fill color of the given design block.
1212
- * @param id - The block whose fill color should be set.
1213
- * @param r - The red color component in the range of 0 to 1.
1214
- * @param g - The green color component in the range of 0 to 1.
1215
- * @param b - The blue color component in the range of 0 to 1.
1216
- * @param a - The alpha color component in the range of 0 to 1.
1217
- * @returns An empty result on success, an error otherwise.
1218
- */
1219
- setFillSolidColor(
1220
- id: DesignBlockId,
1221
- r: number,
1222
- b: number,
1223
- g: number,
1224
- a: number
1225
- ): void;
1226
- /**
1227
- * Get the fill color of the given design block.
1228
- * @param id - The block whose fill color should be queried.
1229
- * @returns A result holding the fill color or an error.
1230
- */
1231
- getFillSolidColor(id: DesignBlockId): RGBA;
1232
- /**
1233
- * Set the gradient type of the given design block.
1234
- * @param id - The block whose gradient type should be set.
1235
- * @param type - The gradient type.
1236
- * @returns An empty result on success, an error otherwise.
1237
- */
1238
- setFillGradientType(id: DesignBlockId, gradientType: GradientType): void;
1239
- /**
1240
- * Get the gradient type of the given design block.
1241
- * @param id - The block whose gradient type should be queried.
1242
- * @returns The gradient type.
1243
- */
1244
- getFillGradientType(id: DesignBlockId): GradientType;
1245
- /**
1246
- * Add a gradient color stop on a design block.
1247
- * @param id - The block on which a gradient color stop should be added.
1248
- * @param stop - Where to add a color stop in the range 0 to 1.
1249
- * @param r - The red color component in the range of 0 to 1.
1250
- * @param g - The green color component in the range of 0 to 1.
1251
- * @param b - The blue color component in the range of 0 to 1.
1252
- * @param a - The alpha color component in the range of 0 to 1.
1253
- * @returns An empty result on success, an error otherwise.
1254
- */
1255
- addFillGradientColorStop(
1256
- id: DesignBlockId,
1257
- stop: number,
1258
- r: number,
1259
- g: number,
1260
- b: number,
1261
- a: number
1262
- ): void;
1263
- /**
1264
- * Remove a previously gradient color stop on a design block.
1265
- * @param id - The block from which to remvove the gradient color stop.
1266
- * @param stop - The stop's position.
1267
- * @returns An empty result on success, an error otherwise.
1268
- */
1269
- removeFillGradientColorStop(id: DesignBlockId, stop: number): void;
1270
- /**
1271
- * Get the gradient fill color stops of the given design block.
1272
- * @param id - The block whose gradient color stop should be queried.
1273
- * @returns All of the design block's gradient color stops.
1274
- */
1275
- getFillGradientColorStops(id: DesignBlockId): GradientstopRGBA[];
1276
- /**
1277
- * Set the gradient fill color stops of the given design block, overwriting previously set color stops.
1278
- * @param id - The block whose gradient color stop should be set.
1279
- * @param stops - The gradient color stops to set.
1280
- * @returns An empty result on success, an error otherwise.
1281
- */
1282
- setFillGradientColorStops(id: DesignBlockId, stops: GradientstopRGBA[]): void;
1283
- /**
1284
- * Set the position of a gradient's control point.
1285
- * Note that Different gradient types of different control points.
1286
- * @param id - The block whose gradient control point should be set.
1287
- * @param gradientControlPointType - The type of control point.
1288
- * @param x - The horizontal component of the control point.
1289
- * @param y - The vertical component of the control point.
1290
- * @returns true if the control point was set, an error otherwise.
1291
- */
1292
- setFillGradientControlPoint(
1293
- id: DesignBlockId,
1294
- gradientControlPointType: GradientControlPointType,
1295
- x: number,
1296
- y: number
1297
- ): boolean;
1298
- /**
1299
- * Get the horizontal component of a gradient's control point.
1300
- * @param id - The block whose gradient control point should be queried.
1301
- * @param gradientControlPointType - The type of control point.
1302
- * @returns The horizontal component of the control point, an error otherwise.
1303
- */
1304
- getFillGradientControlPointX(
1305
- id: DesignBlockId,
1306
- gradientControlPointType: GradientControlPointType
1307
- ): number;
1308
- /**
1309
- * Get the vertical component of a gradient's control point.
1310
- * @param id - The block whose gradient control point should be queried.
1311
- * @param gradientControlPointType - The type of control point.
1312
- * @returns The vertical component of the control point, an error otherwise.
1313
- */
1314
- getFillGradientControlPointY(
1315
- id: DesignBlockId,
1316
- gradientControlPointType: GradientControlPointType
1317
- ): number;
1318
- /**
1319
- * Set a gradient's radius.
1320
- * Note that Not all gradients have a radius.
1321
- * @param id - The block whose gradient radius should be set.
1322
- * @param radius - The gradient's radius.
1323
- * @returns true if the control point was set, an error otherwise.
1324
- */
1325
- setFillGradientRadius(id: DesignBlockId, radius: number): boolean;
1326
- /**
1327
- * Get a gradient's radius.
1328
- * Note that Not all gradients have a radius.
1329
- * @param id - The block whose gradient radius should be queried.
1330
- * @returns the gradient's radius, an error otherwise.
1331
- */
1332
- getFillGradientRadius(id: DesignBlockId): number;
312
+ #private;
313
+
314
+ /**
315
+ * Exports a design block element as a file of the given mime type.
316
+ * Performs an internal update to resolve the final layout for the blocks.
317
+ * @param handle - The design block element to export.
318
+ * @param mimeType - The mime type of the output file.
319
+ * @returns A promise that resolves with the exported image or is rejected with an error.
320
+ */
321
+ export(handle: DesignBlockId, mimeType?: MimeType_2): Promise<Blob>;
322
+
323
+ /**
324
+ * Loads existing blocks from the given string.
325
+ * The blocks are not attached by default and won't be visible until attached to a page or the scene.
326
+ * @param content - A string representing the given blocks.
327
+ * @returns A promise that resolves with a list of handles representing the found blocks or an error.
328
+ */
329
+ loadFromString(content: string): Promise<DesignBlockId[]>;
330
+ /**
331
+ * Saves the given blocks into a string. If given the root of a block hierarchy, e.g. a
332
+ * page with multiple children, the entire hierarchy is saved.
333
+ * @param blocks - The blocks to save
334
+ * @returns A promise that resolves to a string representing the blocks or an error.
335
+ */
336
+ saveToString(blocks: DesignBlockId[]): Promise<string>;
337
+ /**
338
+ * Create a new block, fails if type is unknown.
339
+ * @param type - The type of the block that shall be created.
340
+ * @returns The created blocks handle.
341
+ */
342
+ create(type: DesignBlockType): DesignBlockId;
343
+
344
+ /**
345
+ * Get the type of the given block, fails if the block is invalid.
346
+ * @param id - The block to query.
347
+ * @returns The blocks type.
348
+ */
349
+ getType(id: DesignBlockId): DesignBlockType;
350
+ /**
351
+ * Update the selection state of a block.
352
+ * Fails for invalid blocks.
353
+ * @param id - The block to query.
354
+ * @param selected - Whether or not the block should be selected.
355
+ */
356
+ setSelected(id: DesignBlockId, selected: boolean): void;
357
+ /**
358
+ * Get the selected state of a block.
359
+ * @param id - The block to query.
360
+ * @returns True if the block is selected, false otherwise.
361
+ */
362
+ isSelected(id: DesignBlockId): boolean;
363
+ /**
364
+ * Get all currently selected blocks.
365
+ * @returns An array of block ids.
366
+ */
367
+ findAllSelected(): DesignBlockId[];
368
+ /**
369
+ * Confirms that a given set of blocks can be grouped together.
370
+ * @param ids - A non-empty array of block ids.
371
+ * @returns Whether the blocks can be grouped together.
372
+ */
373
+ isGroupable(ids: DesignBlockId[]): boolean;
374
+ /**
375
+ * Group blocks together.
376
+ * @param ids - A non-empty array of block ids.
377
+ * @returns The block id of the created group.
378
+ */
379
+ group(ids: DesignBlockId[]): DesignBlockId;
380
+ /**
381
+ * Ungroups a group.
382
+ * @param id - The group id from a previous call to `group`.
383
+ */
384
+ ungroup(id: DesignBlockId): void;
385
+ /**
386
+ * Changes selection from selected group to a block within that group.
387
+ * Nothing happens if `group` is not a group.
388
+ * @param id - The group id from a previous call to `group`.
389
+ */
390
+ enterGroup(id: DesignBlockId): void;
391
+ /**
392
+ * Changes selection from a group's selected block to that group.
393
+ * Nothing happens if the `id` is not part of a group.
394
+ * @param id - A block id.
395
+ */
396
+ exitGroup(id: DesignBlockId): void;
397
+ /**
398
+ * Update a block's name.
399
+ * @param id - The block to update.
400
+ * @param name - The name to set.
401
+ */
402
+ setName(id: DesignBlockId, name: string): void;
403
+ /**
404
+ * Get a block's name.
405
+ * @param id - The block to update.
406
+ */
407
+ getName(id: DesignBlockId): string;
408
+ /**
409
+ * Finds all blocks with the given name.
410
+ * @param name - The name to search for.
411
+ * @returns A list of block ids.
412
+ */
413
+ findByName(name: string): DesignBlockId[];
414
+ /**
415
+ * Finds all blocks with the given type.
416
+ * @param type - The type to search for.
417
+ * @returns A list of block ids.
418
+ */
419
+ findByType(type: DesignBlockType): DesignBlockId[];
420
+ /**
421
+ * Return all blocks currently known to the engine.
422
+ * @returns A list of block ids.
423
+ */
424
+ findAll(): DesignBlockId[];
425
+ /**
426
+ * Return all placeholder blocks in the current scene.
427
+ * @returns A list of block ids.
428
+ */
429
+ findAllPlaceholders(): DesignBlockId[];
430
+ /**
431
+ * Query a block's visibility.
432
+ * @param id - The block to query.
433
+ * @returns True if visible, false otherwise.
434
+ */
435
+ isVisible(id: DesignBlockId): boolean;
436
+ /**
437
+ * Update a block's visibility.
438
+ * @param id - The block to update.
439
+ * @param visible - Whether the block shall be visible.
440
+ */
441
+ setVisible(id: DesignBlockId, visible: boolean): void;
442
+ /**
443
+ * Query a block's clipped state. If true, the block should clip
444
+ * its contents to its frame.
445
+ * @param id - The block to query.
446
+ * @returns True if clipped, false otherwise.
447
+ */
448
+ isClipped(id: DesignBlockId): boolean;
449
+ /**
450
+ * Update a block's clipped state.
451
+ * @param id - The block to update.
452
+ * @param clipped - Whether the block should clips its contents to its frame.
453
+ */
454
+ setClipped(id: DesignBlockId, clipped: boolean): void;
455
+ /**
456
+ * Query a block's x position.
457
+ * @param id - The block to query.
458
+ * @returns The value of the x position.
459
+ */
460
+ getPositionX(id: DesignBlockId): number;
461
+ /**
462
+ * Query a block's mode for its x position.
463
+ * @param id - The block to query.
464
+ * @returns The current mode for the x position: absolute, percent or undefined.
465
+ */
466
+ getPositionXMode(id: DesignBlockId): PositionMode;
467
+ /**
468
+ * Query a block's y position.
469
+ * @param id - The block to query.
470
+ * @returns The value of the y position.
471
+ */
472
+ getPositionY(id: DesignBlockId): number;
473
+ /**
474
+ * Query a block's mode for its y position.
475
+ * @param id - The block to query.
476
+ * @returns The current mode for the y position: absolute, percent or undefined.
477
+ */
478
+ getPositionYMode(id: DesignBlockId): PositionMode;
479
+ /**
480
+ * Update a block's x position.
481
+ * The position refers to the block's local space, relative to its parent with the origin at the top left.
482
+ * @param id - The block to update.
483
+ * @param value - The value of the x position.
484
+ */
485
+ setPositionX(id: DesignBlockId, value: number): void;
486
+ /**
487
+ * Set a block's mode for its x position.
488
+ * @param id - The block to update.
489
+ * @param mode - The x position mode: absolute, percent or undefined.
490
+ */
491
+ setPositionXMode(id: DesignBlockId, mode: PositionMode): void;
492
+ /**
493
+ * Update a block's y position.
494
+ * The position refers to the block's local space, relative to its parent with the origin at the top left.
495
+ * @param id - The block to update.
496
+ * @param value - The value of the y position.
497
+ */
498
+ setPositionY(id: DesignBlockId, value: number): void;
499
+ /**
500
+ * Set a block's mode for its y position.
501
+ * @param id - The block to update.
502
+ * @param mode - The y position mode: absolute, percent or undefined.
503
+ */
504
+ setPositionYMode(id: DesignBlockId, mode: PositionMode): void;
505
+ /**
506
+ * Query a block's rotation in radians.
507
+ * @param id - The block to query.
508
+ * @returns The block's rotation around its center in radians.
509
+ */
510
+ getRotation(id: DesignBlockId): number;
511
+ /**
512
+ * Update a block's rotation.
513
+ * @param id - The block to update.
514
+ * @param radians - The new rotation in radians. Rotation is applied around the block's center.
515
+ */
516
+ setRotation(id: DesignBlockId, radians: number): void;
517
+ /**
518
+ * Query a block's horizontal flip state.
519
+ * @param id - The block to query.
520
+ * @returns A boolean indicating for whether the block is flipped in the queried direction
521
+ */
522
+ getFlipHorizontal(id: DesignBlockId): boolean;
523
+ /**
524
+ * Query a block's vertical flip state.
525
+ * @param id - The block to query.
526
+ * @returns A boolean indicating for whether the block is flipped in the queried direction
527
+ */
528
+ getFlipVertical(id: DesignBlockId): boolean;
529
+ /**
530
+ * Update a block's horizontal flip.
531
+ * @param id - The block to update.
532
+ * @param flip - If the flip should be enabled.
533
+ */
534
+ setFlipHorizontal(id: DesignBlockId, flip: boolean): void;
535
+ /**
536
+ * Update a block's vertical flip.
537
+ * @param id - The block to update.
538
+ * @param flip - If the flip should be enabled.
539
+ */
540
+ setFlipVertical(id: DesignBlockId, flip: boolean): void;
541
+ /**
542
+ * Query if the given block has a content fill mode.
543
+ * @param id - The block to query.
544
+ * @returns true, if the block has a content fill mode.
545
+ */
546
+ hasContentFillMode(id: DesignBlockId): boolean;
547
+ /**
548
+ * Query if the given block shows placeholder content.
549
+ * @param id - The block to query.
550
+ * @returns true, if the block shows placeholder content.
551
+ */
552
+ hasPlaceholderContent(id: DesignBlockId): boolean;
553
+ /**
554
+ * Query a block's width.
555
+ * @param id - The block to query.
556
+ * @returns The value of the block's width.
557
+ */
558
+ getWidth(id: DesignBlockId): number;
559
+ /**
560
+ * Query a block's mode for its width.
561
+ * @param id - The block to query.
562
+ * @returns The current mode for the width: absolute, percent or auto.
563
+ */
564
+ getWidthMode(id: DesignBlockId): SizeMode;
565
+ /**
566
+ * Query a block's height.
567
+ * @param id - The block to query.
568
+ * @returns The value of the block's height.
569
+ */
570
+ getHeight(id: DesignBlockId): number;
571
+ /**
572
+ * Query a block's mode for its height.
573
+ * @param id - The block to query.
574
+ * @returns The current mode for the height: absolute, percent or auto.
575
+ */
576
+ getHeightMode(id: DesignBlockId): SizeMode;
577
+ /**
578
+ * Query a block's content fill mode.
579
+ * @param id - The block to query.
580
+ * @returns The current mode: crop, cover or contain.
581
+ */
582
+ getContentFillMode(id: DesignBlockId): ContentFillMode;
583
+ /**
584
+ * Update a block's width.
585
+ * @param id - The block to update.
586
+ * @param value - The new width of the block.
587
+ */
588
+ setWidth(id: DesignBlockId, value: number): void;
589
+ /**
590
+ * Set a block's mode for its width.
591
+ * @param id - The block to update.
592
+ * @param mode - The width mode: absolute, percent or auto.
593
+ */
594
+ setWidthMode(id: DesignBlockId, mode: SizeMode): void;
595
+ /**
596
+ * Update a block's height.
597
+ * @param id - The block to update.
598
+ * @param value - The new height of the block.
599
+ */
600
+ setHeight(id: DesignBlockId, value: number): void;
601
+ /**
602
+ * Set a block's mode for its height.
603
+ * @param id - The block to update.
604
+ * @param mode - The height mode: absolute, percent or auto.
605
+ */
606
+ setHeightMode(id: DesignBlockId, mode: SizeMode): void;
607
+ /**
608
+ * Set a block's content fill mode.
609
+ * @param id - The block to update.
610
+ * @param mode - The content fill mode mode: crop, cover or contain.
611
+ */
612
+ setContentFillMode(id: DesignBlockId, mode: ContentFillMode): void;
613
+ /**
614
+ * Get a block's layout width. The layout width is only available after an
615
+ * internal update loop, which may not happen immediately.
616
+ * @param id - The block to query.
617
+ * @returns The layout width.
618
+ */
619
+ getFrameWidth(id: DesignBlockId): number;
620
+ /**
621
+ * Get a block's layout height. The layout height is only available after an
622
+ * internal update loop, which may not happen immediately.
623
+ * @param id - The block to query.
624
+ * @returns The layout height.
625
+ */
626
+ getFrameHeight(id: DesignBlockId): number;
627
+ /**
628
+ * Duplicates a block including its children.
629
+ * @param id - The block to duplicate.
630
+ * @returns The handle of the duplicate.
631
+ */
632
+ duplicate(id: DesignBlockId): DesignBlockId;
633
+ /**
634
+ * Destroys a block.
635
+ * @param id - The block to destroy.
636
+ */
637
+ destroy(id: DesignBlockId): void;
638
+ /**
639
+ * Check if a block is valid. A block becomes invalid once it has been destroyed.
640
+ * @param id - The block to query.
641
+ * @returns True, if the block is valid.
642
+ */
643
+ isValid(id: DesignBlockId): boolean;
644
+ /**
645
+ * Query a block's parent.
646
+ * @param id - The block to query.
647
+ * @returns The parent's handle or null if the block has no parent.
648
+ */
649
+ getParent(id: DesignBlockId): DesignBlockId | null;
650
+ /**
651
+ * Get all children of the given block. Children
652
+ * are sorted in their rendering order: Last child is rendered
653
+ * in front of other children.
654
+ * @param id - The block to query.
655
+ * @returns A list of block ids.
656
+ */
657
+ getChildren(id: DesignBlockId): DesignBlockId[];
658
+ /**
659
+ * Insert a new or existing child at a certain position in the parent's children.
660
+ * @param parent - The block whose children should be updated.
661
+ * @param child - The child to insert. Can be an existing child of `parent`.
662
+ * @param index - The index to insert or move to.
663
+ */
664
+ insertChild(parent: DesignBlockId, child: DesignBlockId, index: number): void;
665
+ /**
666
+ * Appends a new or existing child to a block's children.
667
+ * @param parent - The block whose children should be updated.
668
+ * @param child - The child to insert. Can be an existing child of `parent`.
669
+ */
670
+ appendChild(parent: DesignBlockId, child: DesignBlockId): void;
671
+ /** Checks whether the given block references any variables. Doesn't check the block's children.
672
+ *
673
+ * @param id - The block to inspect.
674
+ * @returns true if the block references variables and false otherwise.
675
+ */
676
+ referencesAnyVariables(id: DesignBlockId): boolean;
677
+ /**
678
+ * Get the x position of the block's axis-aligned bounding box in the scene's global coordinate space.
679
+ * The scene's global coordinate space has its origin at the top left.
680
+ * @param id - The block whose bounding box should be calculated.
681
+ * @returns float The x coordinate of the position of the axis-aligned bounding box.
682
+ */
683
+ getGlobalBoundingBoxX(id: DesignBlockId): number;
684
+ /**
685
+ * Get the y position of the block's axis-aligned bounding box in the scene's global coordinate space.
686
+ * The scene's global coordinate space has its origin at the top left.
687
+ * @param id - The block whose bounding box should be calculated.
688
+ * @returns float The y coordinate of the position of the axis-aligned bounding box.
689
+ */
690
+ getGlobalBoundingBoxY(id: DesignBlockId): number;
691
+ /**
692
+ * Get the width of the block's axis-aligned bounding box in the scene's global coordinate space.
693
+ * The scene's global coordinate space has its origin at the top left.
694
+ * @param id - The block whose bounding box should be calculated.
695
+ * @returns float The width of the axis-aligned bounding box.
696
+ */
697
+ getGlobalBoundingBoxWidth(id: DesignBlockId): number;
698
+ /**
699
+ * Get the height of the block's axis-aligned bounding box in the scene's global coordinate space.
700
+ * The scene's global coordinate space has its origin at the top left.
701
+ * @param id - The block whose bounding box should be calculated.
702
+ * @returns float The height of the axis-aligned bounding box.
703
+ */
704
+ getGlobalBoundingBoxHeight(id: DesignBlockId): number;
705
+ /**
706
+ * Scales the block and all of its children proportionally around the specified
707
+ * relative anchor point.
708
+ *
709
+ * This updates the position, size and style properties (e.g. stroke width) of
710
+ * the block and its children.
711
+ *
712
+ * @param id - The block that should be scaled.
713
+ * @param scale - The scale factor to be applied to the current properties of the block.
714
+ * @param anchorX - The relative position along the width of the block around which the
715
+ * scaling should occur. (0 = left edge, 0.5 = center, 1 = right edge)
716
+ * @param anchorY - The relative position along the height of the block around which the
717
+ * scaling should occur. (0 = top edge, 0.5 = center, 1 = bottom edge)
718
+ */
719
+ scale(id: DesignBlockId, scale: number, anchorX?: number, anchorY?: number): void;
720
+ /**
721
+ * Get all available properties of a block.
722
+ * @param id - The block whose properties should be queried.
723
+ * @returns A list of the property names.
724
+ */
725
+ findAllProperties(id: DesignBlockId): string[];
726
+ /**
727
+ * Get the type of a property given its name.
728
+ * @param property - The name of the property whose type should be queried.
729
+ * @returns The property type.
730
+ */
731
+ getPropertyType(property: string): PropertyType;
732
+ /**
733
+ * Get all the possible values of an enum given an enum property.
734
+ * @param enumProperty - The name of the property whose enum values should be queried.
735
+ * @returns A list of the enum value names as string.
736
+ */
737
+ getEnumValues<T = string>(enumProperty: string): T[];
738
+ /**
739
+ * Set a bool property of the given design block to the given value.
740
+ * @param id - The block whose property should be set.
741
+ * @param property - The name of the property to set.
742
+ * @param value - The value to set.
743
+ */
744
+ setBool(id: DesignBlockId, property: string, value: boolean): void;
745
+ /**
746
+ * Get the value of a bool property of the given design block.
747
+ * @param id - The block whose property should be queried.
748
+ * @param property - The name of the property to query.
749
+ * @returns The value of the property.
750
+ */
751
+ getBool(id: DesignBlockId, property: string): boolean;
752
+ /**
753
+ * Set an int property of the given design block to the given value.
754
+ * @param id - The block whose property should be set.
755
+ * @param property - The name of the property to set.
756
+ * @param value - The value to set.
757
+ */
758
+ setInt(id: DesignBlockId, property: string, value: number): void;
759
+ /**
760
+ * Get the value of an int property of the given design block.
761
+ * @param id - The block whose property should be queried.
762
+ * @param property - The name of the property to query.
763
+ * @returns The value of the property.
764
+ */
765
+ getInt(id: DesignBlockId, property: string): number;
766
+ /**
767
+ * Set a float property of the given design block to the given value.
768
+ * @param id - The block whose property should be set.
769
+ * @param property - The name of the property to set.
770
+ * @param value - The value to set.
771
+ */
772
+ setFloat(id: DesignBlockId, property: string, value: number): void;
773
+ /**
774
+ * Get the value of a float property of the given design block.
775
+ * @param id - The block whose property should be queried.
776
+ * @param property - The name of the property to query.
777
+ * @returns The value of the property.
778
+ */
779
+ getFloat(id: DesignBlockId, property: string): number;
780
+ /**
781
+ * Set a string property of the given design block to the given value.
782
+ * @param id - The block whose property should be set.
783
+ * @param property - The name of the property to set.
784
+ * @param value - The value to set.
785
+ */
786
+ setString(id: DesignBlockId, property: string, value: string): void;
787
+ /**
788
+ * Get the value of a string property of the given design block.
789
+ * @param id - The block whose property should be queried.
790
+ * @param property - The name of the property to query.
791
+ * @returns The value of the property.
792
+ */
793
+ getString(id: DesignBlockId, property: string): string;
794
+ /**
795
+ * Set a color property of the given design block to the given value.
796
+ * @param id - The block whose property should be set.
797
+ * @param property - The name of the property to set.
798
+ * @param r - The red color component in the range of 0 to 1.
799
+ * @param g - The green color component in the range of 0 to 1.
800
+ * @param b - The blue color component in the range of 0 to 1.
801
+ * @param a - The alpha color component in the range of 0 to 1.
802
+ */
803
+ setColorRGBA(id: DesignBlockId, property: string, r: number, g: number, b: number, a?: number): void;
804
+ /**
805
+ * Get the value of a string property of the given design block.
806
+ * @param id - The block whose property should be queried.
807
+ * @param property - The name of the property to query.
808
+ * @returns A tuple of channels red, green, blue and alpha in the range of 0 to 1.
809
+ */
810
+ getColorRGBA(id: DesignBlockId, property: string): RGBA;
811
+ /**
812
+ * Set an enum property of the given design block to the given value.
813
+ * @param id - The block whose property should be set.
814
+ * @param property - The name of the property to set.
815
+ * @param value - The enum value as string.
816
+ */
817
+ setEnum(id: DesignBlockId, property: string, value: string): void;
818
+ /**
819
+ * Get the value of an enum property of the given design block.
820
+ * @param id - The block whose property should be queried.
821
+ * @param property - The name of the property to query.
822
+ * @returns The value as string.
823
+ */
824
+ getEnum(id: DesignBlockId, property: string): string;
825
+ /**
826
+ * Query if the given block has crop properties.
827
+ * @param id - The block to query.
828
+ * @returns true, if the block has crop properties.
829
+ */
830
+ hasCrop(id: DesignBlockId): boolean;
831
+ /**
832
+ * Set the crop scale in x direction of the given design block.
833
+ * @param id - The block whose crop should be set.
834
+ * @param scaleX - The scale in x direction.
835
+ */
836
+ setCropScaleX(id: DesignBlockId, scaleX: number): void;
837
+ /**
838
+ * Set the crop scale in y direction of the given design block.
839
+ * @param id - The block whose crop should be set.
840
+ * @param scaleY - The scale in y direction.
841
+ */
842
+ setCropScaleY(id: DesignBlockId, scaleY: number): void;
843
+ /**
844
+ * Set the crop rotation of the given design block.
845
+ * @param id - The block whose crop should be set.
846
+ * @param rotation - The rotation in radians.
847
+ */
848
+ setCropRotation(id: DesignBlockId, rotation: number): void;
849
+ /**
850
+ * Set the crop translation in x direction of the given design block.
851
+ * @param id - The block whose crop should be set.
852
+ * @param translationY - The translation in y direction.
853
+ */
854
+ setCropTranslationX(id: DesignBlockId, translationX: number): void;
855
+ /**
856
+ * Set the crop translation in y direction of the given design block.
857
+ * @param id - The block whose crop should be set.
858
+ * @param translationY - The translation in y direction.
859
+ */
860
+ setCropTranslationY(id: DesignBlockId, translationY: number): void;
861
+ /**
862
+ * Resets the manually set crop of the given design block.
863
+ * The block's content fill mode is set to 'cover'.
864
+ * @param id - The block whose crop should be reset.
865
+ */
866
+ resetCrop(id: DesignBlockId): void;
867
+ /**
868
+ * Get the crop scale on the x axis of the given design block.
869
+ * @param id - The block whose scale should be queried.
870
+ * @returns The scale on the x axis.
871
+ */
872
+ getCropScaleX(id: DesignBlockId): number;
873
+ /**
874
+ * Get the crop scale on the y axis of the given design block.
875
+ * @param id - The block whose scale should be queried.
876
+ * @returns The scale on the y axis.
877
+ */
878
+ getCropScaleY(id: DesignBlockId): number;
879
+ /**
880
+ * Get the crop rotation of the given design block.
881
+ * @param id - The block whose crop rotation should be queried.
882
+ * @returns The crop rotation.
883
+ */
884
+ getCropRotation(id: DesignBlockId): number;
885
+ /**
886
+ * Get the crop translation on the x axis of the given design block.
887
+ * @param id - The block whose translation should be queried.
888
+ * @returns The translation on the x axis.
889
+ */
890
+ getCropTranslationX(id: DesignBlockId): number;
891
+ /**
892
+ * Get the crop translation on the y axis of the given design block.
893
+ * @param id - The block whose translation should be queried.
894
+ * @returns The translation on the y axis.
895
+ */
896
+ getCropTranslationY(id: DesignBlockId): number;
897
+ /**
898
+ * Query if the given block has an opacity.
899
+ * @param id - The block to query.
900
+ * @returns true, if the block has an opacity.
901
+ */
902
+ hasOpacity(id: DesignBlockId): boolean;
903
+ /**
904
+ * Set the opacity of the given design block.
905
+ * @param id - The block whose opacity should be set.
906
+ * @param opacity - The opacity to be set. The valid range is 0 to 1.
907
+ */
908
+ setOpacity(id: DesignBlockId, opacity: number): void;
909
+ /**
910
+ * Get the opacity of the given design block.
911
+ * @param id - The block whose opacity should be queried.
912
+ * @returns The opacity.
913
+ */
914
+ getOpacity(id: DesignBlockId): number;
915
+ /**
916
+ * Query if the given block has a blend mode.
917
+ * @param id - The block to query.
918
+ * @returns true, if the block has a blend mode.
919
+ */
920
+ hasBlendMode(id: DesignBlockId): boolean;
921
+ /**
922
+ * Set the blend mode of the given design block.
923
+ * @param id - The block whose blend mode should be set.
924
+ * @param blendMode - The blend mode to be set.
925
+ * @returns
926
+ */
927
+ setBlendMode(id: DesignBlockId, blendMode: BlendMode): void;
928
+ /**
929
+ * Get the blend mode of the given design block.
930
+ * @param id - The block whose blend mode should be queried.
931
+ * @returns The blend mode.
932
+ */
933
+ getBlendMode(id: DesignBlockId): BlendMode;
934
+ /**
935
+ * Query if the given block has fill color properties.
936
+ * @param id - The block to query.
937
+ * @returns true, if the block has fill color properties.
938
+ */
939
+ hasFillColor(id: DesignBlockId): boolean;
940
+ /**
941
+ * Set the fill color of the given design block.
942
+ * @param id - The block whose fill color should be set.
943
+ * @param color - The fill color to be set, a tuple of
944
+ * @param r - The red color component in the range of 0 to 1.
945
+ * @param g - The green color component in the range of 0 to 1.
946
+ * @param b - The blue color component in the range of 0 to 1.
947
+ * @param a - The alpha color component in the range of 0 to 1.
948
+ */
949
+ setFillColorRGBA(id: DesignBlockId, r: number, g: number, b: number, a?: number): void;
950
+ /**
951
+ * Get the fill color of the given design block.
952
+ * @param id - The block whose fill color should be queried.
953
+ * @returns The fill color.
954
+ */
955
+ getFillColorRGBA(id: DesignBlockId): RGBA;
956
+ /**
957
+ * Enable or disable the fill of the given design block.
958
+ * @param id - The block whose fill should be enabled or disabled.
959
+ * @param enabled - If true, the fill will be enabled.
960
+ */
961
+ setFillColorEnabled(id: DesignBlockId, enabled: boolean): void;
962
+ /**
963
+ * Query if the fill of the given design block is enabled.
964
+ * @param id - The block whose fill state should be queried.
965
+ * @returns True, if fill is enabled.
966
+ */
967
+ isFillColorEnabled(id: DesignBlockId): boolean;
968
+ /**
969
+ * Query if the given block has background color properties.
970
+ * @param id - The block to query.
971
+ * @returns true, if the block has background color properties.
972
+ */
973
+ hasBackgroundColor(id: DesignBlockId): boolean;
974
+ /**
975
+ * Set the background color of the given design block.
976
+ * @param id - The block whose background color should be set.
977
+ * @param color - The background color to be set, a tuple of
978
+ * @param r - The red color component in the range of 0 to 1.
979
+ * @param g - The green color component in the range of 0 to 1.
980
+ * @param b - The blue color component in the range of 0 to 1.
981
+ * @param a - The alpha color component in the range of 0 to 1.
982
+ */
983
+ setBackgroundColorRGBA(id: DesignBlockId, r: number, g: number, b: number, a?: number): void;
984
+ /**
985
+ * Get the background color of the given design block.
986
+ * @param id - The block whose background color should be queried.
987
+ * @returns The background color.
988
+ */
989
+ getBackgroundColorRGBA(id: DesignBlockId): RGBA;
990
+ /**
991
+ * Enable or disable the background of the given design block.
992
+ * @param id - The block whose background should be enabled or disabled.
993
+ * @param enabled - If true, the background will be enabled.
994
+ */
995
+ setBackgroundColorEnabled(id: DesignBlockId, enabled: boolean): void;
996
+ /**
997
+ * Query if the background of the given design block is enabled.
998
+ * @param id - The block whose background state should be queried.
999
+ * @returns True, if background is enabled.
1000
+ */
1001
+ isBackgroundColorEnabled(id: DesignBlockId): boolean;
1002
+ /**
1003
+ * Query if the given block has a stroke property.
1004
+ * @param id - The block to query.
1005
+ * @returns True if the block has a stroke property.
1006
+ */
1007
+ hasStroke(id: DesignBlockId): boolean;
1008
+ /**
1009
+ * Enable or disable the stroke of the given design block.
1010
+ * @param id - The block whose stroke should be enabled or disabled.
1011
+ * @param enabled - If true, the stroke will be enabled.
1012
+ */
1013
+ setStrokeEnabled(id: DesignBlockId, enabled: boolean): void;
1014
+ /**
1015
+ * Query if the stroke of the given design block is enabled.
1016
+ * @param id - The block whose stroke state should be queried.
1017
+ * @returns True if the block's stroke is enabled.
1018
+ */
1019
+ isStrokeEnabled(id: DesignBlockId): boolean;
1020
+ /**
1021
+ * Set the stroke color of the given design block.
1022
+ * @param id - The block whose stroke color should be set.
1023
+ * @param r - The red color component in the range of 0 to 1.
1024
+ * @param g - The green color component in the range of 0 to 1.
1025
+ * @param b - The blue color component in the range of 0 to 1.
1026
+ * @param a - The alpha color component in the range of 0 to 1.
1027
+ */
1028
+ setStrokeColorRGBA(id: DesignBlockId, r: number, g: number, b: number, a?: number): void;
1029
+ /**
1030
+ * Get the stroke color of the given design block.
1031
+ * @param id - The block whose background color should be queried.
1032
+ * @returns The background color.
1033
+ */
1034
+ getStrokeColorRGBA(id: DesignBlockId): RGBA;
1035
+ /**
1036
+ * Set the stroke width of the given design block.
1037
+ * @param id - The block whose stroke width should be set.
1038
+ * @param width - The stroke width to be set.
1039
+ */
1040
+ setStrokeWidth(id: DesignBlockId, width: number): void;
1041
+ /**
1042
+ * Get the stroke width of the given design block.
1043
+ * @param id - The block whose stroke width should be queried.
1044
+ * @returns The stroke's width.
1045
+ */
1046
+ getStrokeWidth(id: DesignBlockId): number;
1047
+ /**
1048
+ * Set the stroke style of the given design block.
1049
+ * @param id - The block whose stroke style should be set.
1050
+ * @param style - The stroke style to be set.
1051
+ */
1052
+ setStrokeStyle(id: DesignBlockId, style: StrokeStyle): void;
1053
+ /**
1054
+ * Get the stroke style of the given design block.
1055
+ * @param id - The block whose stroke style should be queried.
1056
+ * @returns The stroke's style.
1057
+ */
1058
+ getStrokeStyle(id: DesignBlockId): StrokeStyle;
1059
+ /**
1060
+ * Set the stroke position of the given design block.
1061
+ * @param id - The block whose stroke position should be set.
1062
+ * @param position - The stroke position to be set.
1063
+ */
1064
+ setStrokePosition(id: DesignBlockId, position: StrokePosition): void;
1065
+ /**
1066
+ * Get the stroke position of the given design block.
1067
+ * @param id - The block whose stroke position should be queried.
1068
+ * @returns The stroke position.
1069
+ */
1070
+ getStrokePosition(id: DesignBlockId): StrokePosition;
1071
+ /**
1072
+ * Set the stroke corner geometry of the given design block.
1073
+ * @param id - The block whose stroke join geometry should be set.
1074
+ * @param cornerGeometry - The stroke join geometry to be set.
1075
+ */
1076
+ setStrokeCornerGeometry(id: DesignBlockId, cornerGeometry: StrokeCornerGeometry): void;
1077
+ /**
1078
+ * Get the stroke corner geometry of the given design block.
1079
+ * @param id - The block whose stroke join geometry should be queried.
1080
+ * @returns The stroke join geometry.
1081
+ */
1082
+ getStrokeCornerGeometry(id: DesignBlockId): StrokeCornerGeometry;
1083
+ /**
1084
+ * Query if the given block has outline properties.
1085
+ * @param id - The block to query.
1086
+ * @returns true, if the block has outline properties.
1087
+ * @deprecated Use `hasStroke`.
1088
+ */
1089
+ hasOutline(id: DesignBlockId): boolean;
1090
+ /**
1091
+ * Set the outline color of the given design block.
1092
+ * @param id - The block whose outline color should be set.
1093
+ * @param color - The outline color to be set, a tuple of
1094
+ * @param r - The red color component in the range of 0 to 1.
1095
+ * @param g - The green color component in the range of 0 to 1.
1096
+ * @param b - The blue color component in the range of 0 to 1.
1097
+ * @param a - The alpha color component in the range of 0 to 1.
1098
+ * @deprecated Use `setStrokeColorRGBA`.
1099
+ */
1100
+ setOutlineColorRGBA(id: DesignBlockId, r: number, g: number, b: number, a?: number): void;
1101
+ /**
1102
+ * Get the outline color of the given design block.
1103
+ * @param id - The block whose outline color should be queried.
1104
+ * @returns The outline color.
1105
+ * @deprecated Use `getStrokeColorRGBA`.
1106
+ */
1107
+ getOutlineColorRGBA(id: DesignBlockId): RGBA;
1108
+ /**
1109
+ * Enable or disable the outline of the given design block.
1110
+ * @param id - The block whose outline should be enabled or disabled.
1111
+ * @param enabled - If true, the outline will be enabled.
1112
+ * @deprecated Use `setStrokeEnabled`.
1113
+ */
1114
+ setOutlineEnabled(id: DesignBlockId, enabled: boolean): void;
1115
+ /**
1116
+ * Query if the outline of the given design block is enabled.
1117
+ * @param id - The block whose outline state should be queried.
1118
+ * @returns True, if outline is enabled.
1119
+ * @deprecated Use `isStrokeEnabled`.
1120
+ */
1121
+ isOutlineEnabled(id: DesignBlockId): boolean;
1122
+ /**
1123
+ * Set the outline width of the given design block.
1124
+ * @param id - The block whose outline width should be set.
1125
+ * @param width - The outline width to be set.
1126
+ * @deprecated Use `setStrokeWidth`.
1127
+ */
1128
+ setOutlineWidth(id: DesignBlockId, width: number): void;
1129
+ /**
1130
+ * Get the outline width of the given design block.
1131
+ * @param id - The block whose outline width should be queried.
1132
+ * @returns The outline width.
1133
+ * @deprecated Use the Stroke function
1134
+ * @deprecated Use `getStrokeWidth`.
1135
+ */
1136
+ getOutlineWidth(id: DesignBlockId): number;
1137
+ /**
1138
+ * Query if the given block has fill color properties.
1139
+ * @param id - The block to query.
1140
+ * @returns true, if the block has fill color properties, an error otherwise.
1141
+ */
1142
+ hasFill(id: DesignBlockId): boolean;
1143
+ /**
1144
+ * Query if the fill of the given design block is enabled.
1145
+ * @param id - The block whose fill state should be queried.
1146
+ * @returns A result holding the fill state or an error.
1147
+ */
1148
+ isFillEnabled(id: DesignBlockId): boolean;
1149
+ /**
1150
+ * Enable or disable the fill of the given design block.
1151
+ * @param id - The block whose fill should be enabled or disabled.
1152
+ * @param enabled - If true, the fill will be enabled.
1153
+ * @returns An empty result on success, an error otherwise.
1154
+ */
1155
+ setFillEnabled(id: DesignBlockId, enabled: boolean): void;
1156
+ /**
1157
+ * Set the fill type of the given design block.
1158
+ * @param id - The block whose fill type should be set.
1159
+ * @param type - The fill type to set.
1160
+ * @returns An empty result on success, an error otherwise.
1161
+ */
1162
+ setFillType(id: DesignBlockId, fillType: FillType): void;
1163
+ /**
1164
+ * Get the fill type of the given design block.
1165
+ * @param id - The block whose fill type should be queried.
1166
+ * @returns The block's fill type or an error.
1167
+ */
1168
+ getFillType(id: DesignBlockId): FillType;
1169
+ /**
1170
+ * Set the fill color of the given design block.
1171
+ * @param id - The block whose fill color should be set.
1172
+ * @param r - The red color component in the range of 0 to 1.
1173
+ * @param g - The green color component in the range of 0 to 1.
1174
+ * @param b - The blue color component in the range of 0 to 1.
1175
+ * @param a - The alpha color component in the range of 0 to 1.
1176
+ * @returns An empty result on success, an error otherwise.
1177
+ */
1178
+ setFillSolidColor(id: DesignBlockId, r: number, g: number, b: number, a?: number): void;
1179
+ /**
1180
+ * Get the fill color of the given design block.
1181
+ * @param id - The block whose fill color should be queried.
1182
+ * @returns A result holding the fill color or an error.
1183
+ */
1184
+ getFillSolidColor(id: DesignBlockId): RGBA;
1185
+ /**
1186
+ * Set the gradient type of the given design block.
1187
+ * @param id - The block whose gradient type should be set.
1188
+ * @param type - The gradient type.
1189
+ * @returns An empty result on success, an error otherwise.
1190
+ */
1191
+ setFillGradientType(id: DesignBlockId, gradientType: GradientType): void;
1192
+ /**
1193
+ * Get the gradient type of the given design block.
1194
+ * @param id - The block whose gradient type should be queried.
1195
+ * @returns The gradient type.
1196
+ */
1197
+ getFillGradientType(id: DesignBlockId): GradientType;
1198
+ /**
1199
+ * Add a gradient color stop on a design block.
1200
+ * @param id - The block on which a gradient color stop should be added.
1201
+ * @param stop - Where to add a color stop in the range 0 to 1.
1202
+ * @param r - The red color component in the range of 0 to 1.
1203
+ * @param g - The green color component in the range of 0 to 1.
1204
+ * @param b - The blue color component in the range of 0 to 1.
1205
+ * @param a - The alpha color component in the range of 0 to 1.
1206
+ * @returns An empty result on success, an error otherwise.
1207
+ */
1208
+ addFillGradientColorStop(id: DesignBlockId, stop: number, r: number, g: number, b: number, a?: number): void;
1209
+ /**
1210
+ * Remove a previously gradient color stop on a design block.
1211
+ * @param id - The block from which to remove the gradient color stop.
1212
+ * @param stop - The stop's position.
1213
+ * @returns An empty result on success, an error otherwise.
1214
+ */
1215
+ removeFillGradientColorStop(id: DesignBlockId, stop: number): void;
1216
+ /**
1217
+ * Get the gradient fill color stops of the given design block.
1218
+ * @param id - The block whose gradient color stop should be queried.
1219
+ * @returns All of the design block's gradient color stops.
1220
+ */
1221
+ getFillGradientColorStops(id: DesignBlockId): GradientstopRGBA[];
1222
+ /**
1223
+ * Set the gradient fill color stops of the given design block, overwriting previously set color stops.
1224
+ * @param id - The block whose gradient color stop should be set.
1225
+ * @param stops - The gradient color stops to set.
1226
+ * @returns An empty result on success, an error otherwise.
1227
+ */
1228
+ setFillGradientColorStops(id: DesignBlockId, stops: GradientstopRGBA[]): void;
1229
+ /**
1230
+ * Set the position of a gradient's control point.
1231
+ * Note that Different gradient types of different control points.
1232
+ * @param id - The block whose gradient control point should be set.
1233
+ * @param gradientControlPointType - The type of control point.
1234
+ * @param x - The horizontal component of the control point.
1235
+ * @param y - The vertical component of the control point.
1236
+ * @returns true if the control point was set, an error otherwise.
1237
+ */
1238
+ setFillGradientControlPoint(id: DesignBlockId, gradientControlPointType: GradientControlPointType, x: number, y: number): boolean;
1239
+ /**
1240
+ * Get the horizontal component of a gradient's control point.
1241
+ * @param id - The block whose gradient control point should be queried.
1242
+ * @param gradientControlPointType - The type of control point.
1243
+ * @returns The horizontal component of the control point, an error otherwise.
1244
+ */
1245
+ getFillGradientControlPointX(id: DesignBlockId, gradientControlPointType: GradientControlPointType): number;
1246
+ /**
1247
+ * Get the vertical component of a gradient's control point.
1248
+ * @param id - The block whose gradient control point should be queried.
1249
+ * @param gradientControlPointType - The type of control point.
1250
+ * @returns The vertical component of the control point, an error otherwise.
1251
+ */
1252
+ getFillGradientControlPointY(id: DesignBlockId, gradientControlPointType: GradientControlPointType): number;
1253
+ /**
1254
+ * Set a gradient's radius.
1255
+ * Note that Not all gradients have a radius.
1256
+ * @param id - The block whose gradient radius should be set.
1257
+ * @param radius - The gradient's radius.
1258
+ * @returns true if the control point was set, an error otherwise.
1259
+ */
1260
+ setFillGradientRadius(id: DesignBlockId, radius: number): boolean;
1261
+ /**
1262
+ * Get a gradient's radius.
1263
+ * Note that Not all gradients have a radius.
1264
+ * @param id - The block whose gradient radius should be queried.
1265
+ * @returns the gradient's radius, an error otherwise.
1266
+ */
1267
+ getFillGradientRadius(id: DesignBlockId): number;
1333
1268
  }
1334
1269
 
1335
1270
  /**
1336
1271
  * @public
1337
1272
  */
1338
1273
  export declare type BlockEvent = {
1339
- block: DesignBlockId;
1340
- type: 'Created' | 'Updated' | 'Destroyed';
1274
+ block: DesignBlockId;
1275
+ type: 'Created' | 'Updated' | 'Destroyed';
1341
1276
  };
1342
1277
 
1343
1278
  /** @public */
1344
1279
  declare interface BlockEvent_2 {
1345
- block: Block;
1346
- type: 'Created' | 'Updated' | 'Destroyed';
1280
+ block: Block;
1281
+ type: 'Created' | 'Updated' | 'Destroyed';
1347
1282
  }
1348
1283
 
1349
1284
  /** @public */
1350
1285
  declare type Callbacks = {
1351
- log?: Logger;
1286
+ log?: Logger;
1352
1287
  };
1353
1288
 
1354
1289
  /**
@@ -1356,10 +1291,10 @@ declare type Callbacks = {
1356
1291
  * @public
1357
1292
  */
1358
1293
  export declare interface CMYKColor {
1359
- c: number;
1360
- m: number;
1361
- y: number;
1362
- k: number;
1294
+ c: number;
1295
+ m: number;
1296
+ y: number;
1297
+ k: number;
1363
1298
  }
1364
1299
 
1365
1300
  /**
@@ -1371,65 +1306,65 @@ declare type Color_2 = HexColorString | RGBColor | RGBAColor | SpotColor;
1371
1306
 
1372
1307
  /** @public */
1373
1308
  declare type ColorDefinition = Preset & {
1374
- value: Color_2;
1309
+ value: Color_2;
1375
1310
  };
1376
1311
 
1377
1312
  /** @public */
1378
1313
  declare type ColorPaletteDefinition = Preset & {
1379
- entries: Color_2[];
1314
+ entries: Color_2[];
1380
1315
  };
1381
1316
 
1382
1317
  declare namespace ConfigTypes {
1383
- export {
1384
- HexColorString,
1385
- Color_2 as Color,
1386
- AssetSources,
1387
- AssetSource_2 as AssetSource,
1388
- AssetResult_2 as AssetResult,
1389
- AssetsQueryResult_2 as AssetsQueryResult,
1390
- QueryData,
1391
- Preset,
1392
- VariableDefinition,
1393
- ColorDefinition,
1394
- ColorPaletteDefinition,
1395
- PageFormatDefinition,
1396
- TemplateDefinition,
1397
- TypefaceDefinition,
1398
- ImageDefinition,
1399
- Presets,
1400
- Variables,
1401
- Core,
1402
- Extensions,
1403
- Scene,
1404
- Page,
1405
- Callbacks
1406
- };
1318
+ export {
1319
+ HexColorString,
1320
+ Color_2 as Color,
1321
+ AssetSources,
1322
+ AssetSource_2 as AssetSource,
1323
+ AssetResult_2 as AssetResult,
1324
+ AssetsQueryResult_2 as AssetsQueryResult,
1325
+ QueryData,
1326
+ Preset,
1327
+ VariableDefinition,
1328
+ ColorDefinition,
1329
+ ColorPaletteDefinition,
1330
+ PageFormatDefinition,
1331
+ TemplateDefinition,
1332
+ TypefaceDefinition,
1333
+ ImageDefinition,
1334
+ Presets,
1335
+ Variables,
1336
+ Core,
1337
+ Extensions,
1338
+ Scene,
1339
+ Page,
1340
+ Callbacks
1341
+ }
1407
1342
  }
1408
- export { ConfigTypes };
1343
+ export { ConfigTypes }
1409
1344
 
1410
1345
  /** @public */
1411
1346
  export declare interface Configuration {
1412
- baseURL: string;
1413
- license?: string;
1414
- role: RoleString;
1415
- featureFlags?: Record<string, string | boolean>;
1416
- extensions: ConfigTypes.Extensions;
1417
- core: ConfigTypes.Core;
1418
- scene: ConfigTypes.Scene;
1419
- page: ConfigTypes.Page;
1420
- assetSources: ConfigTypes.AssetSources;
1421
- presets: ConfigTypes.Presets;
1422
- variables: ConfigTypes.Variables;
1423
- callbacks: ConfigTypes.Callbacks;
1424
- /**
1425
- * The default font used by a text added to the scene. Needs to be the id of
1426
- * the font from a extension pack including namespace, e.g.
1427
- *
1428
- * '//ly.img.cesdk.fonts/roboto_regular'
1429
- *
1430
- * If not configured the fallback font is used.
1431
- */
1432
- defaultFont?: string;
1347
+ baseURL: string;
1348
+ license?: string;
1349
+ role: RoleString;
1350
+ featureFlags?: Record<string, string | boolean>;
1351
+ extensions: ConfigTypes.Extensions;
1352
+ core: ConfigTypes.Core;
1353
+ scene: ConfigTypes.Scene;
1354
+ page: ConfigTypes.Page;
1355
+ assetSources: ConfigTypes.AssetSources;
1356
+ presets: ConfigTypes.Presets;
1357
+ variables: ConfigTypes.Variables;
1358
+ callbacks: ConfigTypes.Callbacks;
1359
+ /**
1360
+ * The default font used by a text added to the scene. Needs to be the id of
1361
+ * the font from a extension pack including namespace, e.g.
1362
+ *
1363
+ * '//ly.img.cesdk.fonts/roboto_regular'
1364
+ *
1365
+ * If not configured the fallback font is used.
1366
+ */
1367
+ defaultFont?: string;
1433
1368
  }
1434
1369
 
1435
1370
  /**
@@ -1443,7 +1378,7 @@ export declare type ContentFillMode = 'Crop' | 'Cover' | 'Contain';
1443
1378
 
1444
1379
  /** @public */
1445
1380
  declare type Core = {
1446
- baseURL: string;
1381
+ baseURL: string;
1447
1382
  };
1448
1383
 
1449
1384
  /**
@@ -1452,29 +1387,26 @@ declare type Core = {
1452
1387
  * @public
1453
1388
  */
1454
1389
  declare class CreativeEngine {
1455
- #private;
1456
- block: BlockAPI;
1457
- scene: SceneAPI;
1458
- variable: VariableAPI;
1459
- editor: EditorAPI;
1460
-
1461
- event: EventAPI;
1462
-
1463
- /**
1464
- * Dispose the engine.
1465
- */
1466
- dispose(): void;
1467
- /**
1468
- * Initialize a `CreativeEngine` using the given `canvas` element and an optional config.
1469
- * @param config - A configuration object.
1470
- * @param canvas - The canvas to use for drawing. Optional, if no canvas is provided,
1471
- * the engine works with an internal offscreen-canvas.
1472
- * @returns An engine instance.
1473
- */
1474
- static init(
1475
- config?: Partial<Configuration>,
1476
- canvas?: HTMLCanvasElement | OffscreenCanvas
1477
- ): Promise<CreativeEngine>;
1390
+ #private;
1391
+ block: BlockAPI;
1392
+ scene: SceneAPI;
1393
+ variable: VariableAPI;
1394
+ editor: EditorAPI;
1395
+
1396
+ event: EventAPI;
1397
+
1398
+ /**
1399
+ * Dispose the engine.
1400
+ */
1401
+ dispose(): void;
1402
+ /**
1403
+ * Initialize a `CreativeEngine` using the given `canvas` element and an optional config.
1404
+ * @param config - A configuration object.
1405
+ * @param canvas - The canvas to use for drawing. Optional, if no canvas is provided,
1406
+ * the engine works with an internal offscreen-canvas.
1407
+ * @returns An engine instance.
1408
+ */
1409
+ static init(config?: Partial<Configuration>, canvas?: HTMLCanvasElement | OffscreenCanvas): Promise<CreativeEngine>;
1478
1410
  }
1479
1411
  export default CreativeEngine;
1480
1412
 
@@ -1488,21 +1420,21 @@ export declare type DesignBlockId = number;
1488
1420
  * @public
1489
1421
  */
1490
1422
  export declare enum DesignBlockType {
1491
- Scene = '//ly.img.ubq/scene',
1492
- Stack = '//ly.img.ubq/stack',
1493
- Camera = '//ly.img.ubq/camera',
1494
- Page = '//ly.img.ubq/page',
1495
- Image = '//ly.img.ubq/image',
1496
- Video = '//ly.img.ubq/video',
1497
- Text = '//ly.img.ubq/text',
1498
- Sticker = '//ly.img.ubq/sticker',
1499
- VectorPath = '//ly.img.ubq/vector_path',
1500
- RectShape = '//ly.img.ubq/shapes/rect',
1501
- LineShape = '//ly.img.ubq/shapes/line',
1502
- StarShape = '//ly.img.ubq/shapes/star',
1503
- PolygonShape = '//ly.img.ubq/shapes/polygon',
1504
- EllipseShape = '//ly.img.ubq/shapes/ellipse',
1505
- Group = '//ly.img.ubq/group'
1423
+ Scene = "//ly.img.ubq/scene",
1424
+ Stack = "//ly.img.ubq/stack",
1425
+ Camera = "//ly.img.ubq/camera",
1426
+ Page = "//ly.img.ubq/page",
1427
+ Image = "//ly.img.ubq/image",
1428
+ Video = "//ly.img.ubq/video",
1429
+ Text = "//ly.img.ubq/text",
1430
+ Sticker = "//ly.img.ubq/sticker",
1431
+ VectorPath = "//ly.img.ubq/vector_path",
1432
+ RectShape = "//ly.img.ubq/shapes/rect",
1433
+ LineShape = "//ly.img.ubq/shapes/line",
1434
+ StarShape = "//ly.img.ubq/shapes/star",
1435
+ PolygonShape = "//ly.img.ubq/shapes/polygon",
1436
+ EllipseShape = "//ly.img.ubq/shapes/ellipse",
1437
+ Group = "//ly.img.ubq/group"
1506
1438
  }
1507
1439
 
1508
1440
  /** @public */
@@ -1512,215 +1444,200 @@ export declare type DesignUnit = 'mm' | 'px' | 'in';
1512
1444
  * @public
1513
1445
  */
1514
1446
  export declare class EditorAPI {
1515
- #private;
1516
-
1517
- /**
1518
- * Subscribe to changes to the editor state.
1519
- * @param callback - This function is called at the end of the engine update, if the editor state has changed.
1520
- * @returns A method to unsubscribe.
1521
- */
1522
- onStateChanged(callback: () => void): () => void;
1523
- /**
1524
- * Set the edit mode of the editor.
1525
- * An edit mode defines what type of content can currently be edited by the user.
1526
- * Hint: the initial edit mode is "Transform".
1527
- * @param mode - "Transform", "Crop", "Text", or a custom value.
1528
- */
1529
- setEditMode(mode: 'Transform' | 'Crop' | 'Text' | string): void;
1530
- /**
1531
- * Get the current edit mode of the editor.
1532
- * An edit mode defines what type of content can currently be edited by the user.
1533
- * @returns "Transform", "Crop", "Text", or a custom value.
1534
- */
1535
- getEditMode(): 'Transform' | 'Crop' | 'Text' | string;
1536
- /**
1537
- * Get the type of cursor that should be displayed by the application.
1538
- * @returns The cursor type.
1539
- */
1540
- getCursorType():
1541
- | 'Arrow'
1542
- | 'Move'
1543
- | 'MoveNotPermitted'
1544
- | 'Resize'
1545
- | 'Rotate'
1546
- | 'Text';
1547
- /**
1548
- * Get the rotation with which to render the mouse cursor.
1549
- * @returns The angle in radians.
1550
- */
1551
- getCursorRotation(): number;
1552
- /**
1553
- * Get the current text cursor's x position in screen space.
1554
- * @returns The text cursor's x position in screen space.
1555
- */
1556
- getTextCursorPositionInScreenSpaceX(): number;
1557
- /**
1558
- * Get the current text cursor's y position in screen space.
1559
- * @returns The text cursor's y position in screen space.
1560
- */
1561
- getTextCursorPositionInScreenSpaceY(): number;
1562
- /**
1563
- * Sets the zoom level of the scene.
1564
- * @param zoomLevel - The new zoom level.
1565
- */
1566
- setZoomLevel(zoomLevel?: number): void;
1567
- /**
1568
- * Query a camera zoom level.
1569
- * @returns The zoom level of the block's (main) camera.
1570
- */
1571
- getZoomLevel(): number;
1572
- /**
1573
- * Adds a new history state to the stack, if undoable changes were made.
1574
- */
1575
- addUndoStep(): void;
1576
- /**
1577
- * Undo one step in the history if an undo step is available.
1578
- */
1579
- undo(): void;
1580
- /**
1581
- * Redo one step in the history if a redo step is available.
1582
- */
1583
- redo(): void;
1584
- /**
1585
- * If an undo step is available.
1586
- *
1587
- * @returns True if an undo step is available.
1588
- */
1589
- canUndo(): boolean;
1590
- /**
1591
- * If a redo step is available.
1592
- *
1593
- * @returns True if a redo step is available.
1594
- */
1595
- canRedo(): boolean;
1596
- /**
1597
- * Set a boolean setting.
1598
- * @param keypath - The settings keypath, e.g. `ubq://doubleClickToCropEnabled`
1599
- * @param value - The value to set.
1600
- * @throws An error, if the keypath is invalid.
1601
- */
1602
- setSettingBool(keypath: string, value: boolean): void;
1603
- /**
1604
- * Get a boolean setting.
1605
- * @param keypath - The settings keypath, e.g. `ubq://doubleClickToCropEnabled`
1606
- * @throws An error, if the keypath is invalid.
1607
- */
1608
- getSettingBool(keypath: string): boolean;
1609
- /**
1610
- * Set an integer setting.
1611
- * @param keypath - The settings keypath.
1612
- * @param value - The value to set.
1613
- * @throws An error, if the keypath is invalid.
1614
- */
1615
- setSettingInt(keypath: string, value: number): void;
1616
- /**
1617
- * Get an integer setting.
1618
- * @param keypath - The settings keypath.
1619
- * @throws An error, if the keypath is invalid.
1620
- */
1621
- getSettingInt(keypath: string): number;
1622
- /**
1623
- * Set a float setting.
1624
- * @param keypath - The settings keypath, e.g. `ubq://positionSnappingThreshold`
1625
- * @param value - The value to set.
1626
- * @throws An error, if the keypath is invalid.
1627
- */
1628
- setSettingFloat(keypath: string, value: number): void;
1629
- /**
1630
- * Get a float setting.
1631
- * @param keypath - The settings keypath, e.g. `ubq://positionSnappingThreshold`
1632
- * @throws An error, if the keypath is invalid.
1633
- */
1634
- getSettingFloat(keypath: string): number;
1635
- /**
1636
- * Set a string setting.
1637
- * @param keypath - The settings keypath, e.g. `ubq://license`
1638
- * @param value - The value to set.
1639
- * @throws An error, if the keypath is invalid.
1640
- */
1641
- setSettingString(keypath: string, value: string): void;
1642
- /**
1643
- * Get a string setting.
1644
- * @param keypath - The settings keypath, e.g. `ubq://license`
1645
- * @throws An error, if the keypath is invalid.
1646
- */
1647
- getSettingString(keypath: string): string;
1648
- /**
1649
- * Set a color setting.
1650
- * @param keypath - The settings keypath, e.g. `ubq://highlightColor`.
1651
- * @param r - The red color component in the range of 0 to 1.
1652
- * @param g - The green color component in the range of 0 to 1.
1653
- * @param b - The blue color component in the range of 0 to 1.
1654
- * @param a - The alpha color component in the range of 0 to 1.
1655
- */
1656
- setSettingColorRGBA(
1657
- keypath: string,
1658
- r: number,
1659
- g: number,
1660
- b: number,
1661
- a: number
1662
- ): void;
1663
- /**
1664
- * Get a color setting.
1665
- * @param keypath - The settings keypath, e.g. `ubq://highlightColor`.
1666
- * @returns A tuple of channels red, green, blue and alpha in the range of 0 to 1.
1667
- */
1668
- getSettingColorRGBA(keypath: string): RGBA;
1669
- /**
1670
- * Set an enum setting.
1671
- * @param keypath - The settings keypath, e.g. `ubq://role`.
1672
- * @param value - The enum value as string.
1673
- */
1674
- setSettingEnum(keypath: string, value: string): void;
1675
- /**
1676
- * Get an enum setting.
1677
- * @param keypath - The settings keypath, e.g. `ubq://role`.
1678
- * @returns The value as string.
1679
- */
1680
- getSettingEnum(keypath: string): string;
1447
+ #private;
1448
+
1449
+ /**
1450
+ * Subscribe to changes to the editor state.
1451
+ * @param callback - This function is called at the end of the engine update, if the editor state has changed.
1452
+ * @returns A method to unsubscribe.
1453
+ */
1454
+ onStateChanged(callback: () => void): () => void;
1455
+ /**
1456
+ * Set the edit mode of the editor.
1457
+ * An edit mode defines what type of content can currently be edited by the user.
1458
+ * Hint: the initial edit mode is "Transform".
1459
+ * @param mode - "Transform", "Crop", "Text", or a custom value.
1460
+ */
1461
+ setEditMode(mode: 'Transform' | 'Crop' | 'Text' | string): void;
1462
+ /**
1463
+ * Get the current edit mode of the editor.
1464
+ * An edit mode defines what type of content can currently be edited by the user.
1465
+ * @returns "Transform", "Crop", "Text", or a custom value.
1466
+ */
1467
+ getEditMode(): 'Transform' | 'Crop' | 'Text' | string;
1468
+ /**
1469
+ * Get the type of cursor that should be displayed by the application.
1470
+ * @returns The cursor type.
1471
+ */
1472
+ getCursorType(): 'Arrow' | 'Move' | 'MoveNotPermitted' | 'Resize' | 'Rotate' | 'Text';
1473
+ /**
1474
+ * Get the rotation with which to render the mouse cursor.
1475
+ * @returns The angle in radians.
1476
+ */
1477
+ getCursorRotation(): number;
1478
+ /**
1479
+ * Get the current text cursor's x position in screen space.
1480
+ * @returns The text cursor's x position in screen space.
1481
+ */
1482
+ getTextCursorPositionInScreenSpaceX(): number;
1483
+ /**
1484
+ * Get the current text cursor's y position in screen space.
1485
+ * @returns The text cursor's y position in screen space.
1486
+ */
1487
+ getTextCursorPositionInScreenSpaceY(): number;
1488
+ /**
1489
+ * Sets the zoom level of the scene.
1490
+ * @param zoomLevel - The new zoom level.
1491
+ */
1492
+ setZoomLevel(zoomLevel?: number): void;
1493
+ /**
1494
+ * Query a camera zoom level.
1495
+ * @returns The zoom level of the block's (main) camera.
1496
+ */
1497
+ getZoomLevel(): number;
1498
+ /**
1499
+ * Adds a new history state to the stack, if undoable changes were made.
1500
+ */
1501
+ addUndoStep(): void;
1502
+ /**
1503
+ * Undo one step in the history if an undo step is available.
1504
+ */
1505
+ undo(): void;
1506
+ /**
1507
+ * Redo one step in the history if a redo step is available.
1508
+ */
1509
+ redo(): void;
1510
+ /**
1511
+ * If an undo step is available.
1512
+ *
1513
+ * @returns True if an undo step is available.
1514
+ */
1515
+ canUndo(): boolean;
1516
+ /**
1517
+ * If a redo step is available.
1518
+ *
1519
+ * @returns True if a redo step is available.
1520
+ */
1521
+ canRedo(): boolean;
1522
+ /**
1523
+ * Set a boolean setting.
1524
+ * @param keypath - The settings keypath, e.g. `ubq://doubleClickToCropEnabled`
1525
+ * @param value - The value to set.
1526
+ * @throws An error, if the keypath is invalid.
1527
+ */
1528
+ setSettingBool(keypath: string, value: boolean): void;
1529
+ /**
1530
+ * Get a boolean setting.
1531
+ * @param keypath - The settings keypath, e.g. `ubq://doubleClickToCropEnabled`
1532
+ * @throws An error, if the keypath is invalid.
1533
+ */
1534
+ getSettingBool(keypath: string): boolean;
1535
+ /**
1536
+ * Set an integer setting.
1537
+ * @param keypath - The settings keypath.
1538
+ * @param value - The value to set.
1539
+ * @throws An error, if the keypath is invalid.
1540
+ */
1541
+ setSettingInt(keypath: string, value: number): void;
1542
+ /**
1543
+ * Get an integer setting.
1544
+ * @param keypath - The settings keypath.
1545
+ * @throws An error, if the keypath is invalid.
1546
+ */
1547
+ getSettingInt(keypath: string): number;
1548
+ /**
1549
+ * Set a float setting.
1550
+ * @param keypath - The settings keypath, e.g. `ubq://positionSnappingThreshold`
1551
+ * @param value - The value to set.
1552
+ * @throws An error, if the keypath is invalid.
1553
+ */
1554
+ setSettingFloat(keypath: string, value: number): void;
1555
+ /**
1556
+ * Get a float setting.
1557
+ * @param keypath - The settings keypath, e.g. `ubq://positionSnappingThreshold`
1558
+ * @throws An error, if the keypath is invalid.
1559
+ */
1560
+ getSettingFloat(keypath: string): number;
1561
+ /**
1562
+ * Set a string setting.
1563
+ * @param keypath - The settings keypath, e.g. `ubq://license`
1564
+ * @param value - The value to set.
1565
+ * @throws An error, if the keypath is invalid.
1566
+ */
1567
+ setSettingString(keypath: string, value: string): void;
1568
+ /**
1569
+ * Get a string setting.
1570
+ * @param keypath - The settings keypath, e.g. `ubq://license`
1571
+ * @throws An error, if the keypath is invalid.
1572
+ */
1573
+ getSettingString(keypath: string): string;
1574
+ /**
1575
+ * Set a color setting.
1576
+ * @param keypath - The settings keypath, e.g. `ubq://highlightColor`.
1577
+ * @param r - The red color component in the range of 0 to 1.
1578
+ * @param g - The green color component in the range of 0 to 1.
1579
+ * @param b - The blue color component in the range of 0 to 1.
1580
+ * @param a - The alpha color component in the range of 0 to 1.
1581
+ */
1582
+ setSettingColorRGBA(keypath: string, r: number, g: number, b: number, a?: number): void;
1583
+ /**
1584
+ * Get a color setting.
1585
+ * @param keypath - The settings keypath, e.g. `ubq://highlightColor`.
1586
+ * @returns A tuple of channels red, green, blue and alpha in the range of 0 to 1.
1587
+ */
1588
+ getSettingColorRGBA(keypath: string): RGBA;
1589
+ /**
1590
+ * Set an enum setting.
1591
+ * @param keypath - The settings keypath, e.g. `ubq://role`.
1592
+ * @param value - The enum value as string.
1593
+ */
1594
+ setSettingEnum(keypath: string, value: string): void;
1595
+ /**
1596
+ * Get an enum setting.
1597
+ * @param keypath - The settings keypath, e.g. `ubq://role`.
1598
+ * @returns The value as string.
1599
+ */
1600
+ getSettingEnum(keypath: string): string;
1681
1601
  }
1682
1602
 
1683
1603
  /**
1684
1604
  * @public
1685
1605
  */
1686
1606
  export declare class EventAPI {
1687
- #private;
1688
-
1689
- /**
1690
- * Subscribe to block life-cycle events.
1691
- * @param blocks - A list of blocks to filter events by. If the list is empty, events for every block are sent.
1692
- * @param callback - The event callback. Events are bundled and sent at the end of each engine update.
1693
- * @returns A method to unsubscribe.
1694
- */
1695
- subscribe(
1696
- blocks: DesignBlockId[],
1697
- callback: (events: BlockEvent[]) => void
1698
- ): () => void;
1607
+ #private;
1608
+
1609
+ /**
1610
+ * Subscribe to block life-cycle events.
1611
+ * @param blocks - A list of blocks to filter events by. If the list is empty, events for every block are sent.
1612
+ * @param callback - The event callback. Events are bundled and sent at the end of each engine update.
1613
+ * @returns A method to unsubscribe.
1614
+ */
1615
+ subscribe(blocks: DesignBlockId[], callback: (events: BlockEvent[]) => void): () => void;
1699
1616
  }
1700
1617
 
1701
1618
  /** @public */
1702
1619
  declare interface ExportOptions {
1703
- jpegQuality: number;
1704
- pngCompressionLevel: number;
1705
- useTargetSize: boolean;
1706
- targetWidth: number;
1707
- targetHeight: number;
1620
+ jpegQuality: number;
1621
+ pngCompressionLevel: number;
1622
+ useTargetSize: boolean;
1623
+ targetWidth: number;
1624
+ targetHeight: number;
1708
1625
  }
1709
1626
 
1710
1627
  /** @public */
1711
1628
  declare interface ExportVideoOptions {
1712
- h264Profile: number;
1713
- h264Level: number;
1714
- framerate: number;
1715
- useTargetSize: boolean;
1716
- targetWidth: number;
1717
- targetHeight: number;
1629
+ h264Profile: number;
1630
+ h264Level: number;
1631
+ framerate: number;
1632
+ useTargetSize: boolean;
1633
+ targetWidth: number;
1634
+ targetHeight: number;
1718
1635
  }
1719
1636
 
1720
1637
  /** @public */
1721
1638
  declare type Extensions = {
1722
- baseURL: string;
1723
- entries: string[];
1639
+ baseURL: string;
1640
+ entries: string[];
1724
1641
  };
1725
1642
 
1726
1643
  /**
@@ -1730,24 +1647,15 @@ export declare type FillType = 'Solid' | 'Gradient';
1730
1647
 
1731
1648
  /** @public */
1732
1649
  declare interface Flip {
1733
- horizontal: boolean;
1734
- vertical: boolean;
1650
+ horizontal: boolean;
1651
+ vertical: boolean;
1735
1652
  }
1736
1653
 
1737
1654
  /** @public */
1738
1655
  export declare type FontStyle = 'normal' | 'italic';
1739
1656
 
1740
1657
  /** @public */
1741
- export declare type FontWeight =
1742
- | 'thin'
1743
- | 'extraLight'
1744
- | 'Light'
1745
- | 'normal'
1746
- | 'medium'
1747
- | 'semiBold'
1748
- | 'bold'
1749
- | 'extraBold'
1750
- | 'heavy';
1658
+ export declare type FontWeight = 'thin' | 'extraLight' | 'Light' | 'normal' | 'medium' | 'semiBold' | 'bold' | 'extraBold' | 'heavy';
1751
1659
 
1752
1660
  /**
1753
1661
  * @public
@@ -1758,11 +1666,11 @@ export declare type GradientControlPointType = 'Start' | 'End' | 'Center';
1758
1666
  * @public
1759
1667
  */
1760
1668
  export declare type GradientstopRGBA = [
1761
- stop: number,
1762
- r: number,
1763
- g: number,
1764
- b: number,
1765
- a: number
1669
+ stop: number,
1670
+ r: number,
1671
+ g: number,
1672
+ b: number,
1673
+ a: number
1766
1674
  ];
1767
1675
 
1768
1676
  /**
@@ -1790,13 +1698,13 @@ declare type HexColorString = string;
1790
1698
 
1791
1699
  /** @public */
1792
1700
  declare type ImageDefinition = Preset & {
1793
- imageURL: string;
1794
- thumbnailURL?: string;
1795
- width: number;
1796
- height: number;
1797
- levelOfDetail?: {
1798
- [lod: number]: string;
1799
- };
1701
+ imageURL: string;
1702
+ thumbnailURL?: string;
1703
+ width: number;
1704
+ height: number;
1705
+ levelOfDetail?: {
1706
+ [lod: number]: string;
1707
+ };
1800
1708
  };
1801
1709
 
1802
1710
  /**
@@ -1810,55 +1718,55 @@ export declare type Logger = (message: string, level: LogLevel) => void;
1810
1718
 
1811
1719
  /** @public */
1812
1720
  export declare enum LogLevel {
1813
- Info = 'Info',
1814
- Warning = 'Warning',
1815
- Error = 'Error'
1721
+ Info = "Info",
1722
+ Warning = "Warning",
1723
+ Error = "Error"
1816
1724
  }
1817
1725
 
1818
1726
  /** @public */
1819
1727
  declare enum MimeType_2 {
1820
- Png = 'image/png',
1821
- Jpeg = 'image/jpeg',
1822
- Tga = 'image/x-tga',
1823
- Mp4 = 'video/mp4',
1824
- Binary = 'application/octet-stream',
1825
- Pdf = 'application/pdf',
1826
- Zip = 'application/zip'
1728
+ Png = "image/png",
1729
+ Jpeg = "image/jpeg",
1730
+ Tga = "image/x-tga",
1731
+ Mp4 = "video/mp4",
1732
+ Binary = "application/octet-stream",
1733
+ Pdf = "application/pdf",
1734
+ Zip = "application/zip"
1827
1735
  }
1828
- export { MimeType_2 as MimeType };
1736
+ export { MimeType_2 as MimeType }
1829
1737
 
1830
1738
  /** @public */
1831
1739
  declare type Page = {
1832
- title: {
1833
- /**
1834
- * Whether newly created pages should show a title.
1835
- */
1836
- show?: boolean;
1740
+ title: {
1741
+ /**
1742
+ * Whether newly created pages should show a title.
1743
+ */
1744
+ show?: boolean;
1745
+ /**
1746
+ * The font file to use to render the page titles.
1747
+ */
1748
+ fontFileUri?: string;
1749
+ };
1837
1750
  /**
1838
- * The font file to use to render the page titles.
1751
+ * Whether the opacity of the region outside of all
1752
+ * pages should be reduced.
1839
1753
  */
1840
- fontFileUri?: string;
1841
- };
1842
- /**
1843
- * Whether the opacity of the region outside of all
1844
- * pages should be reduced.
1845
- */
1846
- dimOutOfPageAreas?: boolean;
1754
+ dimOutOfPageAreas?: boolean;
1847
1755
  };
1848
1756
 
1849
1757
  /** @public */
1850
1758
  declare type PageFormatDefinition = Preset & {
1851
- width: number;
1852
- height: number;
1853
- unit: DesignUnit;
1854
- dpi?: number;
1855
- bleedMargin?: number;
1759
+ width: number;
1760
+ height: number;
1761
+ unit: DesignUnit;
1762
+ dpi?: number;
1763
+ bleedMargin?: number;
1856
1764
  };
1857
1765
 
1858
1766
  /** @public */
1859
1767
  export declare interface PaginatedAssetQueryData extends AssetQueryData {
1860
- /** The current page queried for paginated views. */
1861
- page: number;
1768
+ /** The current page queried for paginated views. */
1769
+ page: number;
1862
1770
  }
1863
1771
 
1864
1772
  /**
@@ -1872,58 +1780,51 @@ export declare type PositionMode = 'Absolute' | 'Percent' | 'Auto';
1872
1780
 
1873
1781
  /** @public */
1874
1782
  declare type Preset = {
1875
- meta?: {
1876
- default?: boolean;
1877
- library?: string;
1878
- categories?: string[];
1879
- };
1783
+ meta?: {
1784
+ default?: boolean;
1785
+ library?: string;
1786
+ categories?: string[];
1787
+ };
1880
1788
  };
1881
1789
 
1882
1790
  /** @public */
1883
1791
  declare type Presets = {
1884
- colors?: {
1885
- [id: string]: ColorDefinition;
1886
- };
1887
- typefaces?: {
1888
- [id: string]: TypefaceDefinition;
1889
- };
1890
- images?: {
1891
- [id: string]: ImageDefinition;
1892
- };
1893
- pageFormats?: {
1894
- [id: string]: PageFormatDefinition;
1895
- };
1896
- colorPalettes?: {
1897
- [id: string]: ColorPaletteDefinition;
1898
- };
1899
- templates?: {
1900
- [id: string]: TemplateDefinition;
1901
- };
1792
+ colors?: {
1793
+ [id: string]: ColorDefinition;
1794
+ };
1795
+ typefaces?: {
1796
+ [id: string]: TypefaceDefinition;
1797
+ };
1798
+ images?: {
1799
+ [id: string]: ImageDefinition;
1800
+ };
1801
+ pageFormats?: {
1802
+ [id: string]: PageFormatDefinition;
1803
+ };
1804
+ colorPalettes?: {
1805
+ [id: string]: ColorPaletteDefinition;
1806
+ };
1807
+ templates?: {
1808
+ [id: string]: TemplateDefinition;
1809
+ };
1902
1810
  };
1903
1811
 
1904
1812
  /** @public */
1905
- export declare type PropertyType =
1906
- | 'Bool'
1907
- | 'Int'
1908
- | 'Float'
1909
- | 'String'
1910
- | 'Color'
1911
- | 'Enum'
1912
- | 'Struct';
1813
+ export declare type PropertyType = 'Bool' | 'Int' | 'Float' | 'String' | 'Color' | 'Enum' | 'Struct';
1913
1814
 
1914
1815
  /** @public */
1915
1816
  declare interface QueryData {
1916
- /** A query string used for (fuzzy) searching of labels and tags */
1917
- query?: string;
1918
- /**
1919
- * The number of results queried. How many assets shall be returned regardless
1920
- * of the total number of assets available.
1921
- *
1922
- * Together with `page` this can be used for pagination.
1923
- */
1924
- perPage: number;
1925
- /** The current page queried for paginated views. */
1926
- page: number;
1817
+ /** A query string used for (fuzzy) searching of labels and tags */
1818
+ query?: string;
1819
+ /**
1820
+ * The number of results queried. How many assets shall be returned regardless
1821
+ * of the total number of assets available.
1822
+ *
1823
+ * Together with `page` this can be used for pagination.
1824
+ */
1825
+ perPage: number;
1826
+ /** The current page queried for paginated views. */
1827
+ page: number;
1927
1828
  }
1928
1829
 
1929
1830
  /**
@@ -1936,10 +1837,10 @@ export declare type RGBA = [r: number, g: number, b: number, a: number];
1936
1837
  * @public
1937
1838
  */
1938
1839
  export declare interface RGBAColor {
1939
- r: number;
1940
- g: number;
1941
- b: number;
1942
- a: number;
1840
+ r: number;
1841
+ g: number;
1842
+ b: number;
1843
+ a: number;
1943
1844
  }
1944
1845
 
1945
1846
  /**
@@ -1947,9 +1848,9 @@ export declare interface RGBAColor {
1947
1848
  * @public
1948
1849
  */
1949
1850
  export declare interface RGBColor {
1950
- r: number;
1951
- g: number;
1952
- b: number;
1851
+ r: number;
1852
+ g: number;
1853
+ b: number;
1953
1854
  }
1954
1855
 
1955
1856
  /** @public */
@@ -1960,116 +1861,112 @@ export declare type RoleString = 'Creator' | 'Adopter' | 'Viewer' | 'Presenter';
1960
1861
  * @public
1961
1862
  */
1962
1863
  declare type Scene = {
1963
- maskSpotColor?: SpotColor;
1964
- /**
1965
- * The DPI value to use when exporting and when converting between pixels and inches or millimeter units.
1966
- * (In the CESDK, this value is synonymous with PPI).
1967
- *
1968
- * This is only relevant for new scenes that are created in the editor. Loaded scenes will use the
1969
- * value stored in their serialization file.
1970
- */
1971
- dpi: number;
1972
- /**
1973
- * A scale factor that is applied to the final export resolution.
1974
- *
1975
- * This is only relevant for new scenes that are created in the editor. Loaded scenes will use the
1976
- * value stored in their serialization file.
1977
- */
1978
- pixelScaleFactor: number;
1864
+ maskSpotColor?: SpotColor;
1865
+ /**
1866
+ * The DPI value to use when exporting and when converting between pixels and inches or millimeter units.
1867
+ * (In the CESDK, this value is synonymous with PPI).
1868
+ *
1869
+ * This is only relevant for new scenes that are created in the editor. Loaded scenes will use the
1870
+ * value stored in their serialization file.
1871
+ */
1872
+ dpi: number;
1873
+ /**
1874
+ * A scale factor that is applied to the final export resolution.
1875
+ *
1876
+ * This is only relevant for new scenes that are created in the editor. Loaded scenes will use the
1877
+ * value stored in their serialization file.
1878
+ */
1879
+ pixelScaleFactor: number;
1979
1880
  };
1980
1881
 
1981
1882
  /**
1982
1883
  * @public
1983
1884
  */
1984
1885
  export declare class SceneAPI {
1985
- #private;
1986
-
1987
- /**
1988
- * Load the contents of a scene file.
1989
- * @param sceneContent - The scene file contents, a base64 string.
1990
- * @returns A handle to the loaded scene.
1991
- */
1992
- loadFromString(sceneContent: string): Promise<DesignBlockId>;
1993
- /**
1994
- * Load a scene from the URL to the scene file.
1995
- * The scene file will be fetched asynchronously by the engine. This requires continous `render`
1996
- * calls on this engines instance.
1997
- * @param url - The URL of the scene file.
1998
- * @returns scene A promise that resolves once the scene was loaded or rejects with an error otherwise.
1999
- */
2000
- loadFromURL(url: string): Promise<DesignBlockId>;
2001
- /**
2002
- * Serializes the current scene into a string. Selection is discarded.
2003
- * @returns A promise that resolves with a string on success or an error on failure.
2004
- */
2005
- saveToString(): Promise<string>;
2006
- /**
2007
- * Saves the current scene and all of its referenced assets into an archive.
2008
- * The archive contains all assets, that were accessible when this function was called.
2009
- * Blocks in the archived scene reference assets relative from to the location of the scene
2010
- * file. These references are resolved when loading such a scene via `loadSceneFromURL`.
2011
- *
2012
- * @returns A promise that resolves with a Blob on success or an error on failure.
2013
- */
2014
- saveToArchive(): Promise<Blob>;
2015
- /**
2016
- * Create a new scene, along with its own camera.
2017
- * @returns The scenes handle.
2018
- */
2019
- create(): DesignBlockId;
2020
- /**
2021
- * Loads the given image and creates a scene with a single page showing the image.
2022
- * Fetching the image may take an arbitrary amount of time, so the scene isn't immediately
2023
- * available.
2024
- * @param url - The image URL.
2025
- * @param dpi - The scenes DPI.
2026
- * @param pixelScaleFactor - The displays pixel scale factor.
2027
- * @returns A promise that resolves with the scene ID on success or rejected with an error otherwise.
2028
- */
2029
- createFromImage(
2030
- url: string,
2031
- dpi?: number,
2032
- pixelScaleFactor?: number
2033
- ): Promise<DesignBlockId>;
2034
- /**
2035
- * Return the currently active scene.
2036
- * @returns The scene or null, if none was created yet.
2037
- */
2038
- get(): DesignBlockId | null;
2039
- /**
2040
- * Applies the contents of the given template scene to the currently loaded scene.
2041
- * This loads the template scene while keeping the design unit and page dimensions
2042
- * of the current scene. Page contents remain centered when the pages are resized
2043
- * to fit the new dimensions.
2044
- * @param content - The template scene file contents, a base64 string.
2045
- * @returns A Promise that resolves once the template was applied or rejects if there was an error.
2046
- */
2047
- applyTemplateFromString(content: string): Promise<void>;
2048
- /**
2049
- * Applies the contents of the given template scene to the currently loaded scene.
2050
- * This loads the template scene while keeping the design unit and page dimensions
2051
- * of the current scene. Page contents remain centered when the pages are resized
2052
- * to fit the new dimensions.
2053
- * @param url - The url to the template scene file.
2054
- * @returns A Promise that resolves once the template was applied or rejects if there was an error.
2055
- */
2056
- applyTemplateFromURL(url: string): Promise<void>;
2057
- /**
2058
- * Converts all values of the current scene into the given design unit.
2059
- * @param designUnit - The new design unit of the scene
2060
- */
2061
- unstable_setDesignUnit(designUnit: DesignUnit): void;
2062
- /**
2063
- * Returns the design unit of the current scene.
2064
- * @returns The current design unit.
2065
- */
2066
- unstable_getDesignUnit(): DesignUnit;
1886
+ #private;
1887
+
1888
+ /**
1889
+ * Load the contents of a scene file.
1890
+ * @param sceneContent - The scene file contents, a base64 string.
1891
+ * @returns A handle to the loaded scene.
1892
+ */
1893
+ loadFromString(sceneContent: string): Promise<DesignBlockId>;
1894
+ /**
1895
+ * Load a scene from the URL to the scene file.
1896
+ * The scene file will be fetched asynchronously by the engine. This requires continuous `render`
1897
+ * calls on this engines instance.
1898
+ * @param url - The URL of the scene file.
1899
+ * @returns scene A promise that resolves once the scene was loaded or rejects with an error otherwise.
1900
+ */
1901
+ loadFromURL(url: string): Promise<DesignBlockId>;
1902
+ /**
1903
+ * Serializes the current scene into a string. Selection is discarded.
1904
+ * @returns A promise that resolves with a string on success or an error on failure.
1905
+ */
1906
+ saveToString(): Promise<string>;
1907
+ /**
1908
+ * Saves the current scene and all of its referenced assets into an archive.
1909
+ * The archive contains all assets, that were accessible when this function was called.
1910
+ * Blocks in the archived scene reference assets relative from to the location of the scene
1911
+ * file. These references are resolved when loading such a scene via `loadSceneFromURL`.
1912
+ *
1913
+ * @returns A promise that resolves with a Blob on success or an error on failure.
1914
+ */
1915
+ saveToArchive(): Promise<Blob>;
1916
+ /**
1917
+ * Create a new scene, along with its own camera.
1918
+ * @returns The scenes handle.
1919
+ */
1920
+ create(): DesignBlockId;
1921
+ /**
1922
+ * Loads the given image and creates a scene with a single page showing the image.
1923
+ * Fetching the image may take an arbitrary amount of time, so the scene isn't immediately
1924
+ * available.
1925
+ * @param url - The image URL.
1926
+ * @param dpi - The scenes DPI.
1927
+ * @param pixelScaleFactor - The displays pixel scale factor.
1928
+ * @returns A promise that resolves with the scene ID on success or rejected with an error otherwise.
1929
+ */
1930
+ createFromImage(url: string, dpi?: number, pixelScaleFactor?: number): Promise<DesignBlockId>;
1931
+ /**
1932
+ * Return the currently active scene.
1933
+ * @returns The scene or null, if none was created yet.
1934
+ */
1935
+ get(): DesignBlockId | null;
1936
+ /**
1937
+ * Applies the contents of the given template scene to the currently loaded scene.
1938
+ * This loads the template scene while keeping the design unit and page dimensions
1939
+ * of the current scene. Page contents remain centered when the pages are resized
1940
+ * to fit the new dimensions.
1941
+ * @param content - The template scene file contents, a base64 string.
1942
+ * @returns A Promise that resolves once the template was applied or rejects if there was an error.
1943
+ */
1944
+ applyTemplateFromString(content: string): Promise<void>;
1945
+ /**
1946
+ * Applies the contents of the given template scene to the currently loaded scene.
1947
+ * This loads the template scene while keeping the design unit and page dimensions
1948
+ * of the current scene. Page contents remain centered when the pages are resized
1949
+ * to fit the new dimensions.
1950
+ * @param url - The url to the template scene file.
1951
+ * @returns A Promise that resolves once the template was applied or rejects if there was an error.
1952
+ */
1953
+ applyTemplateFromURL(url: string): Promise<void>;
1954
+ /**
1955
+ * Converts all values of the current scene into the given design unit.
1956
+ * @param designUnit - The new design unit of the scene
1957
+ */
1958
+ unstable_setDesignUnit(designUnit: DesignUnit): void;
1959
+ /**
1960
+ * Returns the design unit of the current scene.
1961
+ * @returns The current design unit.
1962
+ */
1963
+ unstable_getDesignUnit(): DesignUnit;
2067
1964
  }
2068
1965
 
2069
1966
  /** @public */
2070
1967
  export declare interface Size2 {
2071
- width: number;
2072
- height: number;
1968
+ width: number;
1969
+ height: number;
2073
1970
  }
2074
1971
 
2075
1972
  /**
@@ -2083,9 +1980,9 @@ export declare type SizeMode = 'Absolute' | 'Percent' | 'Auto';
2083
1980
 
2084
1981
  /** @public */
2085
1982
  export declare interface SpotColor {
2086
- name: string;
2087
- rgbApproximation: RGBAColor;
2088
- cmykApproximation: CMYKColor;
1983
+ name: string;
1984
+ rgbApproximation: RGBAColor;
1985
+ cmykApproximation: CMYKColor;
2089
1986
  }
2090
1987
 
2091
1988
  /** @public */
@@ -2095,93 +1992,87 @@ export declare type StrokeCornerGeometry = 'Bevel' | 'Miter' | 'Round';
2095
1992
  export declare type StrokePosition = 'Center' | 'Inner' | 'Outer';
2096
1993
 
2097
1994
  /** @public */
2098
- export declare type StrokeStyle =
2099
- | 'Dashed'
2100
- | 'DashedRound'
2101
- | 'Dotted'
2102
- | 'LongDashed'
2103
- | 'LongDashedRound'
2104
- | 'Solid';
1995
+ export declare type StrokeStyle = 'Dashed' | 'DashedRound' | 'Dotted' | 'LongDashed' | 'LongDashedRound' | 'Solid';
2105
1996
 
2106
1997
  /** @public */
2107
1998
  declare type Subscription = number;
2108
1999
 
2109
2000
  /** @public */
2110
2001
  declare type TemplateDefinition = Preset & {
2111
- label: string;
2112
- scene: string | URL | (() => Promise<string>);
2113
- thumbnailURL?: string | URL;
2002
+ label: string;
2003
+ scene: string | URL | (() => Promise<string>);
2004
+ thumbnailURL?: string | URL;
2114
2005
  };
2115
2006
 
2116
2007
  /** @public */
2117
2008
  declare type TypefaceDefinition = Preset & {
2118
- family: string;
2119
- fonts: {
2120
- fontURL: string;
2121
- weight: FontWeight;
2122
- style: FontStyle;
2123
- }[];
2009
+ family: string;
2010
+ fonts: {
2011
+ fontURL: string;
2012
+ weight: FontWeight;
2013
+ style: FontStyle;
2014
+ }[];
2124
2015
  };
2125
2016
 
2126
2017
  /**
2127
2018
  * @public
2128
2019
  */
2129
2020
  export declare class VariableAPI {
2130
- #private;
2131
-
2132
- /**
2133
- * Get all text variables currently stored in the engine.
2134
- * @returns Return a list of variable names
2135
- */
2136
- findAll(): string[];
2137
- /**
2138
- * Set a text variable.
2139
- * @param key - The variable's key.
2140
- * @param value - The text to replace the variable with.
2141
- */
2142
- setString(key: string, value: string): void;
2143
- /**
2144
- * Set a text variable.
2145
- * @param key - The variable's key.
2146
- * @returns The text value of the variable.
2147
- */
2148
- getString(key: string): string;
2149
- /**
2150
- * Destroy a text variable.
2151
- * @param key - The variable's key.
2152
- */
2153
- remove(key: string): void;
2021
+ #private;
2022
+
2023
+ /**
2024
+ * Get all text variables currently stored in the engine.
2025
+ * @returns Return a list of variable names
2026
+ */
2027
+ findAll(): string[];
2028
+ /**
2029
+ * Set a text variable.
2030
+ * @param key - The variable's key.
2031
+ * @param value - The text to replace the variable with.
2032
+ */
2033
+ setString(key: string, value: string): void;
2034
+ /**
2035
+ * Set a text variable.
2036
+ * @param key - The variable's key.
2037
+ * @returns The text value of the variable.
2038
+ */
2039
+ getString(key: string): string;
2040
+ /**
2041
+ * Destroy a text variable.
2042
+ * @param key - The variable's key.
2043
+ */
2044
+ remove(key: string): void;
2154
2045
  }
2155
2046
 
2156
2047
  /** @public */
2157
2048
  declare type VariableDefinition = Preset & {
2158
- value: string | number;
2049
+ value: string | number;
2159
2050
  };
2160
2051
 
2161
2052
  /** @public */
2162
2053
  declare type Variables = {
2163
- [id: string]: VariableDefinition;
2054
+ [id: string]: VariableDefinition;
2164
2055
  };
2165
2056
 
2166
2057
  /** @public */
2167
2058
  export declare interface Vec2 {
2168
- x: number;
2169
- y: number;
2059
+ x: number;
2060
+ y: number;
2170
2061
  }
2171
2062
 
2172
2063
  /** @public */
2173
2064
  export declare interface Vec3 {
2174
- x: number;
2175
- y: number;
2176
- z: number;
2065
+ x: number;
2066
+ y: number;
2067
+ z: number;
2177
2068
  }
2178
2069
 
2179
2070
  /** @public */
2180
2071
  export declare interface Vec4 {
2181
- x: number;
2182
- y: number;
2183
- z: number;
2184
- w: number;
2072
+ x: number;
2073
+ y: number;
2074
+ z: number;
2075
+ w: number;
2185
2076
  }
2186
2077
 
2187
- export {};
2078
+ export { }