@cesdk/engine 1.7.0-alpha.5 → 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 +193 -22
- 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
|
@@ -289,6 +289,8 @@ declare interface AssetSource_2 {
|
|
|
289
289
|
* You can override this with custom behavior.
|
|
290
290
|
*/
|
|
291
291
|
applyAsset?: (asset: AssetResult_2) => Promise<void>;
|
|
292
|
+
/** Return every available group */
|
|
293
|
+
getGroups?: () => Promise<string[]>;
|
|
292
294
|
/**
|
|
293
295
|
* Indicates if the asset shall be downloaded to handle the raw data instead
|
|
294
296
|
* of an URL reference. Do this if you do not want to depend on
|
|
@@ -388,6 +390,12 @@ export declare class BlockAPI {
|
|
|
388
390
|
* @returns The created blocks handle.
|
|
389
391
|
*/
|
|
390
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;
|
|
391
399
|
|
|
392
400
|
/**
|
|
393
401
|
* Get the type of the given block, fails if the block is invalid.
|
|
@@ -592,12 +600,6 @@ export declare class BlockAPI {
|
|
|
592
600
|
* @returns true, if the block has a content fill mode.
|
|
593
601
|
*/
|
|
594
602
|
hasContentFillMode(id: DesignBlockId): boolean;
|
|
595
|
-
/**
|
|
596
|
-
* Query if the given block shows placeholder content.
|
|
597
|
-
* @param id - The block to query.
|
|
598
|
-
* @returns true, if the block shows placeholder content.
|
|
599
|
-
*/
|
|
600
|
-
hasPlaceholderContent(id: DesignBlockId): boolean;
|
|
601
603
|
/**
|
|
602
604
|
* Query a block's width.
|
|
603
605
|
* @param id - The block to query.
|
|
@@ -894,6 +896,12 @@ export declare class BlockAPI {
|
|
|
894
896
|
* @param rotation - The rotation in radians.
|
|
895
897
|
*/
|
|
896
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;
|
|
897
905
|
/**
|
|
898
906
|
* Set the crop translation in x direction of the given design block.
|
|
899
907
|
* @param id - The block whose crop should be set.
|
|
@@ -930,6 +938,12 @@ export declare class BlockAPI {
|
|
|
930
938
|
* @returns The crop rotation.
|
|
931
939
|
*/
|
|
932
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;
|
|
933
947
|
/**
|
|
934
948
|
* Get the crop translation on the x axis of the given design block.
|
|
935
949
|
* @param id - The block whose translation should be queried.
|
|
@@ -942,6 +956,12 @@ export declare class BlockAPI {
|
|
|
942
956
|
* @returns The translation on the y axis.
|
|
943
957
|
*/
|
|
944
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;
|
|
945
965
|
/**
|
|
946
966
|
* Query if the given block has an opacity.
|
|
947
967
|
* @param id - The block to query.
|
|
@@ -1013,6 +1033,99 @@ export declare class BlockAPI {
|
|
|
1013
1033
|
* @returns True, if fill is enabled.
|
|
1014
1034
|
*/
|
|
1015
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;
|
|
1016
1129
|
/**
|
|
1017
1130
|
* Query if the given block has background color properties.
|
|
1018
1131
|
* @param id - The block to query.
|
|
@@ -1218,51 +1331,51 @@ export declare class BlockAPI {
|
|
|
1218
1331
|
/**
|
|
1219
1332
|
* Set the drop shadow's X offset of the given design block.
|
|
1220
1333
|
* @param id - The block whose drop shadow's X offset should be set.
|
|
1221
|
-
* @param
|
|
1334
|
+
* @param offsetX - The X offset to be set.
|
|
1222
1335
|
*/
|
|
1223
|
-
|
|
1336
|
+
setDropShadowOffsetX(id: DesignBlockId, offsetX: number): void;
|
|
1224
1337
|
/**
|
|
1225
1338
|
* Get the drop shadow's X offset of the given design block.
|
|
1226
1339
|
* @param id - The block whose drop shadow's X offset should be queried.
|
|
1227
1340
|
* @returns The offset.
|
|
1228
1341
|
*/
|
|
1229
|
-
|
|
1342
|
+
getDropShadowOffsetX(id: DesignBlockId): number;
|
|
1230
1343
|
/**
|
|
1231
1344
|
* Set the drop shadow's Y offset of the given design block.
|
|
1232
1345
|
* @param id - The block whose drop shadow's Y offset should be set.
|
|
1233
|
-
* @param
|
|
1346
|
+
* @param offsetY - The X offset to be set.
|
|
1234
1347
|
*/
|
|
1235
|
-
|
|
1348
|
+
setDropShadowOffsetY(id: DesignBlockId, offsetY: number): void;
|
|
1236
1349
|
/**
|
|
1237
1350
|
* Get the drop shadow's Y offset of the given design block.
|
|
1238
1351
|
* @param id - The block whose drop shadow's Y offset should be queried.
|
|
1239
1352
|
* @returns The offset.
|
|
1240
1353
|
*/
|
|
1241
|
-
|
|
1354
|
+
getDropShadowOffsetY(id: DesignBlockId): number;
|
|
1242
1355
|
/**
|
|
1243
1356
|
* Set the drop shadow's blur radius on the X axis of the given design block.
|
|
1244
1357
|
* @param id - The block whose drop shadow's blur radius should be set.
|
|
1245
|
-
* @param
|
|
1358
|
+
* @param blurRadiusX - The blur radius to be set.
|
|
1246
1359
|
*/
|
|
1247
|
-
|
|
1360
|
+
setDropShadowBlurRadiusX(id: DesignBlockId, blurRadiusX: number): void;
|
|
1248
1361
|
/**
|
|
1249
1362
|
* Get the drop shadow's blur radius on the X axis of the given design block.
|
|
1250
1363
|
* @param id - The block whose drop shadow's blur radius should be queried.
|
|
1251
1364
|
* @returns The blur radius.
|
|
1252
1365
|
*/
|
|
1253
|
-
|
|
1366
|
+
getDropShadowBlurRadiusX(id: DesignBlockId): number;
|
|
1254
1367
|
/**
|
|
1255
1368
|
* Set the drop shadow's blur radius on the Y axis of the given design block.
|
|
1256
1369
|
* @param id - The block whose drop shadow's blur radius should be set.
|
|
1257
|
-
* @param
|
|
1370
|
+
* @param blurRadiusY - The blur radius to be set.
|
|
1258
1371
|
*/
|
|
1259
|
-
|
|
1372
|
+
setDropShadowBlurRadiusY(id: DesignBlockId, blurRadiusY: number): void;
|
|
1260
1373
|
/**
|
|
1261
1374
|
* Get the drop shadow's blur radius on the Y axis of the given design block.
|
|
1262
1375
|
* @param id - The block whose drop shadow's blur radius should be queried.
|
|
1263
1376
|
* @returns The blur radius.
|
|
1264
1377
|
*/
|
|
1265
|
-
|
|
1378
|
+
getDropShadowBlurRadiusY(id: DesignBlockId): number;
|
|
1266
1379
|
/**
|
|
1267
1380
|
* Set the drop shadow's clipping of the given design block. (Only applies to shapes.)
|
|
1268
1381
|
* @param id - The block whose drop shadow's clip should be set.
|
|
@@ -1300,6 +1413,13 @@ export declare class BlockAPI {
|
|
|
1300
1413
|
* @returns The block that currently defines the given block's fill.
|
|
1301
1414
|
*/
|
|
1302
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;
|
|
1303
1423
|
/**
|
|
1304
1424
|
* Set the fill type of the given design block.
|
|
1305
1425
|
* @param id - The block whose fill type should be set.
|
|
@@ -1412,10 +1532,28 @@ export declare class BlockAPI {
|
|
|
1412
1532
|
* @returns the gradient's radius, an error otherwise.
|
|
1413
1533
|
*/
|
|
1414
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;
|
|
1415
1553
|
/**
|
|
1416
1554
|
* Set a metadata value of a block identified by a key.
|
|
1417
1555
|
* If the key does not exist, yet, it will be added.
|
|
1418
|
-
* @param
|
|
1556
|
+
* @param id - The block whose metadata will be accessed.
|
|
1419
1557
|
* @param key - The key used to identify the desired piece of metadata.
|
|
1420
1558
|
* @param value - The value to set.
|
|
1421
1559
|
*/
|
|
@@ -1423,14 +1561,14 @@ export declare class BlockAPI {
|
|
|
1423
1561
|
/**
|
|
1424
1562
|
* Get a metadata value of a block identified by a key.
|
|
1425
1563
|
* If the key does not exist, yet, this method will fail.
|
|
1426
|
-
* @param
|
|
1564
|
+
* @param id - The block whose metadata will be accessed.
|
|
1427
1565
|
* @param key - The key used to identify the desired piece of metadata.
|
|
1428
1566
|
* @returns the value associated with the key.
|
|
1429
1567
|
*/
|
|
1430
1568
|
getMetadata(id: DesignBlockId, key: string): string;
|
|
1431
1569
|
/**
|
|
1432
1570
|
* Check if the block has metadata associated with the key.
|
|
1433
|
-
* @param
|
|
1571
|
+
* @param id - The block whose metadata will be accessed.
|
|
1434
1572
|
* @param key - The key used to identify the desired piece of metadata.
|
|
1435
1573
|
* @returns whether the key exists.
|
|
1436
1574
|
*/
|
|
@@ -1438,10 +1576,31 @@ export declare class BlockAPI {
|
|
|
1438
1576
|
/**
|
|
1439
1577
|
* Remove metadata associated with the key from the given block.
|
|
1440
1578
|
* If the key does not exist, this method will fail.
|
|
1441
|
-
* @param
|
|
1579
|
+
* @param id - The block whose metadata will be accessed.
|
|
1442
1580
|
* @param key - The key used to identify the desired piece of metadata.
|
|
1443
1581
|
*/
|
|
1444
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;
|
|
1445
1604
|
}
|
|
1446
1605
|
|
|
1447
1606
|
/**
|
|
@@ -1801,6 +1960,18 @@ export declare class EditorAPI {
|
|
|
1801
1960
|
* @returns The resolved absolute uri or an error if an invalid path was given.
|
|
1802
1961
|
*/
|
|
1803
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';
|
|
1804
1975
|
}
|
|
1805
1976
|
|
|
1806
1977
|
/**
|