@cesdk/cesdk-js 1.4.5 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/.browserslistrc +4 -4
  2. package/ThirdPartyLicenses.md +59 -256
  3. package/assets/core/cesdk.data +0 -0
  4. package/assets/core/cesdk.wasm +0 -0
  5. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_ad1920_5_5_128.png +0 -0
  6. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_ancient_5_5_128.png +0 -0
  7. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_bw_5_5_128.png +0 -0
  8. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_chestnut_8_8_512.png +0 -0
  9. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_classic_5_5_128.png +0 -0
  10. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_colla_5_5_128.png +0 -0
  11. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_colorful_5_5_128.png +0 -0
  12. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_cottoncandy_5_5_128.png +0 -0
  13. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_creamy_5_5_128.png +0 -0
  14. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_dusty_5_5_128.png +0 -0
  15. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_fixie_8_8_512.png +0 -0
  16. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_flat_black_8_8_512.png +0 -0
  17. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_food_5_5_128.png +0 -0
  18. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_fridge_8_8_512.png +0 -0
  19. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_glam_5_5_128.png +0 -0
  20. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_gobblin_5_5_128.png +0 -0
  21. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_golden_5_5_128.png +0 -0
  22. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_green_gap_5_5_128.png +0 -0
  23. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_greyed_5_5_128.png +0 -0
  24. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_hard_stuff_8_8_512.png +0 -0
  25. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_highcarb_5_5_128.png +0 -0
  26. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_highcontrast_5_5_128.png +0 -0
  27. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_identity_5_5_128.png +0 -0
  28. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_inferno_8_8_512.png +0 -0
  29. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_joran_5_5_128.png +0 -0
  30. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_k1_5_5_128.png +0 -0
  31. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_k6_5_5_128.png +0 -0
  32. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_kalmen_5_5_128.png +0 -0
  33. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_keen_5_5_128.png +0 -0
  34. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_lemon_5_5_128.png +0 -0
  35. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_levante_5_5_128.png +0 -0
  36. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_litho_5_5_128.png +0 -0
  37. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_lomo100_5_5_128.png +0 -0
  38. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_low_fire_5_5_128.png +0 -0
  39. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_lucid_5_5_128.png +0 -0
  40. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_mellow_8_8_512.png +0 -0
  41. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_moss_5_5_128.png +0 -0
  42. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_neat_5_5_128.png +0 -0
  43. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_oldtimer_8_8_512.png +0 -0
  44. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_pale_5_5_128.png +0 -0
  45. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_pebble_5_5_128.png +0 -0
  46. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_pitched_5_5_128.png +0 -0
  47. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_polaroid_5_5_128.png +0 -0
  48. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_polasx_5_5_128.png +0 -0
  49. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_pro400_5_5_128.png +0 -0
  50. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_pumpkin_5_5_128.png +0 -0
  51. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_quozi_5_5_128.png +0 -0
  52. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_sepia_5_5_128.png +0 -0
  53. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_settled_5_5_128.png +0 -0
  54. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_seventies_5_5_128.png +0 -0
  55. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_snappy_5_5_128.png +0 -0
  56. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_soft_5_5_128.png +0 -0
  57. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_softly_5_5_128.png +0 -0
  58. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_solanus_5_5_128.png +0 -0
  59. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_steel_5_5_128.png +0 -0
  60. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_summer_5_5_128.png +0 -0
  61. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_sunny_70s_8_8_512.png +0 -0
  62. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_sunrise_5_5_128.png +0 -0
  63. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_tender_5_5_128.png +0 -0
  64. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_twilight_5_5_128.png +0 -0
  65. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_weathered_5_5_128.png +0 -0
  66. package/assets/extensions/ly.img.cesdk.filters.lut/LUTs/imgly_lut_zephyr_5_5_128.png +0 -0
  67. package/assets/extensions/ly.img.cesdk.fonts/fonts/imgly_font_abril_fatface_regular.ttf +0 -0
  68. package/assets/extensions/ly.img.cesdk.fonts/fonts/imgly_font_bungee_inline.ttf +0 -0
  69. package/assets/extensions/ly.img.cesdk.fonts/fonts/imgly_font_kumar_one_outline.otf +0 -0
  70. package/assets/extensions/ly.img.cesdk.fonts/fonts/imgly_font_permanent_marker.ttf +0 -0
  71. package/assets/extensions/ly.img.cesdk.fonts/fonts/imgly_font_petit_formal_script.ttf +0 -0
  72. package/assets/extensions/ly.img.cesdk.fonts/fonts/imgly_font_ultra.ttf +0 -0
  73. package/assets/extensions/ly.img.cesdk.fonts/manifest.json +2 -2
  74. package/assets/extensions/ly.img.cesdk.stickers.openmoji/genmoji.mjs +1 -108
  75. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/manifest.json +199 -0
  76. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/frame.png +0 -0
  77. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/halfcircle.png +0 -0
  78. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/organic1.png +0 -0
  79. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/organic2.png +0 -0
  80. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/organic3.png +0 -0
  81. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/organic4.png +0 -0
  82. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/organicdot1.png +0 -0
  83. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/organicdot2.png +0 -0
  84. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/quartercircle-outline.png +0 -0
  85. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/quartercircle.png +0 -0
  86. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/rectanglemask.png +0 -0
  87. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/roundmask.png +0 -0
  88. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/splash1.png +0 -0
  89. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/splash2.png +0 -0
  90. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/splash3.png +0 -0
  91. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/splash4.png +0 -0
  92. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/wiggle.png +0 -0
  93. package/assets/extensions/ly.img.cesdk.vectorpaths.abstract/thumbnails/ziczac.png +0 -0
  94. package/assets/extensions/ly.img.fonts/README.md +3 -0
  95. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Light-Web/Font-EULA.pdf +0 -0
  96. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Light-Web/Supply-Light.eot +0 -0
  97. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Light-Web/Supply-Light.otf +0 -0
  98. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Light-Web/Supply-Light.ttf +0 -0
  99. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Light-Web/Supply-Light.woff +0 -0
  100. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Light-Web/Supply-Light.woff2 +0 -0
  101. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Regular-Web/Font-EULA.pdf +0 -0
  102. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Regular-Web/Supply-Regular.eot +0 -0
  103. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Regular-Web/Supply-Regular.otf +0 -0
  104. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Regular-Web/Supply-Regular.ttf +0 -0
  105. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Regular-Web/Supply-Regular.woff +0 -0
  106. package/assets/extensions/ly.img.fonts/fonts/SupplyMono-Regular-Web/Supply-Regular.woff2 +0 -0
  107. package/assets/extensions/ly.img.fonts/manifest.json +24 -0
  108. package/assets/extensions/ly.img.fonts/preview.png +0 -0
  109. package/assets/i18n/de.json +76 -9
  110. package/assets/i18n/en.json +92 -25
  111. package/assets/ui/stylesheets/cesdk.css +40 -41
  112. package/cesdk-engine.umd.d.ts +1494 -38
  113. package/cesdk-engine.umd.js +1 -2
  114. package/cesdk.umd.js +1 -1
  115. package/index.d.ts +1798 -0
  116. package/index.html +3 -24
  117. package/package.json +2 -2
  118. package/BlockAPI.d.ts +0 -785
  119. package/SceneAPI.d.ts +0 -52
  120. package/VariableAPI.d.ts +0 -27
  121. package/api.d.ts +0 -11
  122. package/assets/extensions/ly.img.cesdk.fonts/fonts/imgly_font_kumar_one_outline.ttf +0 -0
  123. package/types.d.ts +0 -759
