@cesdk/engine 1.9.2 → 1.10.0-preview.1

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/index.d.ts CHANGED
@@ -6,21 +6,24 @@
6
6
  */
7
7
  export declare interface Asset {
8
8
  /**
9
- * Is a combination of source id, extension pack id (optional), type and asset id
10
- * e.g. "extension://ly.img.cesdk.images.samples/ly.img.image/sample.1"
9
+ * The unique id of this asset.
11
10
  */
12
11
  id: string;
13
- /** E.g. `ly.img.image` */
14
12
  /** Groups of the asset. */
15
13
  groups?: Groups;
16
- /** URI to a thumbnail of the asset used e.g. in the content library UI */
17
- thumbUri: string;
18
-
19
14
  /** Asset-specific and custom meta information */
20
15
  meta?: {
16
+ /** The mime type of this asset or the data behind the asset's uri. */
17
+ mimeType?: string;
18
+ /** The type id of the design block that should be created from this asset. */
19
+ blockType?: string;
21
20
  uri?: string;
21
+ thumbUri?: string;
22
+ previewUri?: string;
22
23
  filename?: string;
23
24
  vectorPath?: string;
25
+ width?: number;
26
+ height?: number;
24
27
  duration?: string;
25
28
  } & Record<string, unknown>;
26
29
  }
