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