@cesdk/engine 1.58.0-nightly.20250801 → 1.58.0-nightly.20250807

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
@@ -1390,6 +1390,10 @@ export declare class BlockAPI {
1390
1390
  * @category Block Lifecycle
1391
1391
  * @param blocks - The blocks to save.
1392
1392
  * @param allowedResourceSchemes - The resource schemes to allow in the saved string. Defaults to ['buffer', 'http', 'https'].
1393
+ * @param onDisallowedResourceScheme - An optional callback that is called for each resource URL that has a scheme absent from
1394
+ * `resourceSchemesAllowed`. The `url` parameter is the resource URL and the `dataHash` parameter is the hash of the
1395
+ * resource's data. The callback should return a new URL for the resource, which will be used in the serialized
1396
+ * scene. The callback is expected to return the original URL if no persistence is needed.
1393
1397
  * @returns A promise that resolves to a string representing the blocks or an error.
1394
1398
  * @example
1395
1399
  * ```typescript
@@ -1402,7 +1406,7 @@ export declare class BlockAPI {
1402
1406
  * const serialized = await engine.block.saveToString([page]);
1403
1407
  * ```
1404
1408
  */
1405
- saveToString(blocks: DesignBlockId[], allowedResourceSchemes?: string[]): Promise<string>;
1409
+ saveToString(blocks: DesignBlockId[], allowedResourceSchemes?: string[], onDisallowedResourceScheme?: (url: string, dataHash: string) => Promise<string>): Promise<string>;
1406
1410
  /**
1407
1411
  * Saves the given blocks and their assets to a zip archive.
1408
1412
  *
@@ -7303,9 +7307,10 @@ export declare class SceneAPI {
7303
7307
  *
7304
7308
  * @category Scene Loading
7305
7309
  * @param sceneContent - The scene file contents, a base64 string.
7310
+ * @param overrideEditorConfig - Whether to override editor configuration with settings and data from the scene file. Defaults to false.
7306
7311
  * @returns A handle to the loaded scene.
7307
7312
  */
7308
- loadFromString(sceneContent: string): Promise<DesignBlockId>;
7313
+ loadFromString(sceneContent: string, overrideEditorConfig?: boolean): Promise<DesignBlockId>;
7309
7314
  /**
7310
7315
  * Load a scene from the URL to the scene file.
7311
7316
  *
@@ -7318,9 +7323,10 @@ export declare class SceneAPI {
7318
7323
  *
7319
7324
  * @category Scene Loading
7320
7325
  * @param url - The URL of the scene file.
7326
+ * @param overrideEditorConfig - Whether to override editor configuration with settings and data from the scene file. Defaults to false.
7321
7327
  * @returns scene A promise that resolves once the scene was loaded or rejects with an error otherwise.
7322
7328
  */
7323
- loadFromURL(url: string): Promise<DesignBlockId>;
7329
+ loadFromURL(url: string, overrideEditorConfig?: boolean): Promise<DesignBlockId>;
7324
7330
  /**
7325
7331
  * Load a previously archived scene from the URL to the scene file.
7326
7332
  *
@@ -7329,16 +7335,22 @@ export declare class SceneAPI {
7329
7335
  *
7330
7336
  * @category Scene Loading
7331
7337
  * @param url - The URL of the scene file.
7338
+ * @param overrideEditorConfig - Whether to override editor configuration with settings and data from the scene file. Defaults to false.
7332
7339
  * @returns scene A promise that resolves once the scene was loaded or rejects with an error otherwise.
7333
7340
  */
7334
- loadFromArchiveURL(url: string): Promise<DesignBlockId>;
7341
+ loadFromArchiveURL(url: string, overrideEditorConfig?: boolean): Promise<DesignBlockId>;
7335
7342
  /**
7336
7343
  * Serializes the current scene into a string. Selection is discarded.
7337
7344
  *
7338
7345
  * @category Scene Saving
7346
+ * @param allowedResourceSchemes - The resource schemes to allow in the saved string. Defaults to ['blob', 'bundle', 'file', 'http', 'https', 'opfs'].
7347
+ * @param onDisallowedResourceScheme - An optional callback that is called for each resource URL that has a scheme absent from
7348
+ * `resourceSchemesAllowed`. The `url` parameter is the resource URL and the `dataHash` parameter is the hash of the
7349
+ * resource's data. The callback should return a new URL for the resource, which will be used in the serialized
7350
+ * scene. The callback is expected to return the original URL if no persistence is needed.
7339
7351
  * @returns A promise that resolves with a string on success or an error on failure.
7340
7352
  */
7341
- saveToString(allowedResourceSchemes?: string[]): Promise<string>;
7353
+ saveToString(allowedResourceSchemes?: string[], onDisallowedResourceScheme?: (url: string, dataHash: string) => Promise<string>): Promise<string>;
7342
7354
  /**
7343
7355
  * Saves the current scene and all of its referenced assets into an archive.
7344
7356
  *