@cesdk/engine 1.7.0-alpha.2 → 1.7.0-alpha.3

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.
Binary file
package/index.d.ts CHANGED
@@ -1206,6 +1206,99 @@ export declare class BlockAPI {
1206
1206
  * @deprecated Use `getStrokeWidth`.
1207
1207
  */
1208
1208
  getOutlineWidth(id: DesignBlockId): number;
1209
+ /**
1210
+ * Query if the given block has a drop shadow property.
1211
+ * @param id - The block to query.
1212
+ * @returns True if the block has a drop shadow property.
1213
+ */
1214
+ hasDropShadow(id: DesignBlockId): boolean;
1215
+ /**
1216
+ * Enable or disable the drop shadow of the given design block.
1217
+ * @param id - The block whose drop shadow should be enabled or disabled.
1218
+ * @param enabled - If true, the drop shadow will be enabled.
1219
+ */
1220
+ setDropShadowEnabled(id: DesignBlockId, enabled: boolean): void;
1221
+ /**
1222
+ * Query if the drop shadow of the given design block is enabled.
1223
+ * @param id - The block whose drop shadow state should be queried.
1224
+ * @returns True if the block's drop shadow is enabled.
1225
+ */
1226
+ isDropShadowEnabled(id: DesignBlockId): boolean;
1227
+ /**
1228
+ * Set the drop shadow color of the given design block.
1229
+ * @param id - The block whose drop shadow color should be set.
1230
+ * @param r - The red color component in the range of 0 to 1.
1231
+ * @param g - The green color component in the range of 0 to 1.
1232
+ * @param b - The blue color component in the range of 0 to 1.
1233
+ * @param a - The alpha color component in the range of 0 to 1.
1234
+ */
1235
+ setDropShadowColorRGBA(id: DesignBlockId, r: number, g: number, b: number, a?: number): void;
1236
+ /**
1237
+ * Get the drop shadow color of the given design block.
1238
+ * @param id - The block whose background color should be queried.
1239
+ * @returns The background color.
1240
+ */
1241
+ getDropShadowColorRGBA(id: DesignBlockId): RGBA;
1242
+ /**
1243
+ * Set the drop shadow's X offset of the given design block.
1244
+ * @param id - The block whose drop shadow's X offset should be set.
1245
+ * @param xOffset - The X offset to be set.
1246
+ */
1247
+ setDropShadowXOffset(id: DesignBlockId, xOffset: number): void;
1248
+ /**
1249
+ * Get the drop shadow's X offset of the given design block.
1250
+ * @param id - The block whose drop shadow's X offset should be queried.
1251
+ * @returns The offset.
1252
+ */
1253
+ getDropShadowXOffset(id: DesignBlockId): number;
1254
+ /**
1255
+ * Set the drop shadow's Y offset of the given design block.
1256
+ * @param id - The block whose drop shadow's Y offset should be set.
1257
+ * @param yOffset - The X offset to be set.
1258
+ */
1259
+ setDropShadowYOffset(id: DesignBlockId, yOffset: number): void;
1260
+ /**
1261
+ * Get the drop shadow's Y offset of the given design block.
1262
+ * @param id - The block whose drop shadow's Y offset should be queried.
1263
+ * @returns The offset.
1264
+ */
1265
+ getDropShadowYOffset(id: DesignBlockId): number;
1266
+ /**
1267
+ * Set the drop shadow's blur radius on the X axis of the given design block.
1268
+ * @param id - The block whose drop shadow's blur radius should be set.
1269
+ * @param xBlurRadius - The blur radius to be set.
1270
+ */
1271
+ setDropShadowXBlurRadius(id: DesignBlockId, xBlurRadius: number): void;
1272
+ /**
1273
+ * Get the drop shadow's blur radius on the X axis of the given design block.
1274
+ * @param id - The block whose drop shadow's blur radius should be queried.
1275
+ * @returns The blur radius.
1276
+ */
1277
+ getDropShadowXBlurRadius(id: DesignBlockId): number;
1278
+ /**
1279
+ * Set the drop shadow's blur radius on the Y axis of the given design block.
1280
+ * @param id - The block whose drop shadow's blur radius should be set.
1281
+ * @param yBlurRadius - The blur radius to be set.
1282
+ */
1283
+ setDropShadowYBlurRadius(id: DesignBlockId, yBlurRadius: number): void;
1284
+ /**
1285
+ * Get the drop shadow's blur radius on the Y axis of the given design block.
1286
+ * @param id - The block whose drop shadow's blur radius should be queried.
1287
+ * @returns The blur radius.
1288
+ */
1289
+ getDropShadowYBlurRadius(id: DesignBlockId): number;
1290
+ /**
1291
+ * Set the drop shadow's clipping of the given design block. (Only applies to shapes.)
1292
+ * @param id - The block whose drop shadow's clip should be set.
1293
+ * @param clip - The drop shadow's clip to be set.
1294
+ */
1295
+ setDropShadowClip(id: DesignBlockId, clip: boolean): void;
1296
+ /**
1297
+ * Get the drop shadow's clipping of the given design block.
1298
+ * @param id - The block whose drop shadow's clipping should be queried.
1299
+ * @returns The drop shadow's clipping.
1300
+ */
1301
+ getDropShadowClip(id: DesignBlockId): boolean;
1209
1302
  /**
1210
1303
  * Query if the given block has fill color properties.
1211
1304
  * @param id - The block to query.
@@ -1225,6 +1318,12 @@ export declare class BlockAPI {
1225
1318
  * @returns An empty result on success, an error otherwise.
1226
1319
  */
1227
1320
  setFillEnabled(id: DesignBlockId, enabled: boolean): void;
1321
+ /**
1322
+ * Returns the block containing the fill properties of the given block.
1323
+ * @param id - The block whose fill block should be returned.
1324
+ * @returns The block that currently defines the given block's fill.
1325
+ */
1326
+ getFill(id: DesignBlockId): DesignBlockId;
1228
1327
  /**
1229
1328
  * Set the fill type of the given design block.
1230
1329
  * @param id - The block whose fill type should be set.
@@ -1337,6 +1436,36 @@ export declare class BlockAPI {
1337
1436
  * @returns the gradient's radius, an error otherwise.
1338
1437
  */
1339
1438
  getFillGradientRadius(id: DesignBlockId): number;
1439
+ /**
1440
+ * Set a metadata value of a block identified by a key.
1441
+ * If the key does not exist, yet, it will be added.
1442
+ * @param block - The block whose metadata will be accessed.
1443
+ * @param key - The key used to identify the desired piece of metadata.
1444
+ * @param value - The value to set.
1445
+ */
1446
+ setMetadata(id: DesignBlockId, key: string, value: string): void;
1447
+ /**
1448
+ * Get a metadata value of a block identified by a key.
1449
+ * If the key does not exist, yet, this method will fail.
1450
+ * @param block - The block whose metadata will be accessed.
1451
+ * @param key - The key used to identify the desired piece of metadata.
1452
+ * @returns the value associated with the key.
1453
+ */
1454
+ getMetadata(id: DesignBlockId, key: string): string;
1455
+ /**
1456
+ * Check if the block has metadata associated with the key.
1457
+ * @param block - The block whose metadata will be accessed.
1458
+ * @param key - The key used to identify the desired piece of metadata.
1459
+ * @returns whether the key exists.
1460
+ */
1461
+ hasMetadata(id: DesignBlockId, key: string): boolean;
1462
+ /**
1463
+ * Remove metadata associated with the key from the given block.
1464
+ * If the key does not exist, this method will fail.
1465
+ * @param block - The block whose metadata will be accessed.
1466
+ * @param key - The key used to identify the desired piece of metadata.
1467
+ */
1468
+ removeMetadata(id: DesignBlockId, key: string): void;
1340
1469
  }
