@cesdk/node 1.70.0-nightly.20260219 → 1.70.0-nightly.20260221
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.70.0-nightly.20260219-H6QDP5AO.wasm → cesdk-v1.70.0-nightly.20260221-7YNNUXTO.wasm} +0 -0
- package/index.d.ts +120 -2
- package/index.js +1 -1
- package/package.json +1 -1
- /package/assets/core/{cesdk-v1.70.0-nightly.20260219-MLEZSZ4D.data → cesdk-v1.70.0-nightly.20260221-MLEZSZ4D.data} +0 -0
|
Binary file
|
package/index.d.ts
CHANGED
|
@@ -5737,6 +5737,25 @@ export declare interface CompleteAssetResult extends AssetResult {
|
|
|
5737
5737
|
active: boolean;
|
|
5738
5738
|
}
|
|
5739
5739
|
|
|
5740
|
+
/**
|
|
5741
|
+
* Compression format for scene serialization.
|
|
5742
|
+
* @public
|
|
5743
|
+
*/
|
|
5744
|
+
export declare enum CompressionFormat {
|
|
5745
|
+
None = 0,
|
|
5746
|
+
Zstd = 1
|
|
5747
|
+
}
|
|
5748
|
+
|
|
5749
|
+
/**
|
|
5750
|
+
* Compression level for scene serialization.
|
|
5751
|
+
* @public
|
|
5752
|
+
*/
|
|
5753
|
+
export declare enum CompressionLevel {
|
|
5754
|
+
Fastest = 0,
|
|
5755
|
+
Default = 1,
|
|
5756
|
+
Best = 2
|
|
5757
|
+
}
|
|
5758
|
+
|
|
5740
5759
|
/**
|
|
5741
5760
|
* Specifies the configuration for the Creative Editor SDK.
|
|
5742
5761
|
*
|
|
@@ -6849,6 +6868,25 @@ export declare class EditorAPI {
|
|
|
6849
6868
|
* @throws Error if the resource cannot be downloaded or MIME type determined.
|
|
6850
6869
|
*/
|
|
6851
6870
|
getMimeType(uri: string): Promise<string>;
|
|
6871
|
+
/**
|
|
6872
|
+
* Gets the font metrics for a given font file URI.
|
|
6873
|
+
*
|
|
6874
|
+
* If the font is not yet loaded, it will be fetched asynchronously.
|
|
6875
|
+
* The returned metrics are in the font's design units coordinate space.
|
|
6876
|
+
*
|
|
6877
|
+
* ```javascript
|
|
6878
|
+
* const metrics = await engine.editor.getFontMetrics('/extensions/ly.img.cesdk.fonts/fonts/Roboto/Roboto-Regular.ttf');
|
|
6879
|
+
* console.log(metrics.ascender, metrics.descender, metrics.unitsPerEm);
|
|
6880
|
+
* console.log(metrics.lineGap);
|
|
6881
|
+
* console.log(metrics.capHeight, metrics.xHeight);
|
|
6882
|
+
* console.log(metrics.underlineOffset, metrics.underlineSize, metrics.strikeoutOffset, metrics.strikeoutSize);
|
|
6883
|
+
* ```
|
|
6884
|
+
*
|
|
6885
|
+
* @category Resource Management
|
|
6886
|
+
* @param fontFileUri - The URI of the font file to get metrics from.
|
|
6887
|
+
* @returns A promise resolving to the font metrics.
|
|
6888
|
+
*/
|
|
6889
|
+
getFontMetrics(fontFileUri: string): Promise<FontMetrics>;
|
|
6852
6890
|
/**
|
|
6853
6891
|
* Get all transient resources that would be lost during export.
|
|
6854
6892
|
*
|
|
@@ -7236,6 +7274,34 @@ export declare interface Font {
|
|
|
7236
7274
|
style?: FontStyle;
|
|
7237
7275
|
}
|
|
7238
7276
|
|
|
7277
|
+
/**
|
|
7278
|
+
* Font metrics extracted from a font file.
|
|
7279
|
+
* Values are in the font's design units coordinate space.
|
|
7280
|
+
* @public
|
|
7281
|
+
*/
|
|
7282
|
+
export declare interface FontMetrics {
|
|
7283
|
+
/** The ascender value in font design units. */
|
|
7284
|
+
ascender: number;
|
|
7285
|
+
/** The descender value in font design units (typically negative). */
|
|
7286
|
+
descender: number;
|
|
7287
|
+
/** The number of units per em square (typically 1000 or 2048). */
|
|
7288
|
+
unitsPerEm: number;
|
|
7289
|
+
/** The OS/2 sTypoLineGap value in font design units. */
|
|
7290
|
+
lineGap: number;
|
|
7291
|
+
/** The OS/2 sCapHeight value in font design units. */
|
|
7292
|
+
capHeight: number;
|
|
7293
|
+
/** The OS/2 sxHeight value in font design units. */
|
|
7294
|
+
xHeight: number;
|
|
7295
|
+
/** The post.underlinePosition value in font design units (typically negative). */
|
|
7296
|
+
underlineOffset: number;
|
|
7297
|
+
/** The post.underlineThickness value in font design units. */
|
|
7298
|
+
underlineSize: number;
|
|
7299
|
+
/** The OS/2 yStrikeoutPosition value in font design units. */
|
|
7300
|
+
strikeoutOffset: number;
|
|
7301
|
+
/** The OS/2 yStrikeoutSize value in font design units. */
|
|
7302
|
+
strikeoutSize: number;
|
|
7303
|
+
}
|
|
7304
|
+
|
|
7239
7305
|
/**
|
|
7240
7306
|
* Extended design unit type that includes Point for font size operations.
|
|
7241
7307
|
* Maintains consistency with SceneDesignUnit's capitalized naming convention.
|
|
@@ -7636,6 +7702,34 @@ export declare interface RGBColor {
|
|
|
7636
7702
|
*/
|
|
7637
7703
|
export declare type RoleString = 'Creator' | 'Adopter' | 'Viewer' | 'Presenter';
|
|
7638
7704
|
|
|
7705
|
+
/**
|
|
7706
|
+
* Options for saveSceneToString operation.
|
|
7707
|
+
* @public
|
|
7708
|
+
*/
|
|
7709
|
+
declare interface SaveToStringOptions {
|
|
7710
|
+
/**
|
|
7711
|
+
* List of resource URL schemes that are allowed in the serialized scene.
|
|
7712
|
+
* Resources with other schemes will trigger the persistence callback.
|
|
7713
|
+
*/
|
|
7714
|
+
resourceSchemesAllowed?: string[];
|
|
7715
|
+
/**
|
|
7716
|
+
* Optional callback for persisting resources with disallowed schemes.
|
|
7717
|
+
*/
|
|
7718
|
+
persistenceCallback?: (url: string, dataHash: string, persistedCallback?: {
|
|
7719
|
+
invoke(url: string, persistedUrl: string): void;
|
|
7720
|
+
}) => void;
|
|
7721
|
+
/**
|
|
7722
|
+
* Compression options for the serialized scene.
|
|
7723
|
+
* When compression is enabled, base64 encoding is skipped and raw binary data is returned.
|
|
7724
|
+
*/
|
|
7725
|
+
compression?: {
|
|
7726
|
+
/** Compression format (None = no compression, Zstd = zstd compression) */
|
|
7727
|
+
format?: CompressionFormat;
|
|
7728
|
+
/** Compression level (Fastest, Default, Best) */
|
|
7729
|
+
level?: CompressionLevel;
|
|
7730
|
+
};
|
|
7731
|
+
}
|
|
7732
|
+
|
|
7639
7733
|
/**
|
|
7640
7734
|
* @public Create, load, save, and manipulate scenes.
|
|
7641
7735
|
*
|
|
@@ -7724,14 +7818,38 @@ export declare class SceneAPI {
|
|
|
7724
7818
|
* Serializes the current scene into a string. Selection is discarded.
|
|
7725
7819
|
*
|
|
7726
7820
|
* @category Scene Saving
|
|
7727
|
-
* @param allowedResourceSchemes - The resource schemes to allow in the saved string.
|
|
7821
|
+
* @param allowedResourceSchemes - The resource schemes to allow in the saved string.
|
|
7728
7822
|
* @param onDisallowedResourceScheme - An optional callback that is called for each resource URL that has a scheme absent from
|
|
7729
7823
|
* `resourceSchemesAllowed`. The `url` parameter is the resource URL and the `dataHash` parameter is the hash of the
|
|
7730
7824
|
* resource's data. The callback should return a new URL for the resource, which will be used in the serialized
|
|
7731
7825
|
* scene. The callback is expected to return the original URL if no persistence is needed.
|
|
7732
7826
|
* @returns A promise that resolves with a string on success or an error on failure.
|
|
7827
|
+
* @deprecated Use saveToString(options) instead for better extensibility and to access compression features.
|
|
7828
|
+
*/
|
|
7829
|
+
saveToString(allowedResourceSchemes: string[], onDisallowedResourceScheme?: (url: string, dataHash: string) => Promise<string>): Promise<string>;
|
|
7830
|
+
/**
|
|
7831
|
+
* Serializes the current scene into a string. Selection is discarded.
|
|
7832
|
+
*
|
|
7833
|
+
* @category Scene Saving
|
|
7834
|
+
* @param options - Save options containing:
|
|
7835
|
+
* - allowedResourceSchemes: The resource schemes to allow in the saved string. Defaults to ['blob', 'bundle', 'file', 'http', 'https', 'opfs'].
|
|
7836
|
+
* - onDisallowedResourceScheme: An optional callback that is called for each resource URL that has a scheme absent from
|
|
7837
|
+
* `resourceSchemesAllowed`. The `url` parameter is the resource URL and the `dataHash` parameter is the hash of the
|
|
7838
|
+
* resource's data. The callback should return a new URL for the resource, which will be used in the serialized
|
|
7839
|
+
* scene. The callback is expected to return the original URL if no persistence is needed.
|
|
7840
|
+
* - compression: Optional compression settings containing:
|
|
7841
|
+
* - format: Compression format (None or Zstd). Defaults to None.
|
|
7842
|
+
* - level: Compression level (Fastest, Default, or Best). Defaults to Default.
|
|
7843
|
+
* @returns A promise that resolves with a string on success or an error on failure.
|
|
7733
7844
|
*/
|
|
7734
|
-
saveToString(
|
|
7845
|
+
saveToString(options?: {
|
|
7846
|
+
allowedResourceSchemes?: string[];
|
|
7847
|
+
onDisallowedResourceScheme?: (url: string, dataHash: string) => Promise<string>;
|
|
7848
|
+
compression?: {
|
|
7849
|
+
format?: CompressionFormat;
|
|
7850
|
+
level?: CompressionLevel;
|
|
7851
|
+
};
|
|
7852
|
+
}): Promise<string>;
|
|
7735
7853
|
/**
|
|
7736
7854
|
* Saves the current scene and all of its referenced assets into an archive.
|
|
7737
7855
|
*
|