@cesdk/engine 1.7.0-alpha.3 → 1.7.0-rc.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/index.d.ts +262 -123
- package/index.js +1 -1
- package/package.json +1 -1
package/assets/core/cesdk.data
CHANGED
|
Binary file
|
package/assets/core/cesdk.wasm
CHANGED
|
Binary file
|
package/index.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export declare interface Asset {
|
|
|
11
11
|
*/
|
|
12
12
|
id: string;
|
|
13
13
|
/** E.g. `ly.img.image` */
|
|
14
|
-
type: string;
|
|
15
14
|
/** Groups of the asset. */
|
|
16
15
|
groups?: Groups;
|
|
17
16
|
/** URI to a thumbnail of the asset used e.g. in the content library UI */
|
|
@@ -21,6 +20,7 @@ export declare interface Asset {
|
|
|
21
20
|
meta?: {
|
|
22
21
|
uri?: string;
|
|
23
22
|
filename?: string;
|
|
23
|
+
vectorPath?: string;
|
|
24
24
|
} & Record<string, unknown>;
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -45,57 +45,46 @@ export declare class AssetAPI {
|
|
|
45
45
|
* @returns A list with the IDs of all registered asset sources.
|
|
46
46
|
*/
|
|
47
47
|
findAllSources(): string[];
|
|
48
|
-
/**
|
|
49
|
-
* Finds all asset sources which support the given asset type.
|
|
50
|
-
* @returns A list of the IDs of the supported asset sources.
|
|
51
|
-
*/
|
|
52
|
-
findSourcesByType(type: string): string[];
|
|
53
48
|
/**
|
|
54
49
|
* Finds assets of a given type in a specific asset source.
|
|
55
|
-
* @param
|
|
56
|
-
* @param type - The asset type to look for.
|
|
50
|
+
* @param sourceId - The ID of the asset source.
|
|
57
51
|
* @param query - All the options to filter the search results by.
|
|
58
52
|
* @returns The search results.
|
|
59
53
|
*/
|
|
60
|
-
|
|
54
|
+
findAssets(sourceId: string, query: AssetQueryData): Promise<AssetsQueryResult>;
|
|
61
55
|
/**
|
|
62
56
|
* Queries the asset source's groups for a certain asset type.
|
|
63
57
|
* @param id - The ID of the asset source.
|
|
64
|
-
* @param type - The asset type to filter by.
|
|
65
58
|
* @returns The asset groups.
|
|
66
59
|
*/
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Queries the asset source's supported asset types.
|
|
70
|
-
* @param id - The ID of the asset source.
|
|
71
|
-
* @returns A list of the asset source's supported types.
|
|
72
|
-
*/
|
|
73
|
-
getTypesInSource(id: string): string[];
|
|
74
|
-
/**
|
|
75
|
-
* Checks whether the asset source supports the given asset type.
|
|
76
|
-
* @param id - The ID of the asset source.
|
|
77
|
-
* @param type - The asset type to check.
|
|
78
|
-
* @returns A boolean indicating whether the type is supported.
|
|
79
|
-
*/
|
|
80
|
-
hasTypeInSource(id: string, type: string): boolean;
|
|
60
|
+
getGroups(id: string): Promise<string[]>;
|
|
81
61
|
/**
|
|
82
62
|
* Queries the asset source's credits info.
|
|
83
|
-
* @param
|
|
63
|
+
* @param sourceId - The ID of the asset source.
|
|
84
64
|
* @returns The asset source's credits info consisting of a name and an optional URL.
|
|
85
65
|
*/
|
|
86
|
-
|
|
66
|
+
getCredits(sourceId: string): {
|
|
87
67
|
name: string;
|
|
88
68
|
url: string | undefined;
|
|
89
69
|
} | undefined;
|
|
90
70
|
/**
|
|
91
71
|
* Queries the asset source's license info.
|
|
92
|
-
* @param
|
|
72
|
+
* @param sourceId - The ID of the asset source.
|
|
93
73
|
* @returns The asset source's license info consisting of a name and an optional URL.
|
|
94
74
|
*/
|
|
95
|
-
|
|
75
|
+
getLicense(sourceId: string): {
|
|
96
76
|
name: string;
|
|
97
77
|
url: string | undefined;
|
|
98
78
|
} | undefined;
|
|
79
|
+
canManageAssets(sourceId: string): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Apply an asset result to the active scene.
|
|
82
|
+
* The default behavior will instantiate a block and configure it according to the asset's properties.
|
|
83
|
+
* Note that this can be overridden by providing an `applyAsset` function when adding the asset source.
|
|
84
|
+
* @param sourceId - The ID of the asset source.
|
|
85
|
+
* @param assetResult - A single assetResult of a `findAssets` query.
|
|
86
|
+
*/
|
|
87
|
+
apply(sourceId: string, assetResult: AssetResult): Promise<void>;
|
|
99
88
|
}
|
|
100
89
|
|
|
101
90
|
/**
|
|
@@ -183,8 +172,6 @@ export declare interface AssetResult extends Asset {
|
|
|
183
172
|
declare interface AssetResult_2 {
|
|
184
173
|
/** A unique id of this asset */
|
|
185
174
|
id: string;
|
|
186
|
-
/** E.g. `ly.img.image` */
|
|
187
|
-
type: string;
|
|
188
175
|
/** URI to a thumbnail of the asset used e.g. in the content library UI */
|
|
189
176
|
thumbUri: string;
|
|
190
177
|
/** Original size of the asset. */
|
|
@@ -224,21 +211,6 @@ declare interface AssetResultContext {
|
|
|
224
211
|
createdByRole: string;
|
|
225
212
|
}
|
|
226
213
|
|
|
227
|
-
declare interface AssetResultCredits {
|
|
228
|
-
name: string;
|
|
229
|
-
url: string;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
declare interface AssetResultLicense {
|
|
233
|
-
name: string;
|
|
234
|
-
url: string;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
declare interface AssetResultUtm {
|
|
238
|
-
source: string;
|
|
239
|
-
medium: string;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
214
|
/**
|
|
243
215
|
* A source of assets
|
|
244
216
|
* @public
|
|
@@ -247,13 +219,9 @@ export declare interface AssetSource {
|
|
|
247
219
|
/** The unique id of the API */
|
|
248
220
|
id: string;
|
|
249
221
|
/** Find all asset for the given type and the provided query data. */
|
|
250
|
-
findAssets(
|
|
251
|
-
/**
|
|
252
|
-
getGroups: (
|
|
253
|
-
/** Return all registered/available types */
|
|
254
|
-
getTypes: () => string[];
|
|
255
|
-
/** The given type is registered. */
|
|
256
|
-
hasType: (type: string) => boolean;
|
|
222
|
+
findAssets(queryData: AssetQueryData): Promise<AssetsQueryResult>;
|
|
223
|
+
/** Return every available group */
|
|
224
|
+
getGroups: () => Promise<string[]>;
|
|
257
225
|
/** Credits for the source/api */
|
|
258
226
|
credits?: {
|
|
259
227
|
name: string;
|
|
@@ -282,13 +250,18 @@ export declare interface AssetSource {
|
|
|
282
250
|
* error.
|
|
283
251
|
*/
|
|
284
252
|
canManageAssets?: boolean;
|
|
253
|
+
/**
|
|
254
|
+
* Apply the given asset result to the active scene.
|
|
255
|
+
* You can override this with custom behavior.
|
|
256
|
+
*/
|
|
257
|
+
applyAsset?: (asset: AssetResult) => Promise<void>;
|
|
285
258
|
/**
|
|
286
259
|
* Adds the given asset to this source. Throws an error if `canManageAssets`
|
|
287
260
|
* is `false`.
|
|
288
261
|
*
|
|
289
262
|
* @returns the id of the added asset
|
|
290
263
|
*/
|
|
291
|
-
addAsset(
|
|
264
|
+
addAsset(asset: AssetDefinition): Promise<string>;
|
|
292
265
|
/**
|
|
293
266
|
* Updates the asset of this source. Throws an error if `canManageAssets`
|
|
294
267
|
* is `false` or no asset with the given id could not be found.
|
|
@@ -309,10 +282,15 @@ export declare interface AssetSource {
|
|
|
309
282
|
* @public
|
|
310
283
|
*/
|
|
311
284
|
declare interface AssetSource_2 {
|
|
312
|
-
/** The asset types returned by this source. Will default to ['ly.img.image']. */
|
|
313
|
-
types?: string[];
|
|
314
285
|
/** Find all asset for the given type and the provided query data. */
|
|
315
|
-
findAssets(
|
|
286
|
+
findAssets(queryData?: QueryData): Promise<AssetsQueryResult_2 | undefined>;
|
|
287
|
+
/**
|
|
288
|
+
* Apply the given asset result to the active scene.
|
|
289
|
+
* You can override this with custom behavior.
|
|
290
|
+
*/
|
|
291
|
+
applyAsset?: (asset: AssetResult_2) => Promise<void>;
|
|
292
|
+
/** Return every available group */
|
|
293
|
+
getGroups?: () => Promise<string[]>;
|
|
316
294
|
/**
|
|
317
295
|
* Indicates if the asset shall be downloaded to handle the raw data instead
|
|
318
296
|
* of an URL reference. Do this if you do not want to depend on
|
|
@@ -412,6 +390,12 @@ export declare class BlockAPI {
|
|
|
412
390
|
* @returns The created blocks handle.
|
|
413
391
|
*/
|
|
414
392
|
create(type: DesignBlockType): DesignBlockId;
|
|
393
|
+
/**
|
|
394
|
+
* Create a new fill, fails if type is unknown.
|
|
395
|
+
* @param type - The type of the fill object that shall be created.
|
|
396
|
+
* @returns The created fill's handle.
|
|
397
|
+
*/
|
|
398
|
+
createFill(type: string): DesignBlockId;
|
|
415
399
|
|
|
416
400
|
/**
|
|
417
401
|
* Get the type of the given block, fails if the block is invalid.
|
|
@@ -616,12 +600,6 @@ export declare class BlockAPI {
|
|
|
616
600
|
* @returns true, if the block has a content fill mode.
|
|
617
601
|
*/
|
|
618
602
|
hasContentFillMode(id: DesignBlockId): boolean;
|
|
619
|
-
/**
|
|
620
|
-
* Query if the given block shows placeholder content.
|
|
621
|
-
* @param id - The block to query.
|
|
622
|
-
* @returns true, if the block shows placeholder content.
|
|
623
|
-
*/
|
|
624
|
-
hasPlaceholderContent(id: DesignBlockId): boolean;
|
|
625
603
|
/**
|
|
626
604
|
* Query a block's width.
|
|
627
605
|
* @param id - The block to query.
|
|
@@ -918,6 +896,12 @@ export declare class BlockAPI {
|
|
|
918
896
|
* @param rotation - The rotation in radians.
|
|
919
897
|
*/
|
|
920
898
|
setCropRotation(id: DesignBlockId, rotation: number): void;
|
|
899
|
+
/**
|
|
900
|
+
* Set the crop scale ratio of the given design block.
|
|
901
|
+
* @param id - The block whose crop should be set.
|
|
902
|
+
* @param scaleRatio - The crop scale ratio.
|
|
903
|
+
*/
|
|
904
|
+
setCropScaleRatio(id: DesignBlockId, scaleRatio: number): void;
|
|
921
905
|
/**
|
|
922
906
|
* Set the crop translation in x direction of the given design block.
|
|
923
907
|
* @param id - The block whose crop should be set.
|
|
@@ -954,6 +938,12 @@ export declare class BlockAPI {
|
|
|
954
938
|
* @returns The crop rotation.
|
|
955
939
|
*/
|
|
956
940
|
getCropRotation(id: DesignBlockId): number;
|
|
941
|
+
/**
|
|
942
|
+
* Get the crop scale ratio of the given design block.
|
|
943
|
+
* @param id - The block whose crop scale ratio should be queried.
|
|
944
|
+
* @returns The crop scale ratio.
|
|
945
|
+
*/
|
|
946
|
+
getCropScaleRatio(id: DesignBlockId): number;
|
|
957
947
|
/**
|
|
958
948
|
* Get the crop translation on the x axis of the given design block.
|
|
959
949
|
* @param id - The block whose translation should be queried.
|
|
@@ -966,6 +956,12 @@ export declare class BlockAPI {
|
|
|
966
956
|
* @returns The translation on the y axis.
|
|
967
957
|
*/
|
|
968
958
|
getCropTranslationY(id: DesignBlockId): number;
|
|
959
|
+
/**
|
|
960
|
+
* Adjust the crop position/scale to at least fill the crop frame.
|
|
961
|
+
* @param id - The block whose crop scale ratio should be queried.
|
|
962
|
+
* @param minScaleRatio - The minimal crop scale ratio to go down to.
|
|
963
|
+
*/
|
|
964
|
+
adjustCropToFillFrame(id: DesignBlockId, minScaleRatio: number): number;
|
|
969
965
|
/**
|
|
970
966
|
* Query if the given block has an opacity.
|
|
971
967
|
* @param id - The block to query.
|
|
@@ -1037,6 +1033,99 @@ export declare class BlockAPI {
|
|
|
1037
1033
|
* @returns True, if fill is enabled.
|
|
1038
1034
|
*/
|
|
1039
1035
|
isFillColorEnabled(id: DesignBlockId): boolean;
|
|
1036
|
+
/**
|
|
1037
|
+
* Create a new effect block, fails if type is unknown or not a valid effect block type.
|
|
1038
|
+
* @param type - The type id of the effect.
|
|
1039
|
+
* @returns The created effects handle.
|
|
1040
|
+
*/
|
|
1041
|
+
createEffect(type: string): DesignBlockId;
|
|
1042
|
+
/**
|
|
1043
|
+
* Queries whether the block supports effects.
|
|
1044
|
+
* @param id - The block to query.
|
|
1045
|
+
* @returns True, if the block can render effects, false otherwise.
|
|
1046
|
+
*/
|
|
1047
|
+
hasEffects(id: DesignBlockId): boolean;
|
|
1048
|
+
/**
|
|
1049
|
+
* Get a list of all effects attached to this block
|
|
1050
|
+
* @param id - The block to query.
|
|
1051
|
+
* @returns A list of effects or an error, if the block doesn't support effects.
|
|
1052
|
+
*/
|
|
1053
|
+
getEffects(id: DesignBlockId): DesignBlockId[];
|
|
1054
|
+
/**
|
|
1055
|
+
* Inserts an effect at the given index into the list of effects of the given block.
|
|
1056
|
+
* The same effect can appear multiple times in the list and won't be removed if appended again.
|
|
1057
|
+
* @param id - The block to update.
|
|
1058
|
+
* @param effectId - The effect to insert
|
|
1059
|
+
* @param index - The index at which the effect shall be inserted.
|
|
1060
|
+
*/
|
|
1061
|
+
insertEffect(id: DesignBlockId, effectId: DesignBlockId, index: number): void;
|
|
1062
|
+
/**
|
|
1063
|
+
* Inserts an effect at the end of the list of effects
|
|
1064
|
+
* The same effect can appear multiple times in the list and won't be removed if appended again.
|
|
1065
|
+
* @param id - The block to append the effect to.
|
|
1066
|
+
* @param effectId - The effect to append.
|
|
1067
|
+
*/
|
|
1068
|
+
appendEffect(id: DesignBlockId, effectId: DesignBlockId): void;
|
|
1069
|
+
/**
|
|
1070
|
+
* Removes the effect at the given index.
|
|
1071
|
+
* @param id - The block to remove the effect from.
|
|
1072
|
+
* @param index - The index where the effect is stored.
|
|
1073
|
+
*/
|
|
1074
|
+
removeEffect(id: DesignBlockId, index: number): void;
|
|
1075
|
+
/**
|
|
1076
|
+
* Checks whether an 'effect' block may be enabled and disabled.
|
|
1077
|
+
* @param effectId - The 'effect' block to query.
|
|
1078
|
+
* @returns True, if the block supports enabling and disabling, false otherwise.
|
|
1079
|
+
*/
|
|
1080
|
+
hasEffectEnabled(effectId: DesignBlockId): boolean;
|
|
1081
|
+
/**
|
|
1082
|
+
* Sets the enabled state of an 'effect' block.
|
|
1083
|
+
* @param effectId - The 'effect' block to update.
|
|
1084
|
+
* @param enabled - The new state.
|
|
1085
|
+
*/
|
|
1086
|
+
setEffectEnabled(effectId: DesignBlockId, enabled: boolean): void;
|
|
1087
|
+
/**
|
|
1088
|
+
* Queries whether an 'effect' block is enabled and therefore applies its effect.
|
|
1089
|
+
* @param effectId - The 'effect' block to query.
|
|
1090
|
+
* @returns True, if the effect is enabled. False otherwise.
|
|
1091
|
+
*/
|
|
1092
|
+
isEffectEnabled(effectId: DesignBlockId): boolean;
|
|
1093
|
+
/**
|
|
1094
|
+
* Create a new blur, fails if type is unknown or not a valid blur type.
|
|
1095
|
+
* @param type - The type id of the block.
|
|
1096
|
+
* @returns The handle of the newly created blur.
|
|
1097
|
+
*/
|
|
1098
|
+
createBlur(type: string): DesignBlockId;
|
|
1099
|
+
/**
|
|
1100
|
+
* Checks whether the block supports blur.
|
|
1101
|
+
* @param id - The block to query.
|
|
1102
|
+
* @returns True, if the block supports blur.
|
|
1103
|
+
*/
|
|
1104
|
+
hasBlur(id: DesignBlockId): boolean;
|
|
1105
|
+
/**
|
|
1106
|
+
* Connects `block`'s blur to the given `blur` block.
|
|
1107
|
+
* @param id - The block to update.
|
|
1108
|
+
* @param blurId - A 'blur' block.
|
|
1109
|
+
*/
|
|
1110
|
+
setBlur(id: DesignBlockId, blurId: DesignBlockId): void;
|
|
1111
|
+
/**
|
|
1112
|
+
* Get the 'blur' block of the given design block.
|
|
1113
|
+
* @param id - The block to query.
|
|
1114
|
+
* @returns The 'blur' block.
|
|
1115
|
+
*/
|
|
1116
|
+
getBlur(id: DesignBlockId): DesignBlockId;
|
|
1117
|
+
/**
|
|
1118
|
+
* Enable or disable the blur of the given design block.
|
|
1119
|
+
* @param id - The block to update.
|
|
1120
|
+
* @param enabled - The new enabled value.
|
|
1121
|
+
*/
|
|
1122
|
+
setBlurEnabled(id: DesignBlockId, enabled: boolean): void;
|
|
1123
|
+
/**
|
|
1124
|
+
* Query if blur is enabled for the given block.
|
|
1125
|
+
* @param id - The block to query.
|
|
1126
|
+
* @returns True, if the blur is enabled. False otherwise.
|
|
1127
|
+
*/
|
|
1128
|
+
isBlurEnabled(id: DesignBlockId): boolean;
|
|
1040
1129
|
/**
|
|
1041
1130
|
* Query if the given block has background color properties.
|
|
1042
1131
|
* @param id - The block to query.
|
|
@@ -1242,51 +1331,51 @@ export declare class BlockAPI {
|
|
|
1242
1331
|
/**
|
|
1243
1332
|
* Set the drop shadow's X offset of the given design block.
|
|
1244
1333
|
* @param id - The block whose drop shadow's X offset should be set.
|
|
1245
|
-
* @param
|
|
1334
|
+
* @param offsetX - The X offset to be set.
|
|
1246
1335
|
*/
|
|
1247
|
-
|
|
1336
|
+
setDropShadowOffsetX(id: DesignBlockId, offsetX: number): void;
|
|
1248
1337
|
/**
|
|
1249
1338
|
* Get the drop shadow's X offset of the given design block.
|
|
1250
1339
|
* @param id - The block whose drop shadow's X offset should be queried.
|
|
1251
1340
|
* @returns The offset.
|
|
1252
1341
|
*/
|
|
1253
|
-
|
|
1342
|
+
getDropShadowOffsetX(id: DesignBlockId): number;
|
|
1254
1343
|
/**
|
|
1255
1344
|
* Set the drop shadow's Y offset of the given design block.
|
|
1256
1345
|
* @param id - The block whose drop shadow's Y offset should be set.
|
|
1257
|
-
* @param
|
|
1346
|
+
* @param offsetY - The X offset to be set.
|
|
1258
1347
|
*/
|
|
1259
|
-
|
|
1348
|
+
setDropShadowOffsetY(id: DesignBlockId, offsetY: number): void;
|
|
1260
1349
|
/**
|
|
1261
1350
|
* Get the drop shadow's Y offset of the given design block.
|
|
1262
1351
|
* @param id - The block whose drop shadow's Y offset should be queried.
|
|
1263
1352
|
* @returns The offset.
|
|
1264
1353
|
*/
|
|
1265
|
-
|
|
1354
|
+
getDropShadowOffsetY(id: DesignBlockId): number;
|
|
1266
1355
|
/**
|
|
1267
1356
|
* Set the drop shadow's blur radius on the X axis of the given design block.
|
|
1268
1357
|
* @param id - The block whose drop shadow's blur radius should be set.
|
|
1269
|
-
* @param
|
|
1358
|
+
* @param blurRadiusX - The blur radius to be set.
|
|
1270
1359
|
*/
|
|
1271
|
-
|
|
1360
|
+
setDropShadowBlurRadiusX(id: DesignBlockId, blurRadiusX: number): void;
|
|
1272
1361
|
/**
|
|
1273
1362
|
* Get the drop shadow's blur radius on the X axis of the given design block.
|
|
1274
1363
|
* @param id - The block whose drop shadow's blur radius should be queried.
|
|
1275
1364
|
* @returns The blur radius.
|
|
1276
1365
|
*/
|
|
1277
|
-
|
|
1366
|
+
getDropShadowBlurRadiusX(id: DesignBlockId): number;
|
|
1278
1367
|
/**
|
|
1279
1368
|
* Set the drop shadow's blur radius on the Y axis of the given design block.
|
|
1280
1369
|
* @param id - The block whose drop shadow's blur radius should be set.
|
|
1281
|
-
* @param
|
|
1370
|
+
* @param blurRadiusY - The blur radius to be set.
|
|
1282
1371
|
*/
|
|
1283
|
-
|
|
1372
|
+
setDropShadowBlurRadiusY(id: DesignBlockId, blurRadiusY: number): void;
|
|
1284
1373
|
/**
|
|
1285
1374
|
* Get the drop shadow's blur radius on the Y axis of the given design block.
|
|
1286
1375
|
* @param id - The block whose drop shadow's blur radius should be queried.
|
|
1287
1376
|
* @returns The blur radius.
|
|
1288
1377
|
*/
|
|
1289
|
-
|
|
1378
|
+
getDropShadowBlurRadiusY(id: DesignBlockId): number;
|
|
1290
1379
|
/**
|
|
1291
1380
|
* Set the drop shadow's clipping of the given design block. (Only applies to shapes.)
|
|
1292
1381
|
* @param id - The block whose drop shadow's clip should be set.
|
|
@@ -1324,6 +1413,13 @@ export declare class BlockAPI {
|
|
|
1324
1413
|
* @returns The block that currently defines the given block's fill.
|
|
1325
1414
|
*/
|
|
1326
1415
|
getFill(id: DesignBlockId): DesignBlockId;
|
|
1416
|
+
/**
|
|
1417
|
+
* Sets the block containing the fill properties of the given block.
|
|
1418
|
+
* Note that the previous fill block is not destroyed automatically.
|
|
1419
|
+
* @param id - The block whose fill should be changed.
|
|
1420
|
+
* @param fill - The new fill.
|
|
1421
|
+
*/
|
|
1422
|
+
setFill(id: DesignBlockId, fill: DesignBlockId): void;
|
|
1327
1423
|
/**
|
|
1328
1424
|
* Set the fill type of the given design block.
|
|
1329
1425
|
* @param id - The block whose fill type should be set.
|
|
@@ -1436,10 +1532,28 @@ export declare class BlockAPI {
|
|
|
1436
1532
|
* @returns the gradient's radius, an error otherwise.
|
|
1437
1533
|
*/
|
|
1438
1534
|
getFillGradientRadius(id: DesignBlockId): number;
|
|
1535
|
+
/**
|
|
1536
|
+
* Enable or disable the placeholder function for a block.
|
|
1537
|
+
* @param id - The block whose placeholder function should be enabled or disabled.
|
|
1538
|
+
* @param enabled - Whether the function should be enabled or disabled.
|
|
1539
|
+
*/
|
|
1540
|
+
setPlaceholderEnabled(id: DesignBlockId, enabled: boolean): void;
|
|
1541
|
+
/**
|
|
1542
|
+
* Query whether the placeholder function for a block is enabled.
|
|
1543
|
+
* @param id - The block whose placeholder function state should be queried.
|
|
1544
|
+
* @returns the enabled state of the placeholder function.
|
|
1545
|
+
*/
|
|
1546
|
+
isPlaceholderEnabled(id: DesignBlockId): boolean;
|
|
1547
|
+
/**
|
|
1548
|
+
* Query if the given block shows placeholder content.
|
|
1549
|
+
* @param id - The block to query.
|
|
1550
|
+
* @returns true, if the block shows placeholder content.
|
|
1551
|
+
*/
|
|
1552
|
+
showsPlaceholderContent(id: DesignBlockId): boolean;
|
|
1439
1553
|
/**
|
|
1440
1554
|
* Set a metadata value of a block identified by a key.
|
|
1441
1555
|
* If the key does not exist, yet, it will be added.
|
|
1442
|
-
* @param
|
|
1556
|
+
* @param id - The block whose metadata will be accessed.
|
|
1443
1557
|
* @param key - The key used to identify the desired piece of metadata.
|
|
1444
1558
|
* @param value - The value to set.
|
|
1445
1559
|
*/
|
|
@@ -1447,14 +1561,14 @@ export declare class BlockAPI {
|
|
|
1447
1561
|
/**
|
|
1448
1562
|
* Get a metadata value of a block identified by a key.
|
|
1449
1563
|
* If the key does not exist, yet, this method will fail.
|
|
1450
|
-
* @param
|
|
1564
|
+
* @param id - The block whose metadata will be accessed.
|
|
1451
1565
|
* @param key - The key used to identify the desired piece of metadata.
|
|
1452
1566
|
* @returns the value associated with the key.
|
|
1453
1567
|
*/
|
|
1454
1568
|
getMetadata(id: DesignBlockId, key: string): string;
|
|
1455
1569
|
/**
|
|
1456
1570
|
* Check if the block has metadata associated with the key.
|
|
1457
|
-
* @param
|
|
1571
|
+
* @param id - The block whose metadata will be accessed.
|
|
1458
1572
|
* @param key - The key used to identify the desired piece of metadata.
|
|
1459
1573
|
* @returns whether the key exists.
|
|
1460
1574
|
*/
|
|
@@ -1462,10 +1576,31 @@ export declare class BlockAPI {
|
|
|
1462
1576
|
/**
|
|
1463
1577
|
* Remove metadata associated with the key from the given block.
|
|
1464
1578
|
* If the key does not exist, this method will fail.
|
|
1465
|
-
* @param
|
|
1579
|
+
* @param id - The block whose metadata will be accessed.
|
|
1466
1580
|
* @param key - The key used to identify the desired piece of metadata.
|
|
1467
1581
|
*/
|
|
1468
1582
|
removeMetadata(id: DesignBlockId, key: string): void;
|
|
1583
|
+
/**
|
|
1584
|
+
* Enable or disable a scope for a given block.
|
|
1585
|
+
* @param id - The block whose scope should be enabled or disabled.
|
|
1586
|
+
* @param key - The scope to enable or disable.
|
|
1587
|
+
* @param enabled - Whether the scope should be enabled or disabled.
|
|
1588
|
+
*/
|
|
1589
|
+
setScopeEnabled(id: DesignBlockId, key: string, enabled: boolean): void;
|
|
1590
|
+
/**
|
|
1591
|
+
* Query whether a scope is enabled for a given block.
|
|
1592
|
+
* @param id - The block whose scope state should be queried.
|
|
1593
|
+
* @param key - The scope to query.
|
|
1594
|
+
* @returns the enabled state of the scope for the given block.
|
|
1595
|
+
*/
|
|
1596
|
+
isScopeEnabled(id: DesignBlockId, key: string): boolean;
|
|
1597
|
+
/**
|
|
1598
|
+
* Check if a scope is allowed for a given block.
|
|
1599
|
+
* @param id - The block to check.
|
|
1600
|
+
* @param key - The scope to check.
|
|
1601
|
+
* @returns whether the scope is allowed for the given block.
|
|
1602
|
+
*/
|
|
1603
|
+
isAllowedByScope(id: DesignBlockId, key: string): boolean;
|
|
1469
1604
|
}
|
|
1470
1605
|
|
|
1471
1606
|
/**
|
|
@@ -1482,6 +1617,19 @@ declare interface BlockEvent_2 {
|
|
|
1482
1617
|
type: 'Created' | 'Updated' | 'Destroyed';
|
|
1483
1618
|
}
|
|
1484
1619
|
|
|
1620
|
+
/**
|
|
1621
|
+
* Dispatched on the engine canvas when the text input has been blurred.
|
|
1622
|
+
* Call `preventDefault()` to disallow this and refocus the engine text input.
|
|
1623
|
+
* @public
|
|
1624
|
+
*/
|
|
1625
|
+
export declare interface BlurEvent extends CustomEvent<EventTarget | null> {
|
|
1626
|
+
readonly type: 'cesdk-blur';
|
|
1627
|
+
/** Contains the element that has received focus during the blur, or null */
|
|
1628
|
+
readonly detail: EventTarget | null;
|
|
1629
|
+
/** Force focus back to the engine input */
|
|
1630
|
+
preventDefault(): void;
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1485
1633
|
/** @public */
|
|
1486
1634
|
declare type Callbacks = {
|
|
1487
1635
|
log?: Logger;
|
|
@@ -1589,12 +1737,12 @@ declare type Core = {
|
|
|
1589
1737
|
*/
|
|
1590
1738
|
declare class CreativeEngine {
|
|
1591
1739
|
#private;
|
|
1740
|
+
asset: AssetAPI;
|
|
1592
1741
|
block: BlockAPI;
|
|
1593
|
-
scene: SceneAPI;
|
|
1594
|
-
variable: VariableAPI;
|
|
1595
1742
|
editor: EditorAPI;
|
|
1596
|
-
asset: AssetAPI;
|
|
1597
1743
|
event: EventAPI;
|
|
1744
|
+
scene: SceneAPI;
|
|
1745
|
+
variable: VariableAPI;
|
|
1598
1746
|
|
|
1599
1747
|
/**
|
|
1600
1748
|
* Dispose the engine.
|
|
@@ -1710,6 +1858,12 @@ export declare class EditorAPI {
|
|
|
1710
1858
|
* @returns True if a redo step is available.
|
|
1711
1859
|
*/
|
|
1712
1860
|
canRedo(): boolean;
|
|
1861
|
+
/**
|
|
1862
|
+
* Subscribe to changes to the editor settings.
|
|
1863
|
+
* @param callback - This function is called at the end of the engine update, if the editor settings have changed.
|
|
1864
|
+
* @returns A method to unsubscribe.
|
|
1865
|
+
*/
|
|
1866
|
+
onSettingsChanged(callback: () => void): () => void;
|
|
1713
1867
|
/**
|
|
1714
1868
|
* Set a boolean setting.
|
|
1715
1869
|
* @param keypath - The settings keypath, e.g. `ubq://doubleClickToCropEnabled`
|
|
@@ -1806,6 +1960,18 @@ export declare class EditorAPI {
|
|
|
1806
1960
|
* @returns The resolved absolute uri or an error if an invalid path was given.
|
|
1807
1961
|
*/
|
|
1808
1962
|
getAbsoluteURI(relativePath: string): string;
|
|
1963
|
+
/**
|
|
1964
|
+
* Set a scope to be globally allowed, denied, or deferred to the block-level.
|
|
1965
|
+
* @param key - The scope to set.
|
|
1966
|
+
* @param value - `Allow` will always allow the scope, `Deny` will always deny the scope, and `Defer` will defer to the block-level.
|
|
1967
|
+
*/
|
|
1968
|
+
setGlobalScope(key: string, value: 'Allow' | 'Deny' | 'Defer'): void;
|
|
1969
|
+
/**
|
|
1970
|
+
* Query the state of a global scope.
|
|
1971
|
+
* @param key - The scope to query.
|
|
1972
|
+
* @returns `Allow` if the scope is allowed, `Deny` if it is disallowed, and `Defer` if it is deferred to the block-level.
|
|
1973
|
+
*/
|
|
1974
|
+
getGlobalScope(key: string): 'Allow' | 'Deny' | 'Defer';
|
|
1809
1975
|
}
|
|
1810
1976
|
|
|
1811
1977
|
/**
|
|
@@ -1889,23 +2055,7 @@ declare type Extensions = {
|
|
|
1889
2055
|
*/
|
|
1890
2056
|
export declare type FillType = 'Solid' | 'Gradient';
|
|
1891
2057
|
|
|
1892
|
-
|
|
1893
|
-
id: string;
|
|
1894
|
-
type: string;
|
|
1895
|
-
groups: Vector<string>;
|
|
1896
|
-
thumbUri: string;
|
|
1897
|
-
width: number;
|
|
1898
|
-
height: number;
|
|
1899
|
-
meta: UnorderedMap<string, string>;
|
|
1900
|
-
locale: string;
|
|
1901
|
-
label: string;
|
|
1902
|
-
tags: Vector<string>;
|
|
1903
|
-
context: AssetResultContext;
|
|
1904
|
-
credits: AssetResultCredits;
|
|
1905
|
-
license: AssetResultLicense;
|
|
1906
|
-
utm: AssetResultUtm;
|
|
1907
|
-
}
|
|
1908
|
-
|
|
2058
|
+
/** @public */
|
|
1909
2059
|
declare interface FindAssetsQuery {
|
|
1910
2060
|
perPage: number;
|
|
1911
2061
|
page: number;
|
|
@@ -1916,23 +2066,6 @@ declare interface FindAssetsQuery {
|
|
|
1916
2066
|
locale: string;
|
|
1917
2067
|
}
|
|
1918
2068
|
|
|
1919
|
-
declare interface FindAssetsQueryCpp {
|
|
1920
|
-
perPage: number;
|
|
1921
|
-
page: number;
|
|
1922
|
-
query: string;
|
|
1923
|
-
tags: Vector<string>;
|
|
1924
|
-
groups: Vector<string>;
|
|
1925
|
-
excludeGroups: Vector<string>;
|
|
1926
|
-
locale: string;
|
|
1927
|
-
}
|
|
1928
|
-
|
|
1929
|
-
declare interface FindAssetsResult {
|
|
1930
|
-
assets: Vector<FindAssetResult>;
|
|
1931
|
-
currentPage: number;
|
|
1932
|
-
nextPage: number;
|
|
1933
|
-
total: number;
|
|
1934
|
-
}
|
|
1935
|
-
|
|
1936
2069
|
/** @public */
|
|
1937
2070
|
declare interface Flip {
|
|
1938
2071
|
horizontal: boolean;
|
|
@@ -2109,6 +2242,19 @@ declare interface QueryData {
|
|
|
2109
2242
|
page: number;
|
|
2110
2243
|
}
|
|
2111
2244
|
|
|
2245
|
+
/**
|
|
2246
|
+
* Dispatched on the engine canvas right before the engine will refocus its text
|
|
2247
|
+
* input after a blur. Call `preventDefault()` to prevent the refocusing.
|
|
2248
|
+
* @public
|
|
2249
|
+
*/
|
|
2250
|
+
export declare interface RefocusEvent extends CustomEvent<EventTarget | null> {
|
|
2251
|
+
readonly type: 'cesdk-refocus';
|
|
2252
|
+
/** Contains the element that has received focus during the blur, or null */
|
|
2253
|
+
readonly detail: EventTarget | null;
|
|
2254
|
+
/** Prevent refocusing the engine input */
|
|
2255
|
+
preventDefault(): void;
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2112
2258
|
/**
|
|
2113
2259
|
* @public
|
|
2114
2260
|
*/
|
|
@@ -2250,7 +2396,7 @@ export declare class SceneAPI {
|
|
|
2250
2396
|
* Only has an effect if the zoom level is not handled by the UI.
|
|
2251
2397
|
* Without padding, this results in a tight view on the block.
|
|
2252
2398
|
*
|
|
2253
|
-
* @param id - The block that should be
|
|
2399
|
+
* @param id - The block that should be focused on.
|
|
2254
2400
|
* @param paddingLeft - Optional padding in screen pixels to the left of the block.
|
|
2255
2401
|
* @param paddingTop - Optional padding in screen pixels to the top of the block.
|
|
2256
2402
|
* @param paddingRight - Optional padding in screen pixels to the right of the block.
|
|
@@ -2321,13 +2467,6 @@ declare type TypefaceDefinition = Preset & {
|
|
|
2321
2467
|
}[];
|
|
2322
2468
|
};
|
|
2323
2469
|
|
|
2324
|
-
declare interface UnorderedMap<K, V> {
|
|
2325
|
-
size: () => number;
|
|
2326
|
-
get: (key: K) => V;
|
|
2327
|
-
set: (key: K, value: V) => void;
|
|
2328
|
-
keys: () => Vector<K>;
|
|
2329
|
-
}
|
|
2330
|
-
|
|
2331
2470
|
/**
|
|
2332
2471
|
* @public
|
|
2333
2472
|
*/
|