package/BlockAPI.d.ts DELETED
@@ -1,785 +0,0 @@
1
- type Vec2 = { x: number; y: number };
2
- type DesignBlockId = number;
3
- type DesignBlockType = string;
4
- type MimeType =
5
- | 'image/png'
6
- | 'image/jpeg'
7
- | 'image/x-tga'
8
- | 'application/octet-stream';
9
- type Size2 = {
10
- width: number;
11
- height: number;
12
- };
13
- type RGBA = [r: number, g: number, b: number, a: number];
14
-
15
- export enum PositionMode {
16
- /** Position in absolute design units. */
17
- Absolute = 'Absolute',
18
- /** Position in relation to the block's parent's size in percent, where 1.0 means 100%. */
19
- Percent = 'Percent',
20
- /** Position is automatically determined. */
21
- Undefined = 'Auto'
22
- }
23
-
24
- export enum SizeMode {
25
- /** Size in absolute design units. */
26
- Absolute = 'Absolute',
27
- /** Size in relation to the block's parent's size in percent, where 1.0 means 100%. */
28
- Percent = 'Percent',
29
- /** Size is determined by the block's content. */
30
- Auto = 'Auto'
31
- }
32
-
33
- export enum PropertyType {
34
- Bool = 'Bool',
35
- Int = 'Int',
36
- Float = 'Float',
37
- String = 'String',
38
- Color = 'Color',
39
- Enum = 'Enum',
40
- Struct = 'Struct'
41
- }
42
-
43
- export default class BlockAPI {
44
- /**
45
- * Exports a design block element as a file of the given mime type.
46
- * Performs an internal update to resolve the final layout for the blocks.
47
- * @param handle The design block element to export.
48
- * @param mimeType The mime type of the output file. Defaults to 'image/png'
49
- * @returns A promise that resolves with the exported image or is rejected with an error.
50
- */
51
- export(handle: DesignBlockId, mimeType?: MimeType): Promise<Blob>;
52
-
53
- /**
54
- * Loads existing blocks from the given string.
55
- * The blocks are not attached by default and won't be visible until attached to a page or the scene.
56
- * @param content A string representing the given blocks.
57
- * @returns A promise that resolves with a list of handles representing the found blocks or an error.
58
- */
59
- loadFromString(content: string): Promise<DesignBlockId[]>;
60
-
61
- /**
62
- * Saves the given blocks into a string. If given the root of a block hierarchy, e.g. a
63
- * page with multiple children, the entire hierarchy is saved.
64
- * @param blocks
65
- * @returns A promise that resolves to a string representing the blocks or an error.
66
- */
67
- saveToString(blocks: DesignBlockId[]): Promise<string>;
68
-
69
- /**
70
- * Create a new block, fails if type is unknown.
71
- * @param type The type of the block that shall be created.
72
- * @returns The created blocks handle.
73
- */
74
- create(type: DesignBlockType): DesignBlockId;
75
-
76
- /**
77
-
78
- * Get the type of the given block, fails if the block is invalid.
79
- * @param id The block to query.
80
- * @returns The blocks type.
81
- */
82
- getType(id: DesignBlockId): DesignBlockType;
83
-
84
- /**
85
- * Update the selection state of a block.
86
- * Fails for invalid blocks.
87
- * @param id The block to query.
88
- * @param selected Whether or not the block should be selected.
89
- */
90
- setSelected(id: DesignBlockId, selected: boolean): void;
91
-
92
- /**
93
- * Get the selected state of a block.
94
- * @param id The block to query.
95
- * @returns True if the block is selected, false otherwise.
96
- */
97
- isSelected(id: DesignBlockId): boolean;
98
-
99
- /**
100
- * Get all currently selected blocks.
101
- * @returns An array of block ids.
102
- */
103
- findAllSelected(): DesignBlockId[];
104
-
105
- /** Checks whether the given block references any variables. Doesn't check the blocks children.
106
- *
107
- * @param block The block to inspect.
108
- * @return true if the block references variables and false otherwise.
109
- */
110
- referencesAnyVariables(id: DesignBlockId): boolean;
111
-
112
- /**
113
- * Update a block's name.
114
- * @param id The block to update.
115
- * @param name The name to set.
116
- */
117
- setName(id: DesignBlockId, name: string): void;
118
-
119
- /**
120
- * Get a block's name.
121
- * @param id The block to update.
122
- */
123
- getName(id: DesignBlockId): string;
124
-
125
- /**
126
- * Finds all blocks with the given name.
127
- * @param name The name to search for.
128
- * @returns A list of block ids.
129
- */
130
- findByName(name: string): DesignBlockId[];
131
-
132
- /**
133
- * Finds all blocks with the given type.
134
- * @param type The type to search for.
135
- * @returns A list of block ids.
136
- */
137
- findByType(type: DesignBlockType): DesignBlockId[];
138
-
139
- /**
140
- * Return all blocks currently known to the engine.
141
- * @returns A list of block ids.
142
- */
143
- findAll(): /* filterSpec?: unknown */ DesignBlockId[];
144
-
145
- // Element
146
-
147
- /**
148
- * Query a block's visibility.
149
- * @param id The block to query.
150
- * @returns True if visible, false otherwise.
151
- */
152
- isVisible(id: DesignBlockId): boolean;
153
-
154
- /**
155
- * Update a block's visibility.
156
- * @param id The block to update.
157
- * @param visible Whether the block shall be visible.
158
- */
159
- setVisible(id: DesignBlockId, visible: boolean): void;
160
-
161
- /**
162
- * Query a block's x position.
163
- * @param id The block to query.
164
- * @returns The value of the x position.
165
- */
166
- getPositionX(id: DesignBlockId): number;
167
-
168
- /**
169
- * Query a block's mode for its x position.
170
- * @param id The block to query.
171
- * @returns The current mode for the x position: absolute, percent or undefined.
172
- */
173
- getPositionXMode(id: DesignBlockId): PositionMode;
174
-
175
- /**
176
- * Query a block's y position.
177
- * @param id The block to query.
178
- * @returns The value of the y position.
179
- */
180
- getPositionY(id: DesignBlockId): number;
181
-
182
- /**
183
- * Query a block's mode for its y position.
184
- * @param id The block to query.
185
- * @returns The current mode for the y position: absolute, percent or undefined.
186
- */
187
- getPositionYMode(id: DesignBlockId): PositionMode;
188
-
189
- /**
190
- * Update a block's x position.
191
- * @param id The block to update.
192
- * @param value The value of the x position.
193
- */
194
- setPositionX(id: DesignBlockId, value: number): void;
195
-
196
- /**
197
- * Set a block's mode for its x position.
198
- * @param id The block to update.
199
- * @param mode The x position mode: absolute, percent or undefined.
200
- */
201
- setPositionXMode(id: DesignBlockId, mode: PositionMode): void;
202
-
203
- /**
204
- * Update a block's y position.
205
- * @param id The block to update.
206
- * @param value The value of the y position.
207
- */
208
- setPositionY(id: DesignBlockId, value: number): void;
209
-
210
- /**
211
- * Set a block's mode for its y position.
212
- * @param id The block to update.
213
- * @param mode The y position mode: absolute, percent or undefined.
214
- */
215
- setPositionYMode(id: DesignBlockId, mode: PositionMode): void;
216
-
217
- /**
218
- * Query a block's rotation in radians.
219
- * @param id The block to query.
220
- * @returns The block's rotation around its center in radians.
221
- */
222
- getRotation(id: DesignBlockId): number;
223
-
224
- /**
225
- * Update a block's rotation.
226
- * @param id The block to update.
227
- * @param radians The new rotation in radians. Rotation is applied around the block's center.
228
- */
229
- setRotation(id: DesignBlockId, radians: number): void;
230
-
231
- /**
232
- * Query a block's horizontal flip state.
233
- * @param id The block to query.
234
- * @returns A boolean indicating for whether the block is flipped in the queried direction
235
- */
236
- getFlipHorizontal(id: DesignBlockId): boolean;
237
-
238
- /**
239
- * Query a block's vertical flip state.
240
- * @param id The block to query.
241
- * @returns A boolean indicating for whether the block is flipped in the queried direction
242
- */
243
- getFlipVertical(id: DesignBlockId): boolean;
244
-
245
- /**
246
- * Update a block's horizontal flip.
247
- * @param id The block to update.
248
- * @param horizontal Whether the block should be flipped along its x-axis.
249
- */
250
- setFlipHorizontal(id: DesignBlockId, flip: boolean): void;
251
-
252
- /**
253
- * Update a block's vertical flip.
254
- * @param id The block to update.
255
- * @param vertical Whether the block should be flipped along its y-axis.
256
- */
257
- setFlipVertical(id: DesignBlockId, flip: boolean): void;
258
-
259
- /**
260
- * Query a block's width.
261
- * @param id The block to query.
262
- * @returns The value of the block's width.
263
- */
264
- getWidth(id: DesignBlockId): number;
265
-
266
- /**
267
- * Query a block's mode for its width.
268
- * @param id The block to query.
269
- * @returns The current mode for the width: absolute, percent or auto.
270
- */
271
- getWidthMode(id: DesignBlockId): SizeMode;
272
-
273
- /**
274
- * Query a block's height.
275
- * @param id The block to query.
276
- * @returns The value of the block's height.
277
- */
278
- getHeight(id: DesignBlockId): number;
279
-
280
- /**
281
- * Query a block's mode for its height.
282
- * @param id The block to query.
283
- * @returns The current mode for the height: absolute, percent or auto.
284
- */
285
- getHeightMode(id: DesignBlockId): SizeMode;
286
-
287
- /**
288
- * Update a block's width.
289
- * @param id The block to update.
290
- * @param value The new width of the block.
291
- */
292
- setWidth(id: DesignBlockId, value: number): void;
293
-
294
- /**
295
- * Set a block's mode for its width.
296
- * @param id The block to update.
297
- * @param mode The width mode: absolute, percent or auto.
298
- */
299
- setWidthMode(id: DesignBlockId, mode: SizeMode): void;
300
-
301
- /**
302
- * Update a block's height.
303
- * @param id The block to update.
304
- * @param value The new height of the block.
305
- */
306
- setHeight(id: DesignBlockId, value: number): void;
307
-
308
- /**
309
- * Set a block's mode for its height.
310
- * @param id The block to update.
311
- * @param mode The height mode: absolute, percent or auto.
312
- */
313
- setHeightMode(id: DesignBlockId, mode: SizeMode): void;
314
-
315
- /**
316
- * Get a block's layouted width. Requires an `engine.render()` beforehand.
317
- * @param id The block to query.
318
- * @returns The layouted width.
319
- */
320
- getFrameWidth(id: DesignBlockId): number;
321
-
322
- /**
323
- * Get a block's layouted height. Requires an `engine.render()` beforehand.
324
- * @param id The block to query.
325
- * @returns The layouted height.
326
- */
327
- getFrameHeight(id: DesignBlockId): number;
328
-
329
- /**
330
- * Duplicates a block including its children.
331
- * @param id The block to duplicate.
332
- * @returns The handle of the duplicate.
333
- */
334
- duplicate(id: DesignBlockId): DesignBlockId;
335
-
336
- /**
337
- * Destroys a block.
338
- * @param id The block to destroy.
339
- */
340
- destroy(id: DesignBlockId): void;
341
-
342
- /**
343
- * Query a block's parent.
344
- * @param id The block to query.
345
- * @returns The parent's handle.
346
- */
347
- getParent(id: DesignBlockId): DesignBlockId;
348
-
349
- /**
350
- * Get all children of the given block. Children
351
- * are sorted in their rendering order: Last child is rendered
352
- * in front of other children.
353
- * @param id The block to query.
354
- * @returns A list of block ids.
355
- */
356
- getChildren(id: DesignBlockId): DesignBlockId[];
357
-
358
- /**
359
- * Insert a new or existing child at a certain position in the parent's children.
360
- * @param parent The block whose children should be updated.
361
- * @param child The child to insert. Can be an existing child of `parent`.
362
- * @param index The index to insert or move to.
363
- */
364
- insertChild(parent: DesignBlockId, child: DesignBlockId, index: number): void;
365
-
366
- /**
367
- * Appends a new or existing child to a block's children.
368
- * @param parent The block whose children should be updated.
369
- * @param child The child to insert. Can be an existing child of `parent`.
370
- */
371
- appendChild(parent: DesignBlockId, child: DesignBlockId): void;
372
-
373
- /**
374
- * Get the x position of the block's axis-aligned bounding box in the scene's global coordinate space.
375
- * The scene's global coordinate space has its position at the top left.
376
- * @param id The block whose bounding box should be calculated.
377
- * @return UBQResult<float> The x coordinate of the position of the axis-aligned bounding box.
378
- */
379
- getGlobalBoundingBoxX(id: DesignBlockId): number;
380
-
381
- /**
382
- * Get the y position of the block's axis-aligned bounding box in the scene's global coordinate space.
383
- * The scene's global coordinate space has its position at the top left.
384
- * @param id The block whose bounding box should be calculated.
385
- * @return UBQResult<float> The y coordinate of the position of the axis-aligned bounding box.
386
- */
387
- getGlobalBoundingBoxY(id: DesignBlockId): number;
388
-
389
- /**
390
- * Get the width of the block's axis-aligned bounding box in the scene's global coordinate space.
391
- * The scene's global coordinate space has its position at the top left.
392
- * @param id The block whose bounding box should be calculated.
393
- * @return UBQResult<float> The width of the axis-aligned bounding box.
394
- */
395
- getGlobalBoundingBoxWidth(id: DesignBlockId): number;
396
-
397
- /**
398
- * Get the height of the block's axis-aligned bounding box in the scene's global coordinate space.
399
- * The scene's global coordinate space has its position at the top left.
400
- * @param id The block whose bounding box should be calculated.
401
- * @return UBQResult<float> The height of the axis-aligned bounding box.
402
- */
403
- getGlobalBoundingBoxHeight(id: DesignBlockId): number;
404
-
405
- /**
406
- * Get all available properties of a block.
407
- * @param id The block whose properties should be queried.
408
- * @returns A list of the property names.
409
- */
410
- findAllProperties(id: DesignBlockId): string[];
411
-
412
- /**
413
- * Get the type of a property given its name.
414
- * @param property The name of the property whose type should be queried.
415
- * @returns The property type.
416
- */
417
- getPropertyType(property: string): PropertyType;
418
-
419
- /**
420
- * Get all the possible values of an enum given an enum property.
421
- * @param enumProperty The name of the property whose enum values should be queried.
422
- * @returns A list of the enum value names as string.
423
- */
424
- getEnumValues<T = string>(enumProperty: string): T[];
425
-
426
- /**
427
- * Set a bool property of the given design block to the given value.
428
- * @param id The block whose property should be set.
429
- * @param property The name of the property to set.
430
- * @param value The value to set.
431
- */
432
- setBool(id: DesignBlockId, property: string, value: boolean): void;
433
-
434
- /**
435
- * Get the value of a bool property of the given design block.
436
- * @param id The block whose property should be queried.
437
- * @param property The name of the property to query.
438
- * @returns The value of the property.
439
- */
440
- getBool(id: DesignBlockId, property: string): boolean;
441
-
442
- /**
443
- * Set an int property of the given design block to the given value.
444
- * @param id The block whose property should be set.
445
- * @param property The name of the property to set.
446
- * @param value The value to set.
447
- */
448
- setInt(id: DesignBlockId, property: string, value: number): void;
449
-
450
- /**
451
- * Get the value of an int property of the given design block.
452
- * @param id The block whose property should be queried.
453
- * @param property The name of the property to query.
454
- * @returns The value of the property.
455
- */
456
- getInt(id: DesignBlockId, property: string): number;
457
-
458
- /**
459
- * Set a float property of the given design block to the given value.
460
- * @param id The block whose property should be set.
461
- * @param property The name of the property to set.
462
- * @param value The value to set.
463
- */
464
- setFloat(id: DesignBlockId, property: string, value: number): void;
465
-
466
- /**
467
- * Get the value of a float property of the given design block.
468
- * @param id The block whose property should be queried.
469
- * @param property The name of the property to query.
470
- * @returns The value of the property.
471
- */
472
- getFloat(id: DesignBlockId, property: string): number;
473
-
474
- /**
475
- * Set a string property of the given design block to the given value.
476
- * @param id The block whose property should be set.
477
- * @param property The name of the property to set.
478
- * @param value The value to set.
479
- */
480
- setString(id: DesignBlockId, property: string, value: string): void;
481
-
482
- /**
483
- * Get the value of a string property of the given design block.
484
- * @param id The block whose property should be queried.
485
- * @param property The name of the property to query.
486
- * @returns The value of the property.
487
- */
488
- getString(id: DesignBlockId, property: string): string;
489
-
490
- /**
491
- * Set a color property of the given design block to the given value.
492
- * @param id The block whose property should be set.
493
- * @param property The name of the property to set.
494
- * @param r The red color component in the range of 0 to 1.
495
- * @param g The green color component in the range of 0 to 1.
496
- * @param b The blue color component in the range of 0 to 1.
497
- * @param a The alpha color component in the range of 0 to 1.
498
- */
499
- setColorRGBA(
500
- id: DesignBlockId,
501
- property: string,
502
- r: number,
503
- g: number,
504
- b: number,
505
- a: number
506
- ): void;
507
-
508
- /**
509
- * Get the value of a string property of the given design block.
510
- * @param id The block whose property should be queried.
511
- * @param property The name of the property to query.
512
- * @returns A tuple of channels red, green, blue and alpha in the range of 0 to 1.
513
- */
514
- getColorRGBA(id: DesignBlockId, property: string): RGBA;
515
-
516
- /**
517
- * Set an enum property of the given design block to the given value.
518
- * @param block The block whose property should be set.
519
- * @param property The name of the property to set.
520
- * @param value The enum value as string.
521
- */
522
- setEnum(id: DesignBlockId, property: string, value: string): void;
523
-
524
- /**
525
- * Get the value of an enum property of the given design block.
526
- * @param block The block whose property should be queried.
527
- * @param property The name of the property to query.
528
- * @returns The value as string.
529
- */
530
- getEnum(id: DesignBlockId, property: string): string;
531
-
532
- /**
533
- * Query if the given block has crop properties.
534
- * @param id The block to query.
535
- * @returns true, if the block has crop properties.
536
- */
537
- hasCrop(id: DesignBlockId): boolean;
538
-
539
- /**
540
- * Set the crop scale in x direction of the given design block.
541
- * @param id The block whose crop should be set.
542
- * @param scaleX The scale in x direction.
543
- */
544
- setCropScaleX(id: DesignBlockId, scaleX: number): void;
545
-
546
- /**
547
- * Set the crop scale in y direction of the given design block.
548
- * @param id The block whose crop should be set.
549
- * @param scaleY The scale in y direction.
550
- */
551
- setCropScaleY(id: DesignBlockId, scaleY: number): void;
552
-
553
- /**
554
- * Set the crop rotation of the given design block.
555
- * @param id The block whose crop should be set.
556
- * @param rotation The rotation in radians.
557
- */
558
- setCropRotation(id: DesignBlockId, rotation: number): void;
559
-
560
- /**
561
- * Set the crop translation in x direction of the given design block.
562
- * @param id The block whose crop should be set.
563
- * @param translationY The translation in x direction.
564
- */
565
- setCropTranslationX(id: DesignBlockId, translationX: number): void;
566
-
567
- /**
568
- * Set the crop translation in y direction of the given design block.
569
- * @param id The block whose crop should be set.
570
- * @param translationY The translation in y direction.
571
- */
572
- setCropTranslationY(id: DesignBlockId, translationY: number): void;
573
-
574
- /**
575
- * Resets the manually set crop of the given design block.
576
- * The block's content fill mode is set to 'cover'.
577
- * @param id The block whose crop should be reset.
578
- */
579
- resetCrop(id: DesignBlockId): void;
580
-
581
- /**
582
- * Get the crop scale on the x axis of the given design block.
583
- * @param id The block whose scale should be queried.
584
- * @returns The scale on the x axis.
585
- */
586
- getCropScaleX(id: DesignBlockId): number;
587
-
588
- /**
589
- * Get the crop scale on the y axis of the given design block.
590
- * @param id The block whose scale should be queried.
591
- * @returns The scale on the y axis.
592
- */
593
- getCropScaleY(id: DesignBlockId): number;
594
-
595
- /**
596
- * Get the crop rotation of the given design block.
597
- * @param id The block whose crop rotation should be queried.
598
- * @returns The crop rotation.
599
- */
600
- getCropRotation(id: DesignBlockId): number;
601
-
602
- /**
603
- * Get the crop translation on the x axis of the given design block.
604
- * @param id The block whose translation should be queried.
605
- * @returns The translation on the x axis.
606
- */
607
- getCropTranslationX(id: DesignBlockId): number;
608
-
609
- /**
610
- * Get the crop translation on the y axis of the given design block.
611
- * @param id The block whose translation should be queried.
612
- * @returns The translation on the y axis.
613
- */
614
- getCropTranslationY(id: DesignBlockId): number;
615
-
616
- /**
617
- * Query if the given block has an opacity.
618
- * @param id The block to query.
619
- * @returns true, if the block has an opcity.
620
- */
621
- hasOpacity(id: DesignBlockId): boolean;
622
-
623
- /**
624
- * Set the opacity of the given design block.
625
- * @param id The block whose opacity should be set.
626
- * @param opacity The opacity to be set. The valid range is 0 to 1.
627
- */
628
- setOpacity(id: DesignBlockId, opacity: number): void;
629
-
630
- /**
631
- * Get the opacity of the given design block.
632
- * @param id The block whose opacity should be queried.
633
- * @returns The opacity in a range of 0 to 1.
634
- */
635
- getOpacity(id: DesignBlockId): number;
636
-
637
- /**
638
- * Query if the given block has fill color properties.
639
- * @param id The block to query.
640
- * @returns true, if the block has fill color properties.
641
- */
642
- hasFillColor(id: DesignBlockId): boolean;
643
-
644
- /**
645
- * Set the fill color of the given design block.
646
- * @param id The block whose fill color should be set.
647
- * @param color The fill color to be set, a tuple of
648
- * @param r The red color component in the range of 0 to 1.
649
- * @param g The green color component in the range of 0 to 1.
650
- * @param b The blue color component in the range of 0 to 1.
651
- * @param a The alpha color component in the range of 0 to 1.
652
- */
653
- setFillColorRGBA(
654
- id: DesignBlockId,
655
- r: number,
656
- g: number,
657
- b: number,
658
- a: number
659
- ): void;
660
-
661
- /**
662
- * Get the fill color of the given design block.
663
- * @param id The block whose fill color should be queried.
664
- * @returns The fill color.
665
- */
666
- getFillColorRGBA(id: DesignBlockId): RGBA;
667
-
668
- /**
669
- * Enable or disable the fill of the given design block.
670
- * @param id The block whose fill should be enabled or disabled.
671
- * @param enabled If true, the fill will be enabled.
672
- */
673
- setFillColorEnabled(id: DesignBlockId, enabled: boolean): void;
674
-
675
- /**
676
- * Query if the fill of the given design block is enabled.
677
- * @param id The block whose fill state should be queried.
678
- * @returns True, if fill is enabled.
679
- */
680
- isFillColorEnabled(id: DesignBlockId): boolean;
681
-
682
- /**
683
- * Query if the given block has background color properties.
684
- * @param id The block to query.
685
- * @returns true, if the block has background color properties.
686
- */
687
- hasBackgroundColor(id: DesignBlockId): boolean;
688
-
689
- /**
690
- * Set the background color of the given design block.
691
- * @param id The block whose background color should be set.
692
- * @param color The background color to be set, a tuple of
693
- * @param r The red color component in the range of 0 to 1.
694
- * @param g The green color component in the range of 0 to 1.
695
- * @param b The blue color component in the range of 0 to 1.
696
- * @param a The alpha color component in the range of 0 to 1.
697
- */
698
- setBackgroundColorRGBA(
699
- id: DesignBlockId,
700
- r: number,
701
- g: number,
702
- b: number,
703
- a: number
704
- ): void;
705
-
706
- /**
707
- * Get the background color of the given design block.
708
- * @param id The block whose background color should be queried.
709
- * @returns The background color.
710
- */
711
- getBackgroundColorRGBA(id: DesignBlockId): RGBA;
712
-
713
- /**
714
- * Enable or disable the background of the given design block.
715
- * @param id The block whose background should be enabled or disabled.
716
- * @param enabled If true, the background will be enabled.
717
- */
718
- setBackgroundColorEnabled(id: DesignBlockId, enabled: boolean): void;
719
-
720
- /**
721
- * Query if the background of the given design block is enabled.
722
- * @param id The block whose background state should be queried.
723
- * @returns True, if background is enabled.
724
- */
725
- isBackgroundColorEnabled(id: DesignBlockId): boolean;
726
-
727
- /**
728
- * Query if the given block has outline properties.
729
- * @param id The block to query.
730
- * @returns true, if the block has outline properties.
731
- */
732
- hasOutline(id: DesignBlockId): boolean;
733
-
734
- /**
735
- * Set the outline color of the given design block.
736
- * @param id The block whose outline color should be set.
737
- * @param color The outline color to be set, a tuple of
738
- * @param r The red color component in the range of 0 to 1.
739
- * @param g The green color component in the range of 0 to 1.
740
- * @param b The blue color component in the range of 0 to 1.
741
- * @param a The alpha color component in the range of 0 to 1.
742
- */
743
- setOutlineColorRGBA(
744
- id: DesignBlockId,
745
- r: number,
746
- g: number,
747
- b: number,
748
- a: number
749
- ): void;
750
-
751
- /**
752
- * Get the outline color of the given design block.
753
- * @param id The block whose outline color should be queried.
754
- * @returns The outline color.
755
- */
756
- getOutlineColorRGBA(id: DesignBlockId): RGBA;
757
-
758
- /**
759
- * Enable or disable the outline of the given design block.
760
- * @param id The block whose outline should be enabled or disabled.
761
- * @param enabled If true, the outline will be enabled.
762
- */
763
- setOutlineEnabled(id: DesignBlockId, enabled: boolean): void;
764
-
765
- /**
766
- * Query if the outline of the given design block is enabled.
767
- * @param id The block whose outline state should be queried.
768
- * @returns True, if outline is enabled.
769
- */
770
- isOutlineEnabled(id: DesignBlockId): boolean;
771
-
772
- /**
773
- * Set the outline width of the given design block.
774
- * @param id The block whose outline width should be set.
775
- * @param width The outline width to be set.
776
- */
777
- setOutlineWidth(id: DesignBlockId, width: number): void;
778
-
779
- /**
780
- * Get the outline width of the given design block.
781
- * @param id The block whose outline width should be queried.
782
- * @returns The outline width.
783
- */
784
- getOutlineWidth(id: DesignBlockId): number;
785
- }