@cesdk/node 1.64.0-nightly.20251104 → 1.64.0-nightly.20251105
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.64.0-nightly.20251104-RE4TDMG6.wasm → cesdk-v1.64.0-nightly.20251105-EI2EU6XZ.wasm} +0 -0
- package/index.d.ts +43 -24
- package/index.js +1 -1
- package/package.json +1 -1
- /package/assets/core/{cesdk-v1.64.0-nightly.20251104-44YCFRT6.data → cesdk-v1.64.0-nightly.20251105-44YCFRT6.data} +0 -0
|
Binary file
|
package/index.d.ts
CHANGED
|
@@ -357,13 +357,20 @@ export declare class AssetAPI {
|
|
|
357
357
|
* and an `assets` array with asset definitions. Each asset should have an `id`, localized `label` object,
|
|
358
358
|
* and a `meta` object containing asset-specific properties like `uri`, `thumbUri`, `blockType`, etc.
|
|
359
359
|
*
|
|
360
|
+
* Optionally, you can provide a `basePath` for resolving relative URLs and additional options including a
|
|
361
|
+
* `matcher` array to filter which assets are loaded based on their IDs. The matcher patterns support wildcard
|
|
362
|
+
* matching using `*`. If multiple patterns are provided, an asset is included if it matches ANY of the patterns.
|
|
363
|
+
*
|
|
360
364
|
* @category Asset Source Management
|
|
361
365
|
* @param contentJSON - The JSON string containing the asset definitions.
|
|
362
366
|
* @param basePath - An optional base path with which \{\{base_url\}\} strings in the assets should be replaced. If no value is provided, settings.basePath is used.
|
|
367
|
+
* @param options - Optional configuration:
|
|
368
|
+
* - `matcher`: Array of patterns to filter assets by ID. Supports `*` wildcard. An asset is included if it matches ANY pattern.
|
|
363
369
|
* @returns The ID of the newly created asset source (as specified in the JSON's `id` field).
|
|
364
370
|
*
|
|
365
371
|
* @example
|
|
366
372
|
* ```javascript
|
|
373
|
+
* // Load all assets from JSON
|
|
367
374
|
* const json = JSON.stringify({
|
|
368
375
|
* "version": "2.0.0",
|
|
369
376
|
* "id": "my.custom.assets",
|
|
@@ -381,9 +388,31 @@ export declare class AssetAPI {
|
|
|
381
388
|
* });
|
|
382
389
|
* const sourceId = await engine.asset.addLocalAssetSourceFromJSONString(json);
|
|
383
390
|
* console.log('Created asset source:', sourceId); // "my.custom.assets"
|
|
391
|
+
*
|
|
392
|
+
* // Load with custom base path
|
|
393
|
+
* const sourceId2 = await engine.asset.addLocalAssetSourceFromJSONString(
|
|
394
|
+
* json,
|
|
395
|
+
* 'https://example.com/'
|
|
396
|
+
* );
|
|
397
|
+
*
|
|
398
|
+
* // Load only assets matching one of the patterns
|
|
399
|
+
* const sourceId3 = await engine.asset.addLocalAssetSourceFromJSONString(
|
|
400
|
+
* json,
|
|
401
|
+
* undefined,
|
|
402
|
+
* { matcher: ['sample_*', '*_asset'] }
|
|
403
|
+
* );
|
|
404
|
+
*
|
|
405
|
+
* // Load with custom base path and matcher
|
|
406
|
+
* const sourceId4 = await engine.asset.addLocalAssetSourceFromJSONString(
|
|
407
|
+
* json,
|
|
408
|
+
* 'https://example.com/',
|
|
409
|
+
* { matcher: ['portrait_*', 'landscape_*'] }
|
|
410
|
+
* );
|
|
384
411
|
* ```
|
|
385
412
|
*/
|
|
386
|
-
addLocalAssetSourceFromJSONString(contentJSON: string, basePath?: string
|
|
413
|
+
addLocalAssetSourceFromJSONString(contentJSON: string, basePath?: string, options?: {
|
|
414
|
+
matcher?: string[];
|
|
415
|
+
}): Promise<string>;
|
|
387
416
|
/**
|
|
388
417
|
* Creates a new local asset source from a JSON URI.
|
|
389
418
|
*
|
|
@@ -397,38 +426,28 @@ export declare class AssetAPI {
|
|
|
397
426
|
*
|
|
398
427
|
* @category Asset Source Management
|
|
399
428
|
* @param contentURI - The URI for the JSON file to load and parse.
|
|
429
|
+
* @param options - Optional configuration:
|
|
430
|
+
* - `matcher`: Array of patterns to filter assets by ID. Supports `*` wildcard. An asset is included if it matches ANY pattern.
|
|
400
431
|
* @returns The ID of the newly created asset source (as specified in the JSON's `id` field).
|
|
401
432
|
*
|
|
402
433
|
* @example
|
|
403
434
|
* ```javascript
|
|
404
|
-
* // Load audio assets from IMG.LY's CDN
|
|
435
|
+
* // Load all audio assets from IMG.LY's CDN
|
|
405
436
|
* const sourceId = await engine.asset.addLocalAssetSourceFromJSONURI(
|
|
406
437
|
* 'https://cdn.img.ly/assets/demo/v2/ly.img.audio/content.json'
|
|
407
438
|
* );
|
|
408
439
|
* console.log('Loaded asset source:', sourceId); // "ly.img.audio"
|
|
409
440
|
*
|
|
410
|
-
* //
|
|
411
|
-
*
|
|
412
|
-
*
|
|
413
|
-
*
|
|
414
|
-
*
|
|
415
|
-
*
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
* // "label": { "en": "Dance Harder" },
|
|
421
|
-
* // "meta": {
|
|
422
|
-
* // "uri": "https://cdn.img.ly/.../dance_harder.m4a",
|
|
423
|
-
* // "blockType": "//ly.img.ubq/audio",
|
|
424
|
-
* // "mimeType": "audio/x-m4a"
|
|
425
|
-
* // }
|
|
426
|
-
* // }
|
|
427
|
-
* // ]
|
|
428
|
-
* // }
|
|
429
|
-
* ```
|
|
430
|
-
*/
|
|
431
|
-
addLocalAssetSourceFromJSONURI(contentURI: string): Promise<string>;
|
|
441
|
+
* // Load only assets matching one of the patterns
|
|
442
|
+
* const sourceId2 = await engine.asset.addLocalAssetSourceFromJSONURI(
|
|
443
|
+
* 'https://cdn.img.ly/assets/demo/v2/ly.img.image/content.json',
|
|
444
|
+
* { matcher: ['image-portrait-*', 'image-landscape-*'] }
|
|
445
|
+
* );
|
|
446
|
+
* ```
|
|
447
|
+
*/
|
|
448
|
+
addLocalAssetSourceFromJSONURI(contentURI: string, options?: {
|
|
449
|
+
matcher?: string[];
|
|
450
|
+
}): Promise<string>;
|
|
432
451
|
/**
|
|
433
452
|
* Remove a registered asset source.
|
|
434
453
|
*
|