@cesdk/engine 1.10.1 → 1.11.0-preview.1
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.
|
Binary file
|
package/index.d.ts
CHANGED
|
@@ -438,17 +438,13 @@ export declare class BlockAPI {
|
|
|
438
438
|
/**
|
|
439
439
|
* Exports a design block as a video file of the given mime type.
|
|
440
440
|
* Note: The export will run across multiple iterations of the update loop. In each iteration a frame is scheduled for encoding.
|
|
441
|
-
* @param
|
|
442
|
-
* @param timeOffset - The time offset in seconds of the scene's timeline from which the video will start.
|
|
443
|
-
* @param duration - The duration in seconds of the final video.
|
|
441
|
+
* @param handle - The design block element to export. Currently, only the scene block is supported.
|
|
444
442
|
* @param mimeType - The mime type of the output video file.
|
|
445
|
-
* @param resolutionWidth - The target video width in pixel.
|
|
446
|
-
* @param resolutionHeight - The target video height in pixel.
|
|
447
|
-
* @param framerate - The target framerate in Hz.
|
|
448
443
|
* @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.
|
|
444
|
+
* @param options - The options for exporting the video
|
|
449
445
|
* @returns A promise that resolves with video blob or is rejected with an error.
|
|
450
446
|
*/
|
|
451
|
-
exportVideo(handle: DesignBlockId,
|
|
447
|
+
exportVideo(handle: DesignBlockId, mimeType: MimeType_2 | undefined, progressCallback: (numberOfRenderedFrames: number, numberOfEncodedFrames: number, totalNumberOfFrames: number) => void, options: VideoExportOptions): Promise<Blob>;
|
|
452
448
|
/**
|
|
453
449
|
* Loads existing blocks from the given string.
|
|
454
450
|
* The blocks are not attached by default and won't be visible until attached to a page or the scene.
|
|
@@ -768,7 +764,7 @@ export declare class BlockAPI {
|
|
|
768
764
|
/**
|
|
769
765
|
* Set a block's mode for its width.
|
|
770
766
|
* @param id - The block to update.
|
|
771
|
-
* @param mode - The width mode:
|
|
767
|
+
* @param mode - The width mode: Absolute, Percent or Auto.
|
|
772
768
|
*/
|
|
773
769
|
setWidthMode(id: DesignBlockId, mode: SizeMode): void;
|
|
774
770
|
/**
|
|
@@ -780,7 +776,7 @@ export declare class BlockAPI {
|
|
|
780
776
|
/**
|
|
781
777
|
* Set a block's mode for its height.
|
|
782
778
|
* @param id - The block to update.
|
|
783
|
-
* @param mode - The height mode:
|
|
779
|
+
* @param mode - The height mode: Absolute, Percent or Auto.
|
|
784
780
|
*/
|
|
785
781
|
setHeightMode(id: DesignBlockId, mode: SizeMode): void;
|
|
786
782
|
/**
|
|
@@ -907,6 +903,24 @@ export declare class BlockAPI {
|
|
|
907
903
|
* @returns The position and size of the bounding box.
|
|
908
904
|
*/
|
|
909
905
|
getScreenSpaceBoundingBoxXYWH(ids: DesignBlockId[]): XYWH;
|
|
906
|
+
/**
|
|
907
|
+
* Align multiple blocks horizontally within their bounding box (or group) or a single block to its parent.
|
|
908
|
+
* @param ids - A non-empty array of block ids.
|
|
909
|
+
* @param alignment - How they should be aligned: left, right, or center
|
|
910
|
+
*/
|
|
911
|
+
alignHorizontally(ids: DesignBlockId[], horizontalBlockAlignment: HorizontalBlockAlignment): void;
|
|
912
|
+
/**
|
|
913
|
+
* Align multiple blocks vertically within their bounding box (or group) or a single block to its parent.
|
|
914
|
+
* @param ids - A non-empty array of block ids.
|
|
915
|
+
* @param alignment - How they should be aligned: top, bottom, or center
|
|
916
|
+
*/
|
|
917
|
+
alignVertically(ids: DesignBlockId[], verticalBlockAlignment: VerticalBlockAlignment): void;
|
|
918
|
+
/**
|
|
919
|
+
* Confirms that a given set of blocks can be aligned.
|
|
920
|
+
* @param ids - A non-empty array of block ids.
|
|
921
|
+
* @returns Whether the blocks can be aligned.
|
|
922
|
+
*/
|
|
923
|
+
isAlignable(ids: DesignBlockId[]): boolean;
|
|
910
924
|
/**
|
|
911
925
|
* Scales the block and all of its children proportionally around the specified
|
|
912
926
|
* relative anchor point.
|
|
@@ -1068,14 +1082,14 @@ export declare class BlockAPI {
|
|
|
1068
1082
|
* @param property - The name of the property to set.
|
|
1069
1083
|
* @param value - The enum value as string.
|
|
1070
1084
|
*/
|
|
1071
|
-
setEnum(id: DesignBlockId, property: string, value:
|
|
1085
|
+
setEnum<T extends string = string>(id: DesignBlockId, property: string, value: T): void;
|
|
1072
1086
|
/**
|
|
1073
1087
|
* Get the value of an enum property of the given design block.
|
|
1074
1088
|
* @param id - The block whose property should be queried.
|
|
1075
1089
|
* @param property - The name of the property to query.
|
|
1076
1090
|
* @returns The value as string.
|
|
1077
1091
|
*/
|
|
1078
|
-
getEnum(id: DesignBlockId, property: string):
|
|
1092
|
+
getEnum<T extends string = string>(id: DesignBlockId, property: string): T;
|
|
1079
1093
|
/**
|
|
1080
1094
|
* Query if the given block has crop properties.
|
|
1081
1095
|
* @param id - The block to query.
|
|
@@ -1607,6 +1621,69 @@ export declare class BlockAPI {
|
|
|
1607
1621
|
* @returns The drop shadow's clipping.
|
|
1608
1622
|
*/
|
|
1609
1623
|
getDropShadowClip(id: DesignBlockId): boolean;
|
|
1624
|
+
/**
|
|
1625
|
+
* Inserts the given text into the selected range of the text block.
|
|
1626
|
+
* @param block - The text block into which to insert the given text.
|
|
1627
|
+
* @param text - The text which should replace the selected range in the block.
|
|
1628
|
+
* @param from - The start index of the UTF-16 range that should be replaced.
|
|
1629
|
+
* If the value is negative, this will fall back to the start of the entire text range.
|
|
1630
|
+
* @param to - The UTF-16 index after the last grapheme that should be replaced by the inserted text.
|
|
1631
|
+
* 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.
|
|
1632
|
+
* If `to` is negative but `from` is greater than or equal to 0, the text will be inserted at the index defined by `from`.
|
|
1633
|
+
*/
|
|
1634
|
+
replaceText(id: DesignBlockId, text: string, from?: number, to?: number): void;
|
|
1635
|
+
/**
|
|
1636
|
+
* Removes selected range of text of the given text block.
|
|
1637
|
+
* @param block - The text block from which the selected text should be removed.
|
|
1638
|
+
* @param from - The start index of the UTF-16 range that should be removed.
|
|
1639
|
+
* If the value is negative, this will fall back to the start of the entire text range.
|
|
1640
|
+
* @param to - The UTF-16 index after the last grapheme that should be removed.
|
|
1641
|
+
* If the value is negative, this will fall back to the end of the entire text range.
|
|
1642
|
+
*/
|
|
1643
|
+
removeText(id: DesignBlockId, from?: number, to?: number): void;
|
|
1644
|
+
/**
|
|
1645
|
+
* Changes the color of the text in the selected range to the given color.
|
|
1646
|
+
* @param block - The text block whose color should be changed.
|
|
1647
|
+
* @param color - The new color of the selected text range.
|
|
1648
|
+
* @param from - The start index of the UTF-16 range whose color should be changed.
|
|
1649
|
+
* 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.
|
|
1650
|
+
* If the value is negative and the block is not being edited, this will fall back to the start of the entire text range.
|
|
1651
|
+
* @param to - The UTF-16 index after the last grapheme whose color should be changed.
|
|
1652
|
+
* 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.
|
|
1653
|
+
* If the value is negative and the block is not being edited, this will fall back to the end of the entire text range.
|
|
1654
|
+
*/
|
|
1655
|
+
setTextColor(id: DesignBlockId, color: RGBAColor | SpotColor, from?: number, to?: number): void;
|
|
1656
|
+
/**
|
|
1657
|
+
* Returns the ordered unique list of colors of the text in the selected range.
|
|
1658
|
+
* @param block - The text block whose colors should be returned.
|
|
1659
|
+
* @param from - The start index of the UTF-16 range whose colors should be returned.
|
|
1660
|
+
* If the value is negative, this will fall back to the start of the entire text range.
|
|
1661
|
+
* @param to - The UTF-16 index after the last grapheme whose colors should be returned.
|
|
1662
|
+
* If the value is negative, this will fall back to the end of the entire text range.
|
|
1663
|
+
*/
|
|
1664
|
+
getTextColors(id: DesignBlockId, from?: number, to?: number): Array<RGBAColor | SpotColor>;
|
|
1665
|
+
/**
|
|
1666
|
+
* Returns the ordered unique list of font weights of the text in the selected range.
|
|
1667
|
+
* @param block - The text block whose font weights should be returned.
|
|
1668
|
+
* @param from - The start index of the UTF-16 range whose font weights should be returned.
|
|
1669
|
+
* 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.
|
|
1670
|
+
* If the value is negative and the block is not being edited, this will fall back to the start of the entire text range.
|
|
1671
|
+
* @param to - The UTF-16 index after the last grapheme whose font weights should be returned.
|
|
1672
|
+
* 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.
|
|
1673
|
+
* If the value is negative and the block is not being edited, this will fall back to the end of the entire text range.
|
|
1674
|
+
*/
|
|
1675
|
+
getTextFontWeights(id: DesignBlockId, from?: number, to?: number): FontWeight[];
|
|
1676
|
+
/**
|
|
1677
|
+
* Returns the ordered unique list of font styles of the text in the selected range.
|
|
1678
|
+
* @param block - The text block whose font styles should be returned.
|
|
1679
|
+
* @param from - The start index of the UTF-16 range whose font weights should be returned.
|
|
1680
|
+
* 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.
|
|
1681
|
+
* If the value is negative and the block is not being edited, this will fall back to the start of the entire text range.
|
|
1682
|
+
* @param to - The UTF-16 index after the last grapheme whose font styles should be returned.
|
|
1683
|
+
* 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.
|
|
1684
|
+
* If the value is negative and the block is not being edited, this will fall back to the end of the entire text range.
|
|
1685
|
+
*/
|
|
1686
|
+
getTextFontStyles(id: DesignBlockId, from?: number, to?: number): FontStyle[];
|
|
1610
1687
|
/**
|
|
1611
1688
|
* Query if the given block has fill color properties.
|
|
1612
1689
|
* @param id - The block to query.
|
|
@@ -2199,15 +2276,14 @@ export { ConfigTypes }
|
|
|
2199
2276
|
export declare interface Configuration {
|
|
2200
2277
|
baseURL: string;
|
|
2201
2278
|
license?: string;
|
|
2202
|
-
|
|
2203
|
-
|
|
2279
|
+
featureFlags?: {
|
|
2280
|
+
[flag: string]: boolean | string;
|
|
2281
|
+
};
|
|
2204
2282
|
/**
|
|
2205
2283
|
* @deprecated Extensions have been superseded by AssetSources and should no longer be used.
|
|
2206
2284
|
*/
|
|
2207
2285
|
extensions: ConfigTypes.Extensions;
|
|
2208
2286
|
core: ConfigTypes.Core;
|
|
2209
|
-
scene: ConfigTypes.Scene;
|
|
2210
|
-
page: ConfigTypes.Page;
|
|
2211
2287
|
assetSources: ConfigTypes.AssetSources;
|
|
2212
2288
|
presets: ConfigTypes.Presets;
|
|
2213
2289
|
variables: ConfigTypes.Variables;
|
|
@@ -2276,7 +2352,7 @@ declare class CreativeEngine {
|
|
|
2276
2352
|
* @param config - An optional configuration object.
|
|
2277
2353
|
* @returns An engine instance.
|
|
2278
2354
|
*/
|
|
2279
|
-
static init<C extends Partial<Configuration
|
|
2355
|
+
static init<C extends Partial<Configuration> & OldConfiguration>(config?: C): Promise<CreativeEngine & (C extends {
|
|
2280
2356
|
readonly canvas: any;
|
|
2281
2357
|
} ? {
|
|
2282
2358
|
readonly element: undefined;
|
|
@@ -2314,7 +2390,7 @@ declare class CreativeEngine {
|
|
|
2314
2390
|
* - `'ly.img.image.upload'` - Demo source to upload image assets
|
|
2315
2391
|
* - `'ly.img.audio'` - Sample audios
|
|
2316
2392
|
* - `'ly.img.audio.upload'` - Demo source to upload audio assets
|
|
2317
|
-
* - `'ly.img.video'` - Sample
|
|
2393
|
+
* - `'ly.img.video'` - Sample videos
|
|
2318
2394
|
* - `'ly.img.video.upload'` - Demo source to upload video assets
|
|
2319
2395
|
*
|
|
2320
2396
|
* @param excludeAssetSourceIds - A list of IDs, that will be ignored during load.
|
|
@@ -2383,8 +2459,11 @@ export declare enum DesignBlockType {
|
|
|
2383
2459
|
Group = "//ly.img.ubq/group"
|
|
2384
2460
|
}
|
|
2385
2461
|
|
|
2386
|
-
/**
|
|
2387
|
-
|
|
2462
|
+
/**
|
|
2463
|
+
* The scene layout determines how the layout stack should layout its pages.
|
|
2464
|
+
* @public
|
|
2465
|
+
*/
|
|
2466
|
+
export declare type DesignUnit = 'Pixel' | 'Millimeter' | 'Inch';
|
|
2388
2467
|
|
|
2389
2468
|
/**
|
|
2390
2469
|
* @public
|
|
@@ -2397,7 +2476,7 @@ export declare class EditorAPI {
|
|
|
2397
2476
|
* @param callback - This function is called at the end of the engine update, if the editor state has changed.
|
|
2398
2477
|
* @returns A method to unsubscribe.
|
|
2399
2478
|
*/
|
|
2400
|
-
onStateChanged(callback: () => void)
|
|
2479
|
+
onStateChanged: (callback: () => void) => (() => void);
|
|
2401
2480
|
/**
|
|
2402
2481
|
* Set the edit mode of the editor.
|
|
2403
2482
|
* An edit mode defines what type of content can currently be edited by the user.
|
|
@@ -2483,13 +2562,13 @@ export declare class EditorAPI {
|
|
|
2483
2562
|
* @param callback - This function is called at the end of the engine update, if the undo/redo history has been changed.
|
|
2484
2563
|
* @returns A method to unsubscribe
|
|
2485
2564
|
*/
|
|
2486
|
-
onHistoryUpdated(callback: () => void)
|
|
2565
|
+
onHistoryUpdated: (callback: () => void) => (() => void);
|
|
2487
2566
|
/**
|
|
2488
2567
|
* Subscribe to changes to the editor settings.
|
|
2489
2568
|
* @param callback - This function is called at the end of the engine update, if the editor settings have changed.
|
|
2490
2569
|
* @returns A method to unsubscribe.
|
|
2491
2570
|
*/
|
|
2492
|
-
onSettingsChanged(callback: () => void)
|
|
2571
|
+
onSettingsChanged: (callback: () => void) => (() => void);
|
|
2493
2572
|
/**
|
|
2494
2573
|
* Set a boolean setting.
|
|
2495
2574
|
* @param keypath - The settings keypath, e.g. `doubleClickToCropEnabled`
|
|
@@ -2657,7 +2736,7 @@ export declare class EventAPI {
|
|
|
2657
2736
|
* @param callback - The event callback. Events are bundled and sent at the end of each engine update.
|
|
2658
2737
|
* @returns A method to unsubscribe.
|
|
2659
2738
|
*/
|
|
2660
|
-
subscribe(blocks: DesignBlockId[], callback: (events: BlockEvent[]) => void)
|
|
2739
|
+
subscribe: (blocks: DesignBlockId[], callback: (events: BlockEvent[]) => void) => (() => void);
|
|
2661
2740
|
}
|
|
2662
2741
|
|
|
2663
2742
|
/**
|
|
@@ -2731,7 +2810,7 @@ declare type Extensions = {
|
|
|
2731
2810
|
/**
|
|
2732
2811
|
* @public
|
|
2733
2812
|
*/
|
|
2734
|
-
export declare type FillType = 'Solid' | 'Gradient' | 'Video';
|
|
2813
|
+
export declare type FillType = 'Solid' | 'Gradient' | 'Video' | 'Image';
|
|
2735
2814
|
|
|
2736
2815
|
/** @public */
|
|
2737
2816
|
declare interface FindAssetsQuery {
|
|
@@ -2807,6 +2886,18 @@ declare type HexColorString = string;
|
|
|
2807
2886
|
*/
|
|
2808
2887
|
export declare type HistoryId = number;
|
|
2809
2888
|
|
|
2889
|
+
/**
|
|
2890
|
+
* - Left: The blocks get left aligned.
|
|
2891
|
+
* - Right: The blocks get right aligned.
|
|
2892
|
+
* - Center: The blocks get center aligned.
|
|
2893
|
+
*
|
|
2894
|
+
* @public
|
|
2895
|
+
*/
|
|
2896
|
+
export declare type HorizontalBlockAlignment = 'Left' | 'Right' | 'Center';
|
|
2897
|
+
|
|
2898
|
+
/** @public */
|
|
2899
|
+
export declare type HorizontalTextAlignment = 'Left' | 'Right' | 'Center';
|
|
2900
|
+
|
|
2810
2901
|
/**
|
|
2811
2902
|
* A wrapper around a plain canvas
|
|
2812
2903
|
*
|
|
@@ -2862,7 +2953,45 @@ declare enum MimeType_2 {
|
|
|
2862
2953
|
}
|
|
2863
2954
|
export { MimeType_2 as MimeType }
|
|
2864
2955
|
|
|
2865
|
-
/**
|
|
2956
|
+
/**
|
|
2957
|
+
* Contains configuration keys that have been removed from the actual
|
|
2958
|
+
* configuration, but are still supported publicly
|
|
2959
|
+
* @public
|
|
2960
|
+
*/
|
|
2961
|
+
export declare interface OldConfiguration {
|
|
2962
|
+
/**
|
|
2963
|
+
* @deprecated This config key has been removed.
|
|
2964
|
+
* You can configure a role via `setSettingEnum('role', role)` in the
|
|
2965
|
+
* EditorAPI.
|
|
2966
|
+
*/
|
|
2967
|
+
role?: RoleString;
|
|
2968
|
+
/**
|
|
2969
|
+
* @deprecated This config key has been removed completely.
|
|
2970
|
+
* The settings that were configured here can be set via the
|
|
2971
|
+
* following EditorAPI settings:
|
|
2972
|
+
* - `setSettingBool('page/title/show', show)`
|
|
2973
|
+
* - `setSettingString('page/title/fontFileUri', uri)`
|
|
2974
|
+
* - `setSettingBool('page/title/dimOutOfPageAreas', dim)`
|
|
2975
|
+
*/
|
|
2976
|
+
page?: Page;
|
|
2977
|
+
/**
|
|
2978
|
+
* @deprecated This type definition has been removed
|
|
2979
|
+
* The settings that were configured here can be set via the
|
|
2980
|
+
* BlockApi on the scene block
|
|
2981
|
+
* @public
|
|
2982
|
+
*/
|
|
2983
|
+
scene?: Scene;
|
|
2984
|
+
}
|
|
2985
|
+
|
|
2986
|
+
/**
|
|
2987
|
+
* @deprecated This type definition has been removed
|
|
2988
|
+
* The settings that were configured here can be set via the
|
|
2989
|
+
* following EditorAPI settings:
|
|
2990
|
+
* - `setSettingBool('page/title/show', show)`
|
|
2991
|
+
* - `setSettingString('page/title/fontFileUri', uri)`
|
|
2992
|
+
* - `setSettingBool('page/title/dimOutOfPageAreas', dim)`
|
|
2993
|
+
* @public
|
|
2994
|
+
*/
|
|
2866
2995
|
declare type Page = {
|
|
2867
2996
|
title: {
|
|
2868
2997
|
/**
|
|
@@ -2893,7 +3022,7 @@ export declare interface PageDuration {
|
|
|
2893
3022
|
declare type PageFormatDefinition = Preset & {
|
|
2894
3023
|
width: number;
|
|
2895
3024
|
height: number;
|
|
2896
|
-
unit:
|
|
3025
|
+
unit: 'px' | 'mm' | 'in';
|
|
2897
3026
|
fixedOrientation?: boolean;
|
|
2898
3027
|
};
|
|
2899
3028
|
|
|
@@ -3033,23 +3162,26 @@ export declare interface RGBColor {
|
|
|
3033
3162
|
export declare type RoleString = 'Creator' | 'Adopter' | 'Viewer' | 'Presenter';
|
|
3034
3163
|
|
|
3035
3164
|
/**
|
|
3036
|
-
*
|
|
3165
|
+
* @deprecated This type definition is not used anymore and will be removed
|
|
3166
|
+
* in the future. The settings that were configured here can be set via the
|
|
3167
|
+
* BlockApi on the scene block:
|
|
3168
|
+
*
|
|
3169
|
+
* ```ts
|
|
3170
|
+
* engine.block.setInt(sceneId, 'scene/dpi', dpi);
|
|
3171
|
+
* engine.block.setInt(sceneId, 'scene/pixelScaleFactor', factor);
|
|
3172
|
+
* ```
|
|
3173
|
+
*
|
|
3037
3174
|
* @public
|
|
3038
3175
|
*/
|
|
3039
3176
|
declare type Scene = {
|
|
3040
3177
|
/**
|
|
3041
|
-
*
|
|
3042
|
-
*
|
|
3043
|
-
*
|
|
3044
|
-
* This is only relevant for new scenes that are created in the editor. Loaded scenes will use the
|
|
3045
|
-
* value stored in their serialization file.
|
|
3178
|
+
* @deprecated Setting this value has no effect. You can change the dpi of the
|
|
3179
|
+
* current scene via `engine.block.setInt(sceneId, 'scene/dpi', dpi)`
|
|
3046
3180
|
*/
|
|
3047
3181
|
dpi: number;
|
|
3048
3182
|
/**
|
|
3049
|
-
*
|
|
3050
|
-
*
|
|
3051
|
-
* This is only relevant for new scenes that are created in the editor. Loaded scenes will use the
|
|
3052
|
-
* value stored in their serialization file.
|
|
3183
|
+
* @deprecated Setting this value has no effect. You can change the dpi of the
|
|
3184
|
+
* current scene via `engine.block.setInt(sceneId, 'scene/pixelScaleFactor', * factor)`
|
|
3053
3185
|
*/
|
|
3054
3186
|
pixelScaleFactor: number;
|
|
3055
3187
|
};
|
|
@@ -3103,11 +3235,19 @@ export declare class SceneAPI {
|
|
|
3103
3235
|
* Fetching the image may take an arbitrary amount of time, so the scene isn't immediately
|
|
3104
3236
|
* available.
|
|
3105
3237
|
* @param url - The image URL.
|
|
3106
|
-
* @param dpi - The
|
|
3107
|
-
* @param pixelScaleFactor - The
|
|
3238
|
+
* @param dpi - The scene's DPI.
|
|
3239
|
+
* @param pixelScaleFactor - The display's pixel scale factor.
|
|
3108
3240
|
* @returns A promise that resolves with the scene ID on success or rejected with an error otherwise.
|
|
3109
3241
|
*/
|
|
3110
3242
|
createFromImage(url: string, dpi?: number, pixelScaleFactor?: number, sceneLayout?: SceneLayout, spacing?: number, spacingInScreenSpace?: boolean): Promise<DesignBlockId>;
|
|
3243
|
+
/**
|
|
3244
|
+
* Loads the given video and creates a scene with a single page showing the video.
|
|
3245
|
+
* Fetching the video may take an arbitrary amount of time, so the scene isn't immediately
|
|
3246
|
+
* available.
|
|
3247
|
+
* @param url - The video URL.
|
|
3248
|
+
* @returns A promise that resolves with the scene ID on success or rejected with an error otherwise.
|
|
3249
|
+
*/
|
|
3250
|
+
createFromVideo(url: string): Promise<DesignBlockId>;
|
|
3111
3251
|
/**
|
|
3112
3252
|
* Return the currently active scene.
|
|
3113
3253
|
* @returns The scene or null, if none was created yet.
|
|
@@ -3136,6 +3276,16 @@ export declare class SceneAPI {
|
|
|
3136
3276
|
* @returns The current mode of the scene.
|
|
3137
3277
|
*/
|
|
3138
3278
|
getMode(): SceneMode;
|
|
3279
|
+
/**
|
|
3280
|
+
* Converts all values of the current scene into the given design unit.
|
|
3281
|
+
* @param designUnit - The new design unit of the scene
|
|
3282
|
+
*/
|
|
3283
|
+
setDesignUnit(designUnit: DesignUnit): void;
|
|
3284
|
+
/**
|
|
3285
|
+
* Returns the design unit of the current scene.
|
|
3286
|
+
* @returns The current design unit.
|
|
3287
|
+
*/
|
|
3288
|
+
getDesignUnit(): DesignUnit;
|
|
3139
3289
|
/**
|
|
3140
3290
|
* Get the sorted list of pages in the scene.
|
|
3141
3291
|
* @returns The sorted list of pages in the scene.
|
|
@@ -3213,23 +3363,13 @@ export declare class SceneAPI {
|
|
|
3213
3363
|
* @returns A method to unsubscribe.
|
|
3214
3364
|
* @privateRemarks This will currently fire on _all_ changes to camera properties
|
|
3215
3365
|
*/
|
|
3216
|
-
onZoomLevelChanged(callback: () => void)
|
|
3366
|
+
onZoomLevelChanged: (callback: () => void) => (() => void);
|
|
3217
3367
|
/**
|
|
3218
3368
|
* Subscribe to changes to the active scene rendered by the engine.
|
|
3219
3369
|
* @param callback - This function is called at the end of the engine update, if the active scene has changed.
|
|
3220
3370
|
* @returns A method to unsubscribe.
|
|
3221
3371
|
*/
|
|
3222
|
-
onActiveChanged(callback: () => void)
|
|
3223
|
-
/**
|
|
3224
|
-
* Converts all values of the current scene into the given design unit.
|
|
3225
|
-
* @param designUnit - The new design unit of the scene
|
|
3226
|
-
*/
|
|
3227
|
-
unstable_setDesignUnit(designUnit: DesignUnit): void;
|
|
3228
|
-
/**
|
|
3229
|
-
* Returns the design unit of the current scene.
|
|
3230
|
-
* @returns The current design unit.
|
|
3231
|
-
*/
|
|
3232
|
-
unstable_getDesignUnit(): DesignUnit;
|
|
3372
|
+
onActiveChanged: (callback: () => void) => (() => void);
|
|
3233
3373
|
}
|
|
3234
3374
|
|
|
3235
3375
|
/**
|
|
@@ -3292,8 +3432,6 @@ declare type Source<T> = (handler: Handler<T>) => UnsubscribeFn;
|
|
|
3292
3432
|
/** @public */
|
|
3293
3433
|
export declare interface SpotColor {
|
|
3294
3434
|
name: string;
|
|
3295
|
-
rgbApproximation: RGBAColor;
|
|
3296
|
-
cmykApproximation: CMYKColor;
|
|
3297
3435
|
}
|
|
3298
3436
|
|
|
3299
3437
|
declare interface SpotColorLookup {
|
|
@@ -3414,6 +3552,68 @@ export declare interface Vec4 {
|
|
|
3414
3552
|
w: number;
|
|
3415
3553
|
}
|
|
3416
3554
|
|
|
3555
|
+
/**
|
|
3556
|
+
* - Top: The blocks get top aligned.
|
|
3557
|
+
* - Bottom: The blocks get bottom aligned.
|
|
3558
|
+
* - Center: The blocks get center aligned.
|
|
3559
|
+
*
|
|
3560
|
+
* @public
|
|
3561
|
+
*/
|
|
3562
|
+
export declare type VerticalBlockAlignment = 'Top' | 'Bottom' | 'Center';
|
|
3563
|
+
|
|
3564
|
+
/** @public */
|
|
3565
|
+
export declare type VerticalTextAlignment = 'Top' | 'Bottom' | 'Center';
|
|
3566
|
+
|
|
3567
|
+
/**
|
|
3568
|
+
* @public
|
|
3569
|
+
*/
|
|
3570
|
+
export declare type VideoExportOptions = {
|
|
3571
|
+
/**
|
|
3572
|
+
* Determines the encoder feature set and in turn the quality, size and speed of the encoding process.
|
|
3573
|
+
*
|
|
3574
|
+
* @defaultValue 77 (Main)
|
|
3575
|
+
*/
|
|
3576
|
+
h264Profile?: number;
|
|
3577
|
+
/**
|
|
3578
|
+
* Controls the H.264 encoding level. This relates to parameters used by the encoder such as bit rate,
|
|
3579
|
+
* timings and motion vectors. Defined by the spec are levels 1.0 up to 6.2. To arrive at an integer value,
|
|
3580
|
+
* the level is multiplied by ten. E.g. to get level 5.2, pass a value of 52.
|
|
3581
|
+
*
|
|
3582
|
+
* @defaultValue 52
|
|
3583
|
+
*/
|
|
3584
|
+
h264Level?: number;
|
|
3585
|
+
/**
|
|
3586
|
+
* The time offset in seconds of the scene's timeline from which the video will start.
|
|
3587
|
+
*
|
|
3588
|
+
* @defaultValue 0
|
|
3589
|
+
*/
|
|
3590
|
+
timeOffset?: number;
|
|
3591
|
+
/**
|
|
3592
|
+
* The duration in seconds of the final video.
|
|
3593
|
+
*
|
|
3594
|
+
* @defaultValue The duration of the scene.
|
|
3595
|
+
*/
|
|
3596
|
+
duration?: number;
|
|
3597
|
+
/**
|
|
3598
|
+
* The target framerate of the exported video in Hz.
|
|
3599
|
+
*
|
|
3600
|
+
* @defaultValue 30
|
|
3601
|
+
*/
|
|
3602
|
+
framerate?: number;
|
|
3603
|
+
/**
|
|
3604
|
+
* An optional target width used in conjunction with target height.
|
|
3605
|
+
* If used, the block will be rendered large enough, that it fills the target
|
|
3606
|
+
* size entirely while maintaining its aspect ratio.
|
|
3607
|
+
*/
|
|
3608
|
+
targetWidth?: number;
|
|
3609
|
+
/**
|
|
3610
|
+
* An optional target height used in conjunction with target width.
|
|
3611
|
+
* If used, the block will be rendered large enough, that it fills the target
|
|
3612
|
+
* size entirely while maintaining its aspect ratio.
|
|
3613
|
+
*/
|
|
3614
|
+
targetHeight?: number;
|
|
3615
|
+
};
|
|
3616
|
+
|
|
3417
3617
|
/**
|
|
3418
3618
|
* Describes a rectangle on the screen
|
|
3419
3619
|
* - `x` and `y` indicate the position
|