1341
1470
 
1342
1471
  /**
@@ -1557,16 +1686,6 @@ export declare class EditorAPI {
1557
1686
  * @returns The text cursor's y position in screen space.
1558
1687
  */
1559
1688
  getTextCursorPositionInScreenSpaceY(): number;
1560
- /**
1561
- * Sets the zoom level of the scene.
1562
- * @param zoomLevel - The new zoom level.
1563
- */
1564
- setZoomLevel(zoomLevel?: number): void;
1565
- /**
1566
- * Query a camera zoom level.
1567
- * @returns The zoom level of the block's (main) camera.
1568
- */
1569
- getZoomLevel(): number;
1570
1689
  /**
1571
1690
  * Adds a new history state to the stack, if undoable changes were made.
1572
1691
  */
@@ -2114,6 +2233,31 @@ export declare class SceneAPI {
2114
2233
  * @returns A Promise that resolves once the template was applied or rejects if there was an error.
2115
2234
  */
2116
2235
  applyTemplateFromURL(url: string): Promise<void>;
2236
+ /**
2237
+ * Sets the zoom level of the active scene.
2238
+ * Only has an effect if the zoom level is not handled by the UI.
2239
+ *
2240
+ * @param zoomLevel - The new zoom level.
2241
+ */
2242
+ setZoomLevel(zoomLevel?: number): void;
2243
+ /**
2244
+ * Query a camera zoom level of the active scene.
2245
+ * @returns The zoom level of the block's camera.
2246
+ */
2247
+ getZoomLevel(): number;
2248
+ /**
2249
+ * Sets the zoom and focus to show a block.
2250
+ * Only has an effect if the zoom level is not handled by the UI.
2251
+ * Without padding, this results in a tight view on the block.
2252
+ *
2253
+ * @param id - The block that should be focussed on.
2254
+ * @param paddingLeft - Optional padding in screen pixels to the left of the block.
2255
+ * @param paddingTop - Optional padding in screen pixels to the top of the block.
2256
+ * @param paddingRight - Optional padding in screen pixels to the right of the block.
2257
+ * @param paddingBottom - Optional padding in screen pixels to the bottom of the block.
2258
+ * @returns A promise that resolves once the zoom was set or rejects with an error otherwise.
2259
+ */
2260
+ zoomToBlock(id: DesignBlockId, paddingLeft?: number, paddingTop?: number, paddingRight?: number, paddingBottom?: number): Promise<void>;
2117
2261
  /**
2118
2262
  * Converts all values of the current scene into the given design unit.
2119
2263
  * @param designUnit - The new design unit of the scene