@cesdk/cesdk-js 1.10.0 → 1.11.0-preview.0
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.10.0.wasm → cesdk-v1.11.0-preview.0.wasm} +0 -0
- package/assets/i18n/de.json +28 -10
- package/assets/i18n/en.json +16 -10
- package/assets/ui/stylesheets/cesdk.css +10 -10
- package/cesdk.umd.js +1 -1
- package/index.d.ts +228 -65
- package/package.json +1 -1
- /package/assets/core/{cesdk-v1.10.0.data → cesdk-v1.11.0-preview.0.data} +0 -0
package/index.d.ts
CHANGED
|
@@ -554,17 +554,13 @@ export declare class BlockAPI {
|
|
|
554
554
|
/**
|
|
555
555
|
* Exports a design block as a video file of the given mime type.
|
|
556
556
|
* Note: The export will run across multiple iterations of the update loop. In each iteration a frame is scheduled for encoding.
|
|
557
|
-
* @param
|
|
558
|
-
* @param timeOffset - The time offset in seconds of the scene's timeline from which the video will start.
|
|
559
|
-
* @param duration - The duration in seconds of the final video.
|
|
557
|
+
* @param handle - The design block element to export. Currently, only the scene block is supported.
|
|
560
558
|
* @param mimeType - The mime type of the output video file.
|
|
561
|
-
* @param resolutionWidth - The target video width in pixel.
|
|
562
|
-
* @param resolutionHeight - The target video height in pixel.
|
|
563
|
-
* @param framerate - The target framerate in Hz.
|
|
564
559
|
* @param progressCallback - A callback which reports on the progress of the export. It informs the receiver of the current frame index, which currently gets exported and the total frame count.
|
|
560
|
+
* @param options - The options for exporting the video
|
|
565
561
|
* @returns A promise that resolves with video blob or is rejected with an error.
|
|
566
562
|
*/
|
|
567
|
-
exportVideo(handle: DesignBlockId,
|
|
563
|
+
exportVideo(handle: DesignBlockId, mimeType: MimeType_2 | undefined, progressCallback: (numberOfRenderedFrames: number, numberOfEncodedFrames: number, totalNumberOfFrames: number) => void, options: VideoExportOptions): Promise<Blob>;
|
|
568
564
|
/**
|
|
569
565
|
* Loads existing blocks from the given string.
|
|
570
566
|
* The blocks are not attached by default and won't be visible until attached to a page or the scene.
|
|
@@ -884,7 +880,7 @@ export declare class BlockAPI {
|
|
|
884
880
|
/**
|
|
885
881
|
* Set a block's mode for its width.
|
|
886
882
|
* @param id - The block to update.
|
|
887
|
-
* @param mode - The width mode:
|
|
883
|
+
* @param mode - The width mode: Absolute, Percent or Auto.
|
|
888
884
|
*/
|
|
889
885
|
setWidthMode(id: DesignBlockId, mode: SizeMode): void;
|
|
890
886
|
/**
|
|
@@ -896,7 +892,7 @@ export declare class BlockAPI {
|
|
|
896
892
|
/**
|
|
897
893
|
* Set a block's mode for its height.
|
|
898
894
|
* @param id - The block to update.
|
|
899
|
-
* @param mode - The height mode:
|
|
895
|
+
* @param mode - The height mode: Absolute, Percent or Auto.
|
|
900
896
|
*/
|
|
901
897
|
setHeightMode(id: DesignBlockId, mode: SizeMode): void;
|
|
902
898
|
/**
|
|
@@ -1184,14 +1180,14 @@ export declare class BlockAPI {
|
|
|
1184
1180
|
* @param property - The name of the property to set.
|
|
1185
1181
|
* @param value - The enum value as string.
|
|
1186
1182
|
*/
|
|
1187
|
-
setEnum(id: DesignBlockId, property: string, value:
|
|
1183
|
+
setEnum<T extends string = string>(id: DesignBlockId, property: string, value: T): void;
|
|
1188
1184
|
/**
|
|
1189
1185
|
* Get the value of an enum property of the given design block.
|
|
1190
1186
|
* @param id - The block whose property should be queried.
|
|
1191
1187
|
* @param property - The name of the property to query.
|
|
1192
1188
|
* @returns The value as string.
|
|
1193
1189
|
*/
|
|
1194
|
-
getEnum(id: DesignBlockId, property: string):
|
|
1190
|
+
getEnum<T extends string = string>(id: DesignBlockId, property: string): T;
|
|
1195
1191
|
/**
|
|
1196
1192
|
* Query if the given block has crop properties.
|
|
1197
1193
|
* @param id - The block to query.
|
|
@@ -1723,6 +1719,69 @@ export declare class BlockAPI {
|
|
|
1723
1719
|
* @returns The drop shadow's clipping.
|
|
1724
1720
|
*/
|
|
1725
1721
|
getDropShadowClip(id: DesignBlockId): boolean;
|
|
1722
|
+
/**
|
|
1723
|
+
* Inserts the given text into the selected range of the text block.
|
|
1724
|
+
* @param block - The text block into which to insert the given text.
|
|
1725
|
+
* @param text - The text which should replace the selected range in the block.
|
|
1726
|
+
* @param from - The start index of the UTF-16 range that should be replaced.
|
|
1727
|
+
* If the value is negative, this will fall back to the start of the entire text range.
|
|
1728
|
+
* @param to - The UTF-16 index after the last grapheme that should be replaced by the inserted text.
|
|
1729
|
+
* If `from` and `to` are negative, a this will fall back to the end of the entire text range, so the entire text will be replaced.
|
|
1730
|
+
* If `to` is negative but `from` is greater than or equal to 0, the text will be inserted at the index defined by `from`.
|
|
1731
|
+
*/
|
|
1732
|
+
replaceText(id: DesignBlockId, text: string, from?: number, to?: number): void;
|
|
1733
|
+
/**
|
|
1734
|
+
* Removes selected range of text of the given text block.
|
|
1735
|
+
* @param block - The text block from which the selected text should be removed.
|
|
1736
|
+
* @param from - The start index of the UTF-16 range that should be removed.
|
|
1737
|
+
* If the value is negative, this will fall back to the start of the entire text range.
|
|
1738
|
+
* @param to - The UTF-16 index after the last grapheme that should be removed.
|
|
1739
|
+
* If the value is negative, this will fall back to the end of the entire text range.
|
|
1740
|
+
*/
|
|
1741
|
+
removeText(id: DesignBlockId, from?: number, to?: number): void;
|
|
1742
|
+
/**
|
|
1743
|
+
* Changes the color of the text in the selected range to the given color.
|
|
1744
|
+
* @param block - The text block whose color should be changed.
|
|
1745
|
+
* @param color - The new color of the selected text range.
|
|
1746
|
+
* @param from - The start index of the UTF-16 range whose color should be changed.
|
|
1747
|
+
* If the value is negative and the block is currently being edited, this will fall back to the start of the current cursor index / selected grapheme range.
|
|
1748
|
+
* If the value is negative and the block is not being edited, this will fall back to the start of the entire text range.
|
|
1749
|
+
* @param to - The UTF-16 index after the last grapheme whose color should be changed.
|
|
1750
|
+
* If the value is negative and the block is currently being edited, this will fall back to the end of the current cursor index / selected grapheme range.
|
|
1751
|
+
* If the value is negative and the block is not being edited, this will fall back to the end of the entire text range.
|
|
1752
|
+
*/
|
|
1753
|
+
setTextColor(id: DesignBlockId, color: RGBAColor | SpotColor, from?: number, to?: number): void;
|
|
1754
|
+
/**
|
|
1755
|
+
* Returns the ordered unique list of colors of the text in the selected range.
|
|
1756
|
+
* @param block - The text block whose colors should be returned.
|
|
1757
|
+
* @param from - The start index of the UTF-16 range whose colors should be returned.
|
|
1758
|
+
* If the value is negative, this will fall back to the start of the entire text range.
|
|
1759
|
+
* @param to - The UTF-16 index after the last grapheme whose colors should be returned.
|
|
1760
|
+
* If the value is negative, this will fall back to the end of the entire text range.
|
|
1761
|
+
*/
|
|
1762
|
+
getTextColors(id: DesignBlockId, from?: number, to?: number): Array<RGBAColor | SpotColor>;
|
|
1763
|
+
/**
|
|
1764
|
+
* Returns the ordered unique list of font weights of the text in the selected range.
|
|
1765
|
+
* @param block - The text block whose font weights should be returned.
|
|
1766
|
+
* @param from - The start index of the UTF-16 range whose font weights should be returned.
|
|
1767
|
+
* If the value is negative and the block is currently being edited, this will fall back to the start of the current cursor index / selected grapheme range.
|
|
1768
|
+
* If the value is negative and the block is not being edited, this will fall back to the start of the entire text range.
|
|
1769
|
+
* @param to - The UTF-16 index after the last grapheme whose font weights should be returned.
|
|
1770
|
+
* If the value is negative and the block is currently being edited, this will fall back to the end of the current cursor index / selected grapheme range.
|
|
1771
|
+
* If the value is negative and the block is not being edited, this will fall back to the end of the entire text range.
|
|
1772
|
+
*/
|
|
1773
|
+
getTextFontWeights(id: DesignBlockId, from?: number, to?: number): FontWeight[];
|
|
1774
|
+
/**
|
|
1775
|
+
* Returns the ordered unique list of font styles of the text in the selected range.
|
|
1776
|
+
* @param block - The text block whose font styles should be returned.
|
|
1777
|
+
* @param from - The start index of the UTF-16 range whose font weights should be returned.
|
|
1778
|
+
* If the value is negative and the block is currently being edited, this will fall back to the start of the current cursor index / selected grapheme range.
|
|
1779
|
+
* If the value is negative and the block is not being edited, this will fall back to the start of the entire text range.
|
|
1780
|
+
* @param to - The UTF-16 index after the last grapheme whose font styles should be returned.
|
|
1781
|
+
* If the value is negative and the block is currently being edited, this will fall back to the end of the current cursor index / selected grapheme range.
|
|
1782
|
+
* If the value is negative and the block is not being edited, this will fall back to the end of the entire text range.
|
|
1783
|
+
*/
|
|
1784
|
+
getTextFontStyles(id: DesignBlockId, from?: number, to?: number): FontStyle[];
|
|
1726
1785
|
/**
|
|
1727
1786
|
* Query if the given block has fill color properties.
|
|
1728
1787
|
* @param id - The block to query.
|
|
@@ -2274,16 +2333,16 @@ export declare interface CMYKColor {
|
|
|
2274
2333
|
* The RGB and CMYK components must all be specified in the range [0-1].
|
|
2275
2334
|
* @public
|
|
2276
2335
|
*/
|
|
2277
|
-
declare type
|
|
2336
|
+
declare type Color_2 = HexColorString | RGBColor | RGBAColor | SpotColor;
|
|
2278
2337
|
|
|
2279
2338
|
/** @public */
|
|
2280
2339
|
declare type ColorDefinition = Preset & {
|
|
2281
|
-
value:
|
|
2340
|
+
value: Color_2;
|
|
2282
2341
|
};
|
|
2283
2342
|
|
|
2284
2343
|
/** @public */
|
|
2285
2344
|
declare type ColorPaletteDefinition = Preset & {
|
|
2286
|
-
entries:
|
|
2345
|
+
entries: Color_2[];
|
|
2287
2346
|
};
|
|
2288
2347
|
|
|
2289
2348
|
declare namespace ConfigTypes {
|
|
@@ -2313,7 +2372,18 @@ export { ConfigTypes }
|
|
|
2313
2372
|
* optional and what mandatory. This is Configuration, but `ui` is recursively
|
|
2314
2373
|
* optional, and all other props are non-recursively optional
|
|
2315
2374
|
*/
|
|
2316
|
-
export declare type Configuration = Partial<_RequiredConfiguration
|
|
2375
|
+
export declare type Configuration = Partial<_RequiredConfiguration> & OldConfiguration;
|
|
2376
|
+
|
|
2377
|
+
/**
|
|
2378
|
+
* A public interface for controlling several configuration options of the
|
|
2379
|
+
* Creative Editor SDK
|
|
2380
|
+
*
|
|
2381
|
+
* @public
|
|
2382
|
+
*/
|
|
2383
|
+
export declare class ConfigurationAPI {
|
|
2384
|
+
#private;
|
|
2385
|
+
setRole(role: RoleString): void;
|
|
2386
|
+
}
|
|
2317
2387
|
|
|
2318
2388
|
/**
|
|
2319
2389
|
* - Crop: Manual crop.
|
|
@@ -2338,7 +2408,7 @@ declare class CreativeEditorSDK {
|
|
|
2338
2408
|
/**
|
|
2339
2409
|
* Convenience function that registers a set of asset sources containing our
|
|
2340
2410
|
* example assets. These are
|
|
2341
|
-
*
|
|
2411
|
+
*
|
|
2342
2412
|
* - `'ly.img.sticker'` - Various stickers
|
|
2343
2413
|
* - `'ly.img.vectorpath'` - Shapes and arrows
|
|
2344
2414
|
* - `'ly.img.filter.lut'` - LUT effects of various kinds.
|
|
@@ -2357,22 +2427,20 @@ declare class CreativeEditorSDK {
|
|
|
2357
2427
|
excludeAssetSourceIds?: DefaultAssetSourceId[];
|
|
2358
2428
|
}): Promise<void>;
|
|
2359
2429
|
/**
|
|
2360
|
-
* Convenience function that registers a set of asset sources containing our
|
|
2361
|
-
* example assets. These are
|
|
2362
|
-
* - `'ly.img.image'` - Sample images
|
|
2363
|
-
* - `'ly.img.sticker'` - Various stickers
|
|
2364
|
-
* - `'ly.img.vectorpath'` - Shapes and arrows
|
|
2365
|
-
* - `'ly.img.filter.lut'` - LUT effects of various kinds.
|
|
2366
|
-
* - `'ly.img.filter.duotone'` - LUT effects of various kinds.
|
|
2430
|
+
* Convenience function that registers a set of demo asset sources containing our
|
|
2431
|
+
* example assets. These are not to meant to be used in your production code.
|
|
2367
2432
|
*
|
|
2368
|
-
* These
|
|
2369
|
-
*
|
|
2370
|
-
*
|
|
2371
|
-
*
|
|
2433
|
+
* These are
|
|
2434
|
+
*
|
|
2435
|
+
* - `'ly.img.image'` - Sample images
|
|
2436
|
+
* - `'ly.img.image.upload'` - Demo source to upload image assets
|
|
2437
|
+
* - `'ly.img.audio'` - Sample audios
|
|
2438
|
+
* - `'ly.img.audio.upload'` - Demo source to upload audio assets
|
|
2439
|
+
* - `'ly.img.video'` - Sample videos
|
|
2440
|
+
* - `'ly.img.video.upload'` - Demo source to upload video assets
|
|
2372
2441
|
*
|
|
2373
|
-
* @param baseURL - The source of the asset definitions, must be absolute. Defaults to `'https://cdn.img.ly/assets/v1'`.
|
|
2374
2442
|
* @param excludeAssetSourceIds - A list of IDs, that will be ignored during load.
|
|
2375
|
-
* @param sceneMode - if 'Video' video specific demo asset sources will be loaded as well.
|
|
2443
|
+
* @param sceneMode - if 'Video' video specific demo asset sources will be loaded as well. Parsed from global configuration if not set.
|
|
2376
2444
|
*/
|
|
2377
2445
|
addDemoAssetSources({ excludeAssetSourceIds, sceneMode }?: {
|
|
2378
2446
|
baseURL?: string;
|
|
@@ -2495,7 +2563,7 @@ export declare class CreativeEngine {
|
|
|
2495
2563
|
* @param config - An optional configuration object.
|
|
2496
2564
|
* @returns An engine instance.
|
|
2497
2565
|
*/
|
|
2498
|
-
static init<C extends Partial<_EngineConfiguration
|
|
2566
|
+
static init<C extends Partial<_EngineConfiguration> & _OldEngineConfiguration>(config?: C): Promise<CreativeEngine & (C extends {
|
|
2499
2567
|
readonly canvas: any;
|
|
2500
2568
|
} ? {
|
|
2501
2569
|
readonly element: undefined;
|
|
@@ -2533,7 +2601,7 @@ export declare class CreativeEngine {
|
|
|
2533
2601
|
* - `'ly.img.image.upload'` - Demo source to upload image assets
|
|
2534
2602
|
* - `'ly.img.audio'` - Sample audios
|
|
2535
2603
|
* - `'ly.img.audio.upload'` - Demo source to upload audio assets
|
|
2536
|
-
* - `'ly.img.video'` - Sample
|
|
2604
|
+
* - `'ly.img.video'` - Sample videos
|
|
2537
2605
|
* - `'ly.img.video.upload'` - Demo source to upload video assets
|
|
2538
2606
|
*
|
|
2539
2607
|
* @param excludeAssetSourceIds - A list of IDs, that will be ignored during load.
|
|
@@ -2599,8 +2667,11 @@ export declare enum DesignBlockType {
|
|
|
2599
2667
|
Group = "//ly.img.ubq/group"
|
|
2600
2668
|
}
|
|
2601
2669
|
|
|
2602
|
-
/**
|
|
2603
|
-
|
|
2670
|
+
/**
|
|
2671
|
+
* The scene layout determines how the layout stack should layout its pages.
|
|
2672
|
+
* @public
|
|
2673
|
+
*/
|
|
2674
|
+
export declare type DesignUnit = 'Pixel' | 'Millimeter' | 'Inch';
|
|
2604
2675
|
|
|
2605
2676
|
/** @public */
|
|
2606
2677
|
declare interface DockGroup {
|
|
@@ -2620,7 +2691,7 @@ export declare class EditorAPI {
|
|
|
2620
2691
|
* @param callback - This function is called at the end of the engine update, if the editor state has changed.
|
|
2621
2692
|
* @returns A method to unsubscribe.
|
|
2622
2693
|
*/
|
|
2623
|
-
onStateChanged(callback: () => void)
|
|
2694
|
+
onStateChanged: (callback: () => void) => (() => void);
|
|
2624
2695
|
/**
|
|
2625
2696
|
* Set the edit mode of the editor.
|
|
2626
2697
|
* An edit mode defines what type of content can currently be edited by the user.
|
|
@@ -2706,13 +2777,13 @@ export declare class EditorAPI {
|
|
|
2706
2777
|
* @param callback - This function is called at the end of the engine update, if the undo/redo history has been changed.
|
|
2707
2778
|
* @returns A method to unsubscribe
|
|
2708
2779
|
*/
|
|
2709
|
-
onHistoryUpdated(callback: () => void)
|
|
2780
|
+
onHistoryUpdated: (callback: () => void) => (() => void);
|
|
2710
2781
|
/**
|
|
2711
2782
|
* Subscribe to changes to the editor settings.
|
|
2712
2783
|
* @param callback - This function is called at the end of the engine update, if the editor settings have changed.
|
|
2713
2784
|
* @returns A method to unsubscribe.
|
|
2714
2785
|
*/
|
|
2715
|
-
onSettingsChanged(callback: () => void)
|
|
2786
|
+
onSettingsChanged: (callback: () => void) => (() => void);
|
|
2716
2787
|
/**
|
|
2717
2788
|
* Set a boolean setting.
|
|
2718
2789
|
* @param keypath - The settings keypath, e.g. `doubleClickToCropEnabled`
|
|
@@ -2871,7 +2942,7 @@ export declare class EditorAPI {
|
|
|
2871
2942
|
declare namespace _EngineConfigTypes {
|
|
2872
2943
|
export {
|
|
2873
2944
|
HexColorString,
|
|
2874
|
-
Color,
|
|
2945
|
+
Color_2 as Color,
|
|
2875
2946
|
AssetSources,
|
|
2876
2947
|
AssetSource_2 as AssetSource,
|
|
2877
2948
|
AssetResult_2 as AssetResult,
|
|
@@ -2899,15 +2970,15 @@ export { _EngineConfigTypes }
|
|
|
2899
2970
|
export declare interface _EngineConfiguration {
|
|
2900
2971
|
baseURL: string;
|
|
2901
2972
|
license?: string;
|
|
2902
|
-
|
|
2903
|
-
|
|
2973
|
+
featureFlags?: {
|
|
2974
|
+
[flag: string]: boolean | string;
|
|
2975
|
+
};
|
|
2904
2976
|
/**
|
|
2905
2977
|
* @deprecated Extensions have been superseded by AssetSources and should no longer be used.
|
|
2906
2978
|
*/
|
|
2907
2979
|
extensions: _EngineConfigTypes.Extensions;
|
|
2908
2980
|
core: _EngineConfigTypes.Core;
|
|
2909
2981
|
scene: _EngineConfigTypes.Scene;
|
|
2910
|
-
page: _EngineConfigTypes.Page;
|
|
2911
2982
|
assetSources: _EngineConfigTypes.AssetSources;
|
|
2912
2983
|
presets: _EngineConfigTypes.Presets;
|
|
2913
2984
|
variables: _EngineConfigTypes.Variables;
|
|
@@ -2991,7 +3062,7 @@ export declare class EventAPI {
|
|
|
2991
3062
|
* @param callback - The event callback. Events are bundled and sent at the end of each engine update.
|
|
2992
3063
|
* @returns A method to unsubscribe.
|
|
2993
3064
|
*/
|
|
2994
|
-
subscribe(blocks: DesignBlockId[], callback: (events: BlockEvent[]) => void)
|
|
3065
|
+
subscribe: (blocks: DesignBlockId[], callback: (events: BlockEvent[]) => void) => (() => void);
|
|
2995
3066
|
}
|
|
2996
3067
|
|
|
2997
3068
|
/** @public */
|
|
@@ -3187,6 +3258,37 @@ declare enum NavigationPosition {
|
|
|
3187
3258
|
Bottom = "bottom"
|
|
3188
3259
|
}
|
|
3189
3260
|
|
|
3261
|
+
/**
|
|
3262
|
+
* Contains configuration keys that have been removed from the actual
|
|
3263
|
+
* configuration, but are still supported publicly
|
|
3264
|
+
* @public
|
|
3265
|
+
*/
|
|
3266
|
+
export declare interface OldConfiguration extends _OldEngineConfiguration {
|
|
3267
|
+
}
|
|
3268
|
+
|
|
3269
|
+
/**
|
|
3270
|
+
* Contains configuration keys that have been removed from the actual
|
|
3271
|
+
* configuration, but are still supported publicly
|
|
3272
|
+
* @public
|
|
3273
|
+
*/
|
|
3274
|
+
export declare interface _OldEngineConfiguration {
|
|
3275
|
+
/**
|
|
3276
|
+
* @deprecated This config key has been removed.
|
|
3277
|
+
* You can configure a role via `setSettingEnum('role', role)` in the
|
|
3278
|
+
* EditorAPI.
|
|
3279
|
+
*/
|
|
3280
|
+
role?: RoleString;
|
|
3281
|
+
/**
|
|
3282
|
+
* @deprecated This config key has been removed completely.
|
|
3283
|
+
* The settings that were configured here can be set via the
|
|
3284
|
+
* following EditorAPI settings:
|
|
3285
|
+
* - `setSettingBool('page/title/show', show)`
|
|
3286
|
+
* - `setSettingString('page/title/fontFileUri', uri)`
|
|
3287
|
+
* - `setSettingBool('page/title/dimOutOfPageAreas', dim)`
|
|
3288
|
+
*/
|
|
3289
|
+
page?: Page;
|
|
3290
|
+
}
|
|
3291
|
+
|
|
3190
3292
|
/** @public */
|
|
3191
3293
|
declare type OnUploadCallback = (file: File, onProgress: (progress: number) => void) => Promise<AssetDefinition>;
|
|
3192
3294
|
|
|
@@ -3201,7 +3303,15 @@ declare type OnUploadOptions = {
|
|
|
3201
3303
|
*/
|
|
3202
3304
|
export declare type Optional<T, K extends keyof T> = Omit<T, K> & Partial<T>;
|
|
3203
3305
|
|
|
3204
|
-
/**
|
|
3306
|
+
/**
|
|
3307
|
+
* @deprecated This type definition has been removed
|
|
3308
|
+
* The settings that were configured here can be set via the
|
|
3309
|
+
* following EditorAPI settings:
|
|
3310
|
+
* - `setSettingBool('page/title/show', show)`
|
|
3311
|
+
* - `setSettingString('page/title/fontFileUri', uri)`
|
|
3312
|
+
* - `setSettingBool('page/title/dimOutOfPageAreas', dim)`
|
|
3313
|
+
* @public
|
|
3314
|
+
*/
|
|
3205
3315
|
declare type Page = {
|
|
3206
3316
|
title: {
|
|
3207
3317
|
/**
|
|
@@ -3224,7 +3334,7 @@ declare type Page = {
|
|
|
3224
3334
|
declare type PageFormatDefinition = Preset & {
|
|
3225
3335
|
width: number;
|
|
3226
3336
|
height: number;
|
|
3227
|
-
unit:
|
|
3337
|
+
unit: 'px' | 'mm' | 'in';
|
|
3228
3338
|
fixedOrientation?: boolean;
|
|
3229
3339
|
};
|
|
3230
3340
|
|
|
@@ -3445,11 +3555,19 @@ export declare class SceneAPI {
|
|
|
3445
3555
|
* Fetching the image may take an arbitrary amount of time, so the scene isn't immediately
|
|
3446
3556
|
* available.
|
|
3447
3557
|
* @param url - The image URL.
|
|
3448
|
-
* @param dpi - The
|
|
3449
|
-
* @param pixelScaleFactor - The
|
|
3558
|
+
* @param dpi - The scene's DPI.
|
|
3559
|
+
* @param pixelScaleFactor - The display's pixel scale factor.
|
|
3450
3560
|
* @returns A promise that resolves with the scene ID on success or rejected with an error otherwise.
|
|
3451
3561
|
*/
|
|
3452
3562
|
createFromImage(url: string, dpi?: number, pixelScaleFactor?: number, sceneLayout?: SceneLayout, spacing?: number, spacingInScreenSpace?: boolean): Promise<DesignBlockId>;
|
|
3563
|
+
/**
|
|
3564
|
+
* Loads the given video and creates a scene with a single page showing the video.
|
|
3565
|
+
* Fetching the video may take an arbitrary amount of time, so the scene isn't immediately
|
|
3566
|
+
* available.
|
|
3567
|
+
* @param url - The video URL.
|
|
3568
|
+
* @returns A promise that resolves with the scene ID on success or rejected with an error otherwise.
|
|
3569
|
+
*/
|
|
3570
|
+
createFromVideo(url: string): Promise<DesignBlockId>;
|
|
3453
3571
|
/**
|
|
3454
3572
|
* Return the currently active scene.
|
|
3455
3573
|
* @returns The scene or null, if none was created yet.
|
|
@@ -3478,6 +3596,16 @@ export declare class SceneAPI {
|
|
|
3478
3596
|
* @returns The current mode of the scene.
|
|
3479
3597
|
*/
|
|
3480
3598
|
getMode(): SceneMode;
|
|
3599
|
+
/**
|
|
3600
|
+
* Converts all values of the current scene into the given design unit.
|
|
3601
|
+
* @param designUnit - The new design unit of the scene
|
|
3602
|
+
*/
|
|
3603
|
+
setDesignUnit(designUnit: DesignUnit): void;
|
|
3604
|
+
/**
|
|
3605
|
+
* Returns the design unit of the current scene.
|
|
3606
|
+
* @returns The current design unit.
|
|
3607
|
+
*/
|
|
3608
|
+
getDesignUnit(): DesignUnit;
|
|
3481
3609
|
/**
|
|
3482
3610
|
* Get the sorted list of pages in the scene.
|
|
3483
3611
|
* @returns The sorted list of pages in the scene.
|
|
@@ -3555,23 +3683,13 @@ export declare class SceneAPI {
|
|
|
3555
3683
|
* @returns A method to unsubscribe.
|
|
3556
3684
|
* @privateRemarks This will currently fire on _all_ changes to camera properties
|
|
3557
3685
|
*/
|
|
3558
|
-
onZoomLevelChanged(callback: () => void)
|
|
3686
|
+
onZoomLevelChanged: (callback: () => void) => (() => void);
|
|
3559
3687
|
/**
|
|
3560
3688
|
* Subscribe to changes to the active scene rendered by the engine.
|
|
3561
3689
|
* @param callback - This function is called at the end of the engine update, if the active scene has changed.
|
|
3562
3690
|
* @returns A method to unsubscribe.
|
|
3563
3691
|
*/
|
|
3564
|
-
onActiveChanged(callback: () => void)
|
|
3565
|
-
/**
|
|
3566
|
-
* Converts all values of the current scene into the given design unit.
|
|
3567
|
-
* @param designUnit - The new design unit of the scene
|
|
3568
|
-
*/
|
|
3569
|
-
unstable_setDesignUnit(designUnit: DesignUnit): void;
|
|
3570
|
-
/**
|
|
3571
|
-
* Returns the design unit of the current scene.
|
|
3572
|
-
* @returns The current design unit.
|
|
3573
|
-
*/
|
|
3574
|
-
unstable_getDesignUnit(): DesignUnit;
|
|
3692
|
+
onActiveChanged: (callback: () => void) => (() => void);
|
|
3575
3693
|
}
|
|
3576
3694
|
|
|
3577
3695
|
/**
|
|
@@ -3628,8 +3746,10 @@ declare type Source<T> = (handler: Handler<T>) => UnsubscribeFn;
|
|
|
3628
3746
|
/** @public */
|
|
3629
3747
|
export declare interface SpotColor {
|
|
3630
3748
|
name: string;
|
|
3631
|
-
|
|
3632
|
-
|
|
3749
|
+
}
|
|
3750
|
+
|
|
3751
|
+
declare interface SpotColorLookup {
|
|
3752
|
+
getSpotColorRGBA(name: string): [r: number, g: number, b: number, a: number];
|
|
3633
3753
|
}
|
|
3634
3754
|
|
|
3635
3755
|
/** @public */
|
|
@@ -3940,12 +4060,55 @@ declare interface Vec2 {
|
|
|
3940
4060
|
y: number;
|
|
3941
4061
|
}
|
|
3942
4062
|
|
|
3943
|
-
/**
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
4063
|
+
/**
|
|
4064
|
+
* @public
|
|
4065
|
+
*/
|
|
4066
|
+
declare type VideoExportOptions = {
|
|
4067
|
+
/**
|
|
4068
|
+
* Determines the encoder feature set and in turn the quality, size and speed of the encoding process.
|
|
4069
|
+
*
|
|
4070
|
+
* @defaultValue 77 (Main)
|
|
4071
|
+
*/
|
|
4072
|
+
h264Profile?: number;
|
|
4073
|
+
/**
|
|
4074
|
+
* Controls the H.264 encoding level. This relates to parameters used by the encoder such as bit rate,
|
|
4075
|
+
* timings and motion vectors. Defined by the spec are levels 1.0 up to 6.2. To arrive at an integer value,
|
|
4076
|
+
* the level is multiplied by ten. E.g. to get level 5.2, pass a value of 52.
|
|
4077
|
+
*
|
|
4078
|
+
* @defaultValue 52
|
|
4079
|
+
*/
|
|
4080
|
+
h264Level?: number;
|
|
4081
|
+
/**
|
|
4082
|
+
* The time offset in seconds of the scene's timeline from which the video will start.
|
|
4083
|
+
*
|
|
4084
|
+
* @defaultValue 0
|
|
4085
|
+
*/
|
|
4086
|
+
timeOffset?: number;
|
|
4087
|
+
/**
|
|
4088
|
+
* The duration in seconds of the final video.
|
|
4089
|
+
*
|
|
4090
|
+
* @defaultValue The duration of the scene.
|
|
4091
|
+
*/
|
|
4092
|
+
duration?: number;
|
|
4093
|
+
/**
|
|
4094
|
+
* The target framerate of the exported video in Hz.
|
|
4095
|
+
*
|
|
4096
|
+
* @defaultValue 30
|
|
4097
|
+
*/
|
|
4098
|
+
framerate?: number;
|
|
4099
|
+
/**
|
|
4100
|
+
* An optional target width used in conjunction with target height.
|
|
4101
|
+
* If used, the block will be rendered large enough, that it fills the target
|
|
4102
|
+
* size entirely while maintaining its aspect ratio.
|
|
4103
|
+
*/
|
|
4104
|
+
targetWidth?: number;
|
|
4105
|
+
/**
|
|
4106
|
+
* An optional target height used in conjunction with target width.
|
|
4107
|
+
* If used, the block will be rendered large enough, that it fills the target
|
|
4108
|
+
* size entirely while maintaining its aspect ratio.
|
|
4109
|
+
*/
|
|
4110
|
+
targetHeight?: number;
|
|
4111
|
+
};
|
|
3949
4112
|
|
|
3950
4113
|
/** @public */
|
|
3951
4114
|
declare enum ViewStyle {
|
package/package.json
CHANGED
|
File without changes
|