@cesdk/engine 1.62.0-nightly.20251008 → 1.62.0-nightly.20251010
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-v1.62.0-nightly.20251008-YG677TVR.wasm → cesdk-v1.62.0-nightly.20251010-KKZN7A5B.wasm} +0 -0
- package/assets/core/{worker-host-v1.62.0-nightly.20251008.js → worker-host-v1.62.0-nightly.20251010.js} +1 -1
- package/index.d.ts +45 -15
- package/index.js +1 -1
- package/package.json +1 -1
- /package/assets/core/{cesdk-v1.62.0-nightly.20251008-44YCFRT6.data → cesdk-v1.62.0-nightly.20251010-44YCFRT6.data} +0 -0
package/index.d.ts
CHANGED
|
@@ -128,6 +128,24 @@ export declare type AnimationTypeShorthand = 'slide' | 'pan' | 'fade' | 'blur' |
|
|
|
128
128
|
*/
|
|
129
129
|
export declare type ApplicationMimeType = Extract<MimeType_2, 'application/octet-stream' | 'application/pdf' | 'application/zip'>;
|
|
130
130
|
|
|
131
|
+
/**
|
|
132
|
+
* Options for applying an asset to the scene.
|
|
133
|
+
* @public
|
|
134
|
+
*/
|
|
135
|
+
export declare interface ApplyAssetOptions {
|
|
136
|
+
/**
|
|
137
|
+
* How the asset should be placed in the scene.
|
|
138
|
+
* - 'clip': Foreground clip placed at playhead
|
|
139
|
+
* - 'overlay': Background overlay placed on background track
|
|
140
|
+
*/
|
|
141
|
+
clipType?: 'clip' | 'overlay';
|
|
142
|
+
/**
|
|
143
|
+
* Additional custom context options.
|
|
144
|
+
* Allows passing arbitrary data to middleware for custom placement logic.
|
|
145
|
+
*/
|
|
146
|
+
[key: string]: unknown;
|
|
147
|
+
}
|
|
148
|
+
|
|
131
149
|
/**
|
|
132
150
|
* Generic asset information
|
|
133
151
|
* @public
|
|
@@ -169,9 +187,6 @@ export declare interface Asset {
|
|
|
169
187
|
*
|
|
170
188
|
* @categoryDescription Event Subscriptions
|
|
171
189
|
* Subscribe to asset source changes and lifecycle events.
|
|
172
|
-
*
|
|
173
|
-
* @categoryDescription Experimental Features
|
|
174
|
-
* Experimental middleware system for custom asset processing workflows.
|
|
175
190
|
*/
|
|
176
191
|
export declare class AssetAPI {
|
|
177
192
|
#private;
|
|
@@ -179,12 +194,17 @@ export declare class AssetAPI {
|
|
|
179
194
|
/**
|
|
180
195
|
* Register middleware that intercepts asset application to scenes.
|
|
181
196
|
*
|
|
182
|
-
* The middleware function receives the source ID, asset result,
|
|
197
|
+
* The middleware function receives the source ID, asset result, the original apply function,
|
|
198
|
+
* and a context object containing options about how the asset should be applied.
|
|
183
199
|
* It can perform custom logic before, after, or instead of the default asset application.
|
|
184
200
|
*
|
|
185
201
|
* @example
|
|
186
202
|
* ```ts
|
|
187
|
-
* engine.asset.
|
|
203
|
+
* engine.asset.registerApplyMiddleware(async (sourceId, assetResult, apply, context) => {
|
|
204
|
+
* // Access context to determine placement intent
|
|
205
|
+
* console.log('Clip type:', context.clipType); // 'clip', 'overlay', or undefined
|
|
206
|
+
* console.log('Custom data:', context.myCustomField); // Access custom fields
|
|
207
|
+
*
|
|
188
208
|
* // do something before applying the asset
|
|
189
209
|
* // You still have the choice to call apply or skip it
|
|
190
210
|
* const blockId = await apply(sourceId, assetResult);
|
|
@@ -193,12 +213,11 @@ export declare class AssetAPI {
|
|
|
193
213
|
* })
|
|
194
214
|
* ```
|
|
195
215
|
*
|
|
196
|
-
* @category
|
|
216
|
+
* @category Asset Application
|
|
197
217
|
* @param middleware - The middleware function that is called before applying the asset.
|
|
198
218
|
* @returns A function that can be used to remove the middleware.
|
|
199
|
-
* @experimental This API is experimental and may change or be removed in future versions.
|
|
200
219
|
*/
|
|
201
|
-
|
|
220
|
+
registerApplyMiddleware(middleware: (sourceId: string, assetResult: AssetResult, apply: AssetAPI['apply'], context: ApplyAssetOptions) => Promise<DesignBlockId | undefined>): VoidFunction;
|
|
202
221
|
/**
|
|
203
222
|
* Register middleware that intercepts asset application to specific blocks.
|
|
204
223
|
*
|
|
@@ -207,7 +226,7 @@ export declare class AssetAPI {
|
|
|
207
226
|
*
|
|
208
227
|
* @example
|
|
209
228
|
* ```ts
|
|
210
|
-
* engine.asset.
|
|
229
|
+
* engine.asset.registerApplyToBlockMiddleware(async (sourceId, assetResult, block, applyToBlock) => {
|
|
211
230
|
* // do something before applying the asset
|
|
212
231
|
* // You still have the choice to call applyToBlock or skip it
|
|
213
232
|
* await applyToBlock(sourceId, assetResult, block);
|
|
@@ -215,12 +234,11 @@ export declare class AssetAPI {
|
|
|
215
234
|
* })
|
|
216
235
|
* ```
|
|
217
236
|
*
|
|
218
|
-
* @category
|
|
237
|
+
* @category Asset Application
|
|
219
238
|
* @param middleware - The middleware function that is called before applying the asset.
|
|
220
239
|
* @returns A function that can be used to remove the middleware.
|
|
221
|
-
* @experimental This API is experimental and may change or be removed in future versions.
|
|
222
240
|
*/
|
|
223
|
-
|
|
241
|
+
registerApplyToBlockMiddleware(middleware: (sourceId: string, assetResult: AssetResult, block: DesignBlockId, applyToBlock: AssetAPI['applyToBlock']) => Promise<void>): VoidFunction;
|
|
224
242
|
/**
|
|
225
243
|
* Add a custom asset source with unique ID.
|
|
226
244
|
*
|
|
@@ -525,18 +543,30 @@ export declare class AssetAPI {
|
|
|
525
543
|
* Apply an asset to the active scene.
|
|
526
544
|
*
|
|
527
545
|
* Creates a new block configured according to the asset's properties and adds it to the scene.
|
|
528
|
-
* The behavior can be customized by providing an `applyAsset` function when registering the asset source
|
|
546
|
+
* The behavior can be customized by providing an `applyAsset` function when registering the asset source,
|
|
547
|
+
* or by passing context options to guide middleware behavior.
|
|
529
548
|
*
|
|
549
|
+
* @example
|
|
530
550
|
* ```javascript
|
|
551
|
+
* // Default behavior
|
|
531
552
|
* await engine.asset.apply('asset-source-id', assetResult.assets[0]);
|
|
532
553
|
* ```
|
|
533
554
|
*
|
|
555
|
+
* @example
|
|
556
|
+
* ```javascript
|
|
557
|
+
* // Background overlay placement
|
|
558
|
+
* await engine.asset.apply('asset-source-id', assetResult.assets[0], {
|
|
559
|
+
* clipType: 'overlay'
|
|
560
|
+
* });
|
|
561
|
+
* ```
|
|
562
|
+
*
|
|
534
563
|
* @category Asset Application
|
|
535
564
|
* @param sourceId - The ID of the asset source.
|
|
536
565
|
* @param assetResult - A single asset result from a `findAssets` query.
|
|
566
|
+
* @param options - Optional configuration for asset application.
|
|
537
567
|
* @returns Promise resolving to the created block ID, or undefined if no block was created.
|
|
538
568
|
*/
|
|
539
|
-
apply(sourceId: string, assetResult: AssetResult): Promise<DesignBlockId | undefined>;
|
|
569
|
+
apply(sourceId: string, assetResult: AssetResult, options?: ApplyAssetOptions): Promise<DesignBlockId | undefined>;
|
|
540
570
|
/**
|
|
541
571
|
* Apply an asset to a specific block.
|
|
542
572
|
*
|
|
@@ -5271,10 +5301,10 @@ export declare class BlockAPI {
|
|
|
5271
5301
|
* This is useful for organizing content in video scenes where you want
|
|
5272
5302
|
* certain elements to be part of the background layer.
|
|
5273
5303
|
* The background track is the track that determines the page duration.
|
|
5304
|
+
* If no background track exists, one will be created automatically.
|
|
5274
5305
|
*
|
|
5275
5306
|
* @category Helper
|
|
5276
5307
|
* @param block - The ID of the block to move to the background track
|
|
5277
|
-
* @throws Error if no background track is found
|
|
5278
5308
|
*/
|
|
5279
5309
|
moveToBackgroundTrack(block: DesignBlockId): void;
|
|
5280
5310
|
}
|