@@ -36,6 +39,16 @@ export declare class AssetAPI {
36
39
  * @param source - The asset source.
37
40
  */
38
41
  addSource(source: AssetSource): void;
42
+ /**
43
+ * Adds a local asset source. Its ID has to be unique.
44
+ * @param source - The asset source.
45
+ * @param supportedMimeTypes - The mime types of assets that are allowed to be added to this local source.
46
+ * @param applyAsset - An optional callback that can be used to override the default behavior of applying a given
47
+ * asset result to the active scene.
48
+ * @param applyAssetToBlock - An optional callback that can be used to override the default behavior of applying
49
+ * an asset result to a given block.
50
+ */
51
+ addLocalSource(id: string, supportedMimeTypes?: string[], applyAsset?: (asset: AssetResult) => Promise<DesignBlockId | undefined>, applyAssetToBlock?: (asset: AssetResult, block: DesignBlockId) => Promise<void>): void;
39
52
  /**
40
53
  * Removes an asset source with the given ID.
41
54
  * @param id - The ID to refer to the asset source.
@@ -59,6 +72,7 @@ export declare class AssetAPI {
59
72
  * @returns The asset groups.
60
73
  */
61
74
  getGroups(id: string): Promise<string[]>;
75
+ getSupportedMimeTypes(sourceId: string): string[];
62
76
  /**
63
77
  * Queries the asset source's credits info.
64
78
  * @param sourceId - The ID of the asset source.
@@ -78,9 +92,18 @@ export declare class AssetAPI {
78
92
  url: string | undefined;
79
93
  } | undefined;
80
94
  canManageAssets(sourceId: string): boolean;
81
-
82
-
83
-
95
+ /**
96
+ * Adds the given asset to a local asset source.
97
+ * @param sourceId - The local asset source ID that the asset should be added to.
98
+ * @param asset - The asset to be added to the asset source.
99
+ */
100
+ addAssetToSource(sourceId: string, asset: AssetDefinition): void;
101
+ /**
102
+ * Removes the specified asset from its local asset source.
103
+ * @param sourceId - The id of the local asset source that currently contains the asset.
104
+ * @param assetId - The id of the asset to be removed.
105
+ */
106
+ removeAssetFromSource(sourceId: string, assetId: string): void;
84
107
 
85
108
  /**
86
109
  * Apply an asset result to the active scene.
@@ -89,7 +112,7 @@ export declare class AssetAPI {
89
112
  * @param sourceId - The ID of the asset source.
90
113
  * @param assetResult - A single assetResult of a `findAssets` query.
91
114
  */
92
- apply(sourceId: string, assetResult: AssetResult): Promise<void>;
115
+ apply(sourceId: string, assetResult: AssetResult): Promise<DesignBlockId | undefined>;
93
116
  /**
94
117
  * Apply an asset result to the given block.
95
118
  * @param sourceId - The ID of the asset source.
@@ -102,7 +125,7 @@ export declare class AssetAPI {
102
125
  * This implementation is used when no `applyAsset` function is provided to `addSource`.
103
126
  * @param assetResult - A single assetResult of a `findAssets` query.
104
127
  */
105
- defaultApplyAsset(assetResult: AssetResult): Promise<void>;
128
+ defaultApplyAsset(assetResult: AssetResult): Promise<DesignBlockId | undefined>;
106
129
  /**
107
130
  * The default implementation for applying an asset to an existing block.
108
131
  * @param assetResult - A single assetResult of a `findAssets` query.
@@ -113,7 +136,7 @@ export declare class AssetAPI {
113
136
  }
114
137
 
115
138
  /**
116
- * Definition of an assets used if an asset is added to an asset source.
139
+ * Definition of an asset used if an asset is added to an asset source.
117
140
  * @public
118
141
  */
119
142
  export declare interface AssetDefinition extends Asset {
@@ -197,13 +220,6 @@ export declare interface AssetResult extends Asset {
197
220
  declare interface AssetResult_2 {
198
221
  /** A unique id of this asset */
199
222
  id: string;
200
- /** URI to a thumbnail of the asset used e.g. in the content library UI */
201
- thumbUri: string;
202
- /** Original size of the asset. */
203
- size: {
204
- width: number;
205
- height: number;
206
- };
207
223
  /** Asset-specific and custom meta information */
208
224
  meta?: {
209
225
  uri?: string;
@@ -271,16 +287,17 @@ export declare interface AssetSource {
271
287
  */
272
288
  getAsset?(id: string): Promise<AssetResult | undefined>;
273
289
  /**
274
- * Can the source add, update and remove assets dynamically? If `false`
275
- * methods like `addAsset` `updateAsset` and `removeAsset` will throw an
290
+ * Can the source add and remove assets dynamically? If `false`
291
+ * methods like `addAsset` and `removeAsset` will throw an
276
292
  * error.
277
293
  */
278
294
  canManageAssets?: boolean;
279
295
  /**
280
296
  * Apply the given asset result to the active scene.
281
297
  * You can override this with custom behavior.
298
+ * @returns the id of a new block if one was created from the asset.
282
299
  */
283
- applyAsset?: (asset: AssetResult) => Promise<void>;
300
+ applyAsset?: (asset: AssetResult) => Promise<DesignBlockId | undefined>;
284
301
  /**
285
302
  * Apply the given asset result to the given block.
286
303
  * You can override this with custom behavior.
@@ -290,22 +307,12 @@ export declare interface AssetSource {
290
307
  * Adds the given asset to this source. Throws an error if `canManageAssets`
291
308
  * is `false`.
292
309
  *
293
- * @returns the id of the added asset
294
310
  */
295
- addAsset?(asset: AssetDefinition): Promise<string>;
296
- /**
297
- * Updates the asset of this source. Throws an error if `canManageAssets`
298
- * is `false` or no asset with the given id could not be found.
299
- *
300
- * @returns the id of the added asset
301
- */
302
- updateAsset?(assetId: string, asset: AssetDefinition): Promise<void>;
311
+ addAsset?(asset: AssetDefinition): void;
303
312
  /**
304
313
  * Removes the given asset from this source.
305
- *
306
- * @returns true if asset was found and removed, and false otherwise
307
314
  */
308
- removeAsset?(assetId: string): Promise<boolean>;
315
+ removeAsset?(assetId: string): void;
309
316
  /**
310
317
  * Generates a list of supported mime types for this source.
311
318
  *
@@ -325,7 +332,7 @@ declare interface AssetSource_2 {
325
332
  * Apply the given asset result to the active scene.
326
333
  * You can override this with custom behavior.
327
334
  */
328
- applyAsset?: (asset: AssetResult_2) => Promise<void>;
335
+ applyAsset?: (asset: AssetResult_2) => Promise<DesignBlockId | undefined>;
329
336
  /**
330
337
  * Apply the given asset result to the given block.
331
338
  * You can override this with custom behavior.
@@ -408,6 +415,7 @@ export declare type BlendMode = 'PassThrough' | 'Normal' | 'Darken' | 'Multiply'
408
415
  */
409
416
  export declare class Block extends Entity {
410
417
  #private;
418
+ get type(): DesignBlockType;
411
419
  effects: ReadWriteChannelSync<number[]>;
412
420
  blur: ReadWriteChannelSync<number>;
413
421
  isBlurEnabled: ReadWriteChannelSync<boolean>;
@@ -417,20 +425,43 @@ export declare class Block extends Entity {
417
425
  playing: ReadWriteChannelSync<boolean>;
418
426
  playbackTime: ReadWriteChannelSync<number>;
419
427
  selection: ReadWriteChannelSync<boolean>;
420
- sceneMode: ReadWriteChannelSync<SceneMode>;
421
428
  duration: ReadWriteChannelSync<number>;
422
- totalSceneDuration: ReadWriteChannelSync<number>;
423
429
  name: ReadWriteChannelSync<string>;
424
- audioMuted: ReadWriteChannelSync<boolean>;
425
- videoMuted: ReadWriteChannelSync<boolean>;
426
430
  avResourceTotalDuration: ReadWriteChannelSync<number>;
427
431
  timeOffset: ReadWriteChannelSync<number>;
428
432
  cropTranslationX: ReadWriteChannelSync<number>;
429
433
  cropTranslationY: ReadWriteChannelSync<number>;
430
434
  cropTranslation: ReadWriteChannelSync<Vec2>;
435
+ cropScaleRatio: ReadWriteChannelSync<number>;
436
+ cropRotation: ReadWriteChannelSync<number>;
437
+ cropScaleX: ReadWriteChannelSync<number>;
438
+ cropScaleY: ReadWriteChannelSync<number>;
431
439
  width: ReadWriteChannelSync<number>;
432
440
  height: ReadWriteChannelSync<number>;
433
441
  dimensions: ReadWriteChannelSync<Vec2>;
442
+ contentFillMode: ReadWriteChannelSync<ContentFillMode>;
443
+ blendMode: ReadWriteChannelSync<BlendMode>;
444
+ designStyleScope: ReadWriteChannelSync<boolean>;
445
+ designArrangeScope: ReadWriteChannelSync<boolean>;
446
+ designArrangeScopeMove: ReadWriteChannelSync<boolean>;
447
+ designArrangeScopeResize: ReadWriteChannelSync<boolean>;
448
+ designArrangeScopeRotate: ReadWriteChannelSync<boolean>;
449
+ designArrangeScopeFlip: ReadWriteChannelSync<boolean>;
450
+ contentReplaceScope: ReadWriteChannelSync<boolean>;
451
+ lifecycleDestroyScope: ReadWriteChannelSync<boolean>;
452
+ lifecycleDuplicateScope: ReadWriteChannelSync<boolean>;
453
+ editorAddScope: ReadWriteChannelSync<boolean>;
454
+ editorInspectScope: ReadWriteChannelSync<boolean>;
455
+ editorPresentScope: ReadWriteChannelSync<boolean>;
456
+ editorManagePagesScope: ReadWriteChannelSync<boolean>;
457
+ editorSelectScope: ReadWriteChannelSync<boolean>;
458
+ editorZoomScope: ReadWriteChannelSync<boolean>;
459
+ boundingBox: ReadOnlyChannelSync<{
460
+ x: number;
461
+ y: number;
462
+ width: number;
463
+ height: number;
464
+ }>;
434
465
 
435
466
 
436
467
  }
@@ -479,6 +510,7 @@ export declare class BlockAPI {
479
510
  /**
480
511
  * Loads existing blocks from the given string.
481
512
  * The blocks are not attached by default and won't be visible until attached to a page or the scene.
513
+ * The UUID of the loaded blocks is replaced with a new one.
482
514
  * @param content - A string representing the given blocks.
483
515
  * @returns A promise that resolves with a list of handles representing the found blocks or an error.
484
516
  */
@@ -502,13 +534,17 @@ export declare class BlockAPI {
502
534
  * @returns The created fill's handle.
503
535
  */
504
536
  createFill(type: string): DesignBlockId;
505
-
506
537
  /**
507
538
  * Get the type of the given block, fails if the block is invalid.
508
539
  * @param id - The block to query.
509
540
  * @returns The blocks type.
510
541
  */
511
542
  getType(id: DesignBlockId): DesignBlockType;
543
+ /**
544
+ * Selects the given block and deselects all other blocks.
545
+ * @param id - The block to be selected.
546
+ */
547
+ select(id: DesignBlockId): void;
512
548
  /**
513
549
  * Update the selection state of a block.
514
550
  * Fails for invalid blocks.
@@ -670,6 +706,46 @@ export declare class BlockAPI {
670
706
  * @param mode - The y position mode: absolute, percent or undefined.
671
707
  */
672
708
  setPositionYMode(id: DesignBlockId, mode: PositionMode): void;
709
+ /**
710
+ * Update the block's always-on-top property. If true, this blocks's global sorting order is automatically
711
+ * adjusted to be higher than all other siblings
712
+ * without this property. If more than one block is set to be always-on-top, the child order decides which is on top.
713
+ *
714
+ * @param id - the block to update.
715
+ * @param enabled - whether the block shall be always-on-top.
716
+ */
717
+ setAlwaysOnTop(id: DesignBlockId, enabled: boolean): void;
718
+ /**
719
+ * Query a block's always-on-top property.
720
+ *
721
+ * @param id - the block to query.
722
+ * @returns true if the block is set to be always-on-top, false otherwise.
723
+ */
724
+ isAlwaysOnTop(id: DesignBlockId): boolean;
725
+ /**
726
+ * Updates the sorting order of this block and all of its manually created siblings
727
+ * so that the given block has the highest sorting order.
728
+ * @param id - The id of the block to be given the highest sorting order among its siblings.
729
+ */
730
+ bringToFront(id: DesignBlockId): void;
731
+ /**
732
+ * Updates the sorting order of this block and all of its manually created siblings
733
+ * so that the given block has the lowest sorting order.
734
+ * @param id - The id of the block to be given the lowest sorting order among its siblings.
735
+ */
736
+ sendToBack(id: DesignBlockId): void;
737
+ /**
738
+ * Updates the sorting order of this block and all of its superjacent siblings
739
+ * so that the given block has a higher sorting order than the next superjacent sibling.
740
+ * @param id - The id of the block to be given a higher sorting than the next superjacent sibling.
741
+ */
742
+ bringForward(id: DesignBlockId): void;
743
+ /**
744
+ * Updates the sorting order of this block and all of its manually created and subjacent siblings
745
+ * so that the given block will have a lower sorting order than the next subjacent sibling.
746
+ * @param id - The id of the block to be given a lower sorting order than the next subjacent sibling.
747
+ */
748
+ sendBackward(id: DesignBlockId): void;
673
749
  /**
674
750
  * Query a block's rotation in radians.
675
751
  * @param id - The block to query.
@@ -736,12 +812,6 @@ export declare class BlockAPI {
736
812
  * @returns The current mode for the height: absolute, percent or auto.
737
813
  */
738
814
  getHeightMode(id: DesignBlockId): SizeMode;
739
- /**
740
- * Query a block's content fill mode.
741
- * @param id - The block to query.
742
- * @returns The current mode: crop, cover or contain.
743
- */
744
- getContentFillMode(id: DesignBlockId): ContentFillMode;
745
815
  /**
746
816
  * Update a block's width.
747
817
  * @param id - The block to update.
@@ -767,25 +837,45 @@ export declare class BlockAPI {
767
837
  */
768
838
  setHeightMode(id: DesignBlockId, mode: SizeMode): void;
769
839
  /**
770
- * Set a block's content fill mode.
771
- * @param id - The block to update.
772
- * @param mode - The content fill mode mode: crop, cover or contain.
840
+ * Get a block's layout position on the x-axis. The position is only available after an
841
+ * internal update loop which only occurs if the `features/implicitUpdatesEnabled` setting is set.
842
+ * @param id - The block to query.
843
+ * @returns The layout position on the x-axis.
773
844
  */
774
- setContentFillMode(id: DesignBlockId, mode: ContentFillMode): void;
845
+ getFrameX(id: DesignBlockId): number;
775
846
  /**
776
- * Get a block's layout width. The layout width is only available after an
777
- * internal update loop, which may not happen immediately.
847
+ * Get a block's layout position on the y-axis. The position is only available after an
848
+ * internal update loop which only occurs if the `features/implicitUpdatesEnabled` setting is set.
849
+ * @param id - The block to query.
850
+ * @returns The layout position on the y-axis.
851
+ */
852
+ getFrameY(id: DesignBlockId): number;
853
+ /**
854
+ * Get a block's layout width. The width is only available after an
855
+ * internal update loop which only occurs if the `features/implicitUpdatesEnabled` setting is set.
778
856
  * @param id - The block to query.
779
857
  * @returns The layout width.
780
858
  */
781
859
  getFrameWidth(id: DesignBlockId): number;
782
860
  /**
783
- * Get a block's layout height. The layout height is only available after an
784
- * internal update loop, which may not happen immediately.
861
+ * Get a block's layout height. The height is only available after an
862
+ * internal update loop which only occurs if the `features/implicitUpdatesEnabled` setting is set.
785
863
  * @param id - The block to query.
786
864
  * @returns The layout height.
787
865
  */
788
866
  getFrameHeight(id: DesignBlockId): number;
867
+ /**
868
+ * Set a block's content fill mode.
869
+ * @param id - The block to update.
870
+ * @param mode - The content fill mode mode: crop, cover or contain.
871
+ */
872
+ setContentFillMode(id: DesignBlockId, mode: ContentFillMode): void;
873
+ /**
874
+ * Query a block's content fill mode.
875
+ * @param id - The block to query.
876
+ * @returns The current mode: crop, cover or contain.
877
+ */
878
+ getContentFillMode(id: DesignBlockId): ContentFillMode;
789
879
  /**
790
880
  * Duplicates a block including its children.
791
881
  * @param id - The block to duplicate.
@@ -864,6 +954,12 @@ export declare class BlockAPI {
864
954
  * @returns float The height of the axis-aligned bounding box.
865
955
  */
866
956
  getGlobalBoundingBoxHeight(id: DesignBlockId): number;
957
+ /**
958
+ * Get the position and size of the axis-aligned bounding box for the given blocks in screen space.
959
+ * @param ids - The block to query.
960
+ * @returns The position and size of the bounding box.
961
+ */
962
+ getScreenSpaceBoundingBoxXYWH(ids: DesignBlockId[]): XYWH;
867
963
  /**
868
964
  * Scales the block and all of its children proportionally around the specified
869
965
  * relative anchor point.
@@ -1908,6 +2004,48 @@ export declare class BlockAPI {
1908
2004
  * @returns Whether solo playback is enabled for this block.
1909
2005
  */
1910
2006
  isSoloPlaybackEnabled(id: DesignBlockId): boolean;
2007
+ /**
2008
+ * Returns whether the block supports a playback control.
2009
+ * @param block - The block to query.
2010
+ * @returns Whether the block has playback control.
2011
+ */
2012
+ hasPlaybackControl(id: DesignBlockId): boolean;
2013
+ /**
2014
+ * Set whether the block should start from the beginning again or stop.
2015
+ * @param block - The block or video fill to update.
2016
+ * @param looping - Whether the block should loop to the beginning or stop.
2017
+ */
2018
+ setLooping(id: DesignBlockId, looping: boolean): void;
2019
+ /**
2020
+ * Query whether the block is looping.
2021
+ * @param block - The block to query.
2022
+ * @returns Whether the block is looping.
2023
+ */
2024
+ isLooping(id: DesignBlockId): boolean;
2025
+ /**
2026
+ * Set whether the audio of the block is muted.
2027
+ * @param block - The block or video fill to update.
2028
+ * @param muted - Whether the audio should be muted.
2029
+ */
2030
+ setMuted(id: DesignBlockId, muted: boolean): void;
2031
+ /**
2032
+ * Query whether the block is muted.
2033
+ * @param block - The block to query.
2034
+ * @returns Whether the block is muted.
2035
+ */
2036
+ isMuted(id: DesignBlockId): boolean;
2037
+ /**
2038
+ * Set the audio volume of the given block.
2039
+ * @param block - The block or video fill to update.
2040
+ * @param volume - The desired volume with a range of [0, 1].
2041
+ */
2042
+ setVolume(id: DesignBlockId, volume: number): void;
2043
+ /**
2044
+ * Get the audio volume of the given block.
2045
+ * @param block - The block to query.
2046
+ * @returns The volume with a range of [0, 1].
2047
+ */
2048
+ getVolume(id: DesignBlockId): number;
1911
2049
  /**
1912
2050
  * Begins loading the required audio and video resource for the given video fill or audio block.
1913
2051
  * @param id - The video fill or audio block whose resource should be loaded.
@@ -1980,6 +2118,15 @@ declare type Callbacks = {
1980
2118
  log?: Logger;
1981
2119
  };
1982
2120
 
2121
+ declare type CameraSettings = {
2122
+ /** Horizontal resolution in physical pixels */
2123
+ width: number;
2124
+ /** Vertical resolution in physical pixels */
2125
+ height: number;
2126
+ /** Physical pixels per CSS pixel */
2127
+ pixelRatio: number;
2128
+ };
2129
+
1983
2130
  /**
1984
2131
  * A Channel represents a reactive data source consisting of three elements:
1985
2132
  *
@@ -1987,8 +2134,7 @@ declare type Callbacks = {
1987
2134
  * data source. Calling this method returns an `unsubscribe` method.
1988
2135
  * * An (optional) `update` method to update the data source
1989
2136
  * * An (optional) synchronous `value` method that can be used to retrieve
1990
- * the current value or a sensible initial value without waiting for a
1991
- * potentially asynchronous value coming through the stream.
2137
+ * the current value.
1992
2138
  * @public
1993
2139
  */
1994
2140
  export declare interface Channel<Out, In = Out> {
@@ -1998,7 +2144,7 @@ export declare interface Channel<Out, In = Out> {
1998
2144
  }
1999
2145
 
2000
2146
  /**
2001
- * A {@link Channel} that is guaranteed to have a `value`
2147
+ * A {@link Channel} that is guaranteed to have a `value` method
2002
2148
  * @public
2003
2149
  */
2004
2150
  export declare interface ChannelSync<Out, In = Out> extends Channel<Out, In> {
@@ -2056,7 +2202,7 @@ declare namespace ConfigTypes {
2056
2202
  Variables,
2057
2203
  Core,
2058
2204
  Extensions,
2059
- Scene,
2205
+ Scene_2 as Scene,
2060
2206
  Page,
2061
2207
  Callbacks
2062
2208
  }
@@ -2130,6 +2276,7 @@ declare class CreativeEngine {
2130
2276
  scene: SceneAPI;
2131
2277
  variable: VariableAPI;
2132
2278
 
2279
+
2133
2280
  get element(): HTMLCreativeEngineCanvasElement | undefined;
2134
2281
  /**
2135
2282
  * Dispose the engine.
@@ -2147,6 +2294,8 @@ declare class CreativeEngine {
2147
2294
  } : {
2148
2295
  readonly element: HTMLCreativeEngineCanvasElement;
2149
2296
  })>;
2297
+
2298
+
2150
2299
  }
2151
2300
  export default CreativeEngine;
2152
2301
 
@@ -2378,6 +2527,16 @@ export declare class EditorAPI {
2378
2527
  * @returns The value as string.
2379
2528
  */
2380
2529
  getSettingEnum(keypath: string): string;
2530
+ /**
2531
+ * Get the currently available memory in bytes.
2532
+ * @returns The currently available memory in bytes.
2533
+ */
2534
+ getAvailableMemory(): number;
2535
+ /**
2536
+ * Get the current memory usage of the engine in bytes.
2537
+ * @returns The current memory usage in bytes.
2538
+ */
2539
+ getUsedMemory(): number;
2381
2540
  /**
2382
2541
  * Sets a custom URI resolver.
2383
2542
  * This function can be called more than once. Subsequent calls will overwrite previous calls.
@@ -2474,6 +2633,7 @@ export declare class Entity {
2474
2633
  get id(): number;
2475
2634
  Int(property: string): ReadWriteChannelSync<number>;
2476
2635
  Float(property: string): ReadWriteChannelSync<number>;
2636
+ Bool(property: string): ReadWriteChannelSync<boolean>;
2477
2637
  }
2478
2638
 
2479
2639
  /** @public */
@@ -2482,7 +2642,6 @@ export declare class EntityChannels<T extends Entity> {
2482
2642
 
2483
2643
 
2484
2644
 
2485
- constant<V>(constantValue: V): ReadWriteChannelSync<V>;
2486
2645
  dispose(): void;
2487
2646
  }
2488
2647
 
@@ -2720,6 +2879,14 @@ declare type Page = {
2720
2879
  dimOutOfPageAreas?: boolean;
2721
2880
  };
2722
2881
 
2882
+ /** @public */
2883
+ export declare interface PageDuration {
2884
+ pageId: DesignBlockId;
2885
+ duration: number;
2886
+ start: number;
2887
+ end: number;
2888
+ }
2889
+
2723
2890
  /** @public */
2724
2891
  declare type PageFormatDefinition = Preset & {
2725
2892
  width: number;
@@ -2788,6 +2955,24 @@ declare interface QueryData {
2788
2955
  page: number;
2789
2956
  }
2790
2957
 
2958
+ /**
2959
+ * A Read only {@link Channel}
2960
+ * @public
2961
+ */
2962
+ export declare interface ReadOnlyChannel<Out> extends Omit<Channel<Out>, 'update'> {
2963
+ subscribe: Source<Out>;
2964
+ value?: () => Out;
2965
+ }
2966
+
2967
+ /**
2968
+ * A {@link ReadOnlyChannel} that is guaranteed to have a `value`
2969
+ * @public
2970
+ */
2971
+ export declare interface ReadOnlyChannelSync<Out> extends Omit<ChannelSync<Out>, 'update'>, ReadOnlyChannel<Out> {
2972
+ subscribe: Source<Out>;
2973
+ value: () => Out;
2974
+ }
2975
+
2791
2976
  /**
2792
2977
  * A {@link Channel} that is guaranteed to have an `update` method.
2793
2978
  * @public
@@ -2799,7 +2984,7 @@ export declare interface ReadWriteChannel<Out, In = Out> extends Channel<Out, In
2799
2984
  }
2800
2985
 
2801
2986
  /**
2802
- * A {@link ReadWriteChannel} that is guaranteed to have a `value`
2987
+ * A {@link ReadWriteChannel} that is guaranteed to have a `value` and an `update` method
2803
2988
  * @public
2804
2989
  */
2805
2990
  export declare interface ReadWriteChannelSync<Out, In = Out> extends ChannelSync<Out, In>, ReadWriteChannel<Out, In> {
@@ -2850,11 +3035,31 @@ export declare interface RGBColor {
2850
3035
  /** @public */
2851
3036
  export declare type RoleString = 'Creator' | 'Adopter' | 'Viewer' | 'Presenter';
2852
3037
 
3038
+ /**
3039
+ * Contains channels for scene-specific information that are valid through
3040
+ * scene changes.
3041
+ * @public
3042
+ */
3043
+ export declare class Scene {
3044
+
3045
+ /**
3046
+ * A channel containing the latest Block.
3047
+ * Will emit an event when the scene changes
3048
+ */
3049
+ block: ChannelSync<Block | undefined>;
3050
+ mode: ChannelSync<SceneMode | undefined>;
3051
+ totalDuration: ChannelSync<number>;
3052
+ pages: ChannelSync<DesignBlockId[]>;
3053
+ playing: ReadWriteChannelSync<boolean>;
3054
+ playbackTime: ReadWriteChannelSync<number>;
3055
+ pageDurations: ChannelSync<PageDuration[]>;
3056
+ }
3057
+
2853
3058
  /**
2854
3059
  * Export Settings
2855
3060
  * @public
2856
3061
  */
2857
- declare type Scene = {
3062
+ declare type Scene_2 = {
2858
3063
  /**
2859
3064
  * The DPI value to use when exporting and when converting between pixels and inches or millimeter units.
2860
3065
  * (In the CESDK, this value is synonymous with PPI).
@@ -2954,6 +3159,11 @@ export declare class SceneAPI {
2954
3159
  * @returns The current mode of the scene.
2955
3160
  */
2956
3161
  getMode(): SceneMode;
3162
+ /**
3163
+ * Get the sorted list of pages in the scene.
3164
+ * @returns The sorted list of pages in the scene.
3165
+ */
3166
+ getPages(): DesignBlockId[];
2957
3167
  /**
2958
3168
  * Sets the zoom level of the active scene.
2959
3169
  * Only has an effect if the zoom level is not handled by the UI.
@@ -2979,6 +3189,47 @@ export declare class SceneAPI {
2979
3189
  * @returns A promise that resolves once the zoom was set or rejects with an error otherwise.
2980
3190
  */
2981
3191
  zoomToBlock(id: DesignBlockId, paddingLeft?: number, paddingTop?: number, paddingRight?: number, paddingBottom?: number): Promise<void>;
3192
+ /**
3193
+ * Continually adjusts the zoom level to fit the width or height of a block's axis-aligned bounding box.
3194
+ * Only has an effect if the zoom level is not handled by the UI.
3195
+ * Without padding, this results in a tight view on the block.
3196
+ * No more than one block per scene can have zoom auto-fit enabled.
3197
+ * Calling `setZoomLevel` or `zoomToBlock` disables the continuous adjustment.
3198
+ *
3199
+ * @param id - The block for which the zoom is adjusted.
3200
+ * @param axis - The block axis for which the zoom is adjusted.
3201
+ * @param paddingBefore - Optional padding in screen pixels before the block.
3202
+ * @param paddingAfter - Optional padding in screen pixels after the block.
3203
+ */
3204
+ enableZoomAutoFit(id: DesignBlockId, axis: 'Horizontal' | 'Vertical', paddingBefore?: number, paddingAfter?: number): void;
3205
+ /**
3206
+ * Continually adjusts the zoom level to fit the width or height of a block's axis-aligned bounding box.
3207
+ * Only has an effect if the zoom level is not handled by the UI.
3208
+ * Without padding, this results in a tight view on the block.
3209
+ * Calling `setZoomLevel` or `zoomToBlock` disables the continuous adjustment.
3210
+ *
3211
+ * @param id - The block for which the zoom is adjusted.
3212
+ * @param axis - The block axis for which the zoom is adjusted.
3213
+ * @param paddingLeft - Optional padding in screen pixels to the left of the block.
3214
+ * @param paddingTop - Optional padding in screen pixels to the top of the block.
3215
+ * @param paddingRight - Optional padding in screen pixels to the right of the block.
3216
+ * @param paddingBottom - Optional padding in screen pixels to the bottom of the block.
3217
+ */
3218
+ enableZoomAutoFit(id: DesignBlockId, axis: 'Both', paddingLeft?: number, paddingTop?: number, paddingRight?: number, paddingBottom?: number): void;
3219
+ /**
3220
+ * Disables any previously set zoom auto-fit.
3221
+ *
3222
+ * @param blockOrScene - The scene or a block in the scene for which to disable a zoom auto-fit.
3223
+ */
3224
+ disableZoomAutoFit(blockOrScene: DesignBlockId): void;
3225
+ /**
3226
+ * Queries whether zoom auto-fit is enabled.
3227
+ *
3228
+ * @param blockOrScene - The scene or a block in the scene for which to disable a zoom auto-fit.
3229
+ * @returns True if the given block has auto-fit set or the scene contains a block for which auto-fit is set, false
3230
+ * otherwise.
3231
+ */
3232
+ isZoomAutoFitEnabled(blockOrScene: DesignBlockId): boolean;
2982
3233
  /**
2983
3234
  * Subscribe to changes to the zoom level.
2984
3235
  * @param callback - This function is called at the end of the engine update, if the zoom level has changed.
@@ -3023,11 +3274,12 @@ export declare type SceneMode = 'Design' | 'Video';
3023
3274
  export declare class SelectionChannel implements ReadWriteChannelSync<number[]> {
3024
3275
  #private;
3025
3276
  subscribe: Source<number[]>;
3277
+ update: (selectedDesignElements: number[]) => void;
3278
+ value: () => number[];
3279
+ blocks: ChannelSync<Block[]>;
3026
3280
 
3027
3281
  private deselectAll;
3028
3282
  private selectAll;
3029
- update: (selectedDesignElements: number[]) => void;
3030
- value: () => number[];
3031
3283
  }
3032
3284
 
3033
3285
  /** @public */
@@ -3079,6 +3331,12 @@ export declare type StrokeStyle = 'Dashed' | 'DashedRound' | 'Dotted' | 'LongDas
3079
3331
  /** @public */
3080
3332
  declare type Subscription = number;
3081
3333
 
3334
+ /**
3335
+ * Checks if the current browser supports necessary technologies to match our supported browsers
3336
+ * @public
3337
+ */
3338
+ export declare function supportsBrowser(): boolean;
3339
+
3082
3340
  /**
3083
3341
  * Checks if the current browser supports video editing
3084
3342
  * @public
@@ -3176,15 +3434,14 @@ export declare interface Vec4 {
3176
3434
  }
3177
3435
 
3178
3436
  /**
3179
- * This channel allows to subscribe/update the current zoom level of the camera.
3437
+ * Describes a rectangle on the screen
3438
+ * - `x` and `y` indicate the position
3439
+ * - `w` and `h` indicate the width and height
3180
3440
  * @public
3181
3441
  */
3182
- export declare class ZoomLevelChannel implements ReadWriteChannelSync<number> {
3183
- #private;
3184
- subscribe: Source<number>;
3442
+ export declare type XYWH = [x: number, y: number, w: number, h: number];
3185
3443
 
3186
- update: (zoomLevel: number) => void;
3187
- value: () => number;
3188
- }
3444
+ /** @public */
3445
+ export declare type ZoomAutoFitAxis = 'Horizontal' | 'Vertical' | 'Both';
3189
3446
 
3190
3447
  export { }