@cesdk/engine 1.13.1 → 1.14.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.
|
Binary file
|
|
Binary file
|
package/index.d.ts
CHANGED
|
@@ -74,6 +74,11 @@ export declare class AssetAPI {
|
|
|
74
74
|
* @returns The asset groups.
|
|
75
75
|
*/
|
|
76
76
|
getGroups(id: string): Promise<string[]>;
|
|
77
|
+
/**
|
|
78
|
+
* Queries the list of supported mime types of the specified asset source.
|
|
79
|
+
* An empty result means that all mime types are supported.
|
|
80
|
+
* @param sourceId - The ID of the asset source.
|
|
81
|
+
*/
|
|
77
82
|
getSupportedMimeTypes(sourceId: string): string[];
|
|
78
83
|
/**
|
|
79
84
|
* Queries the asset source's credits info.
|
|
@@ -441,6 +446,12 @@ export declare class BlockAPI {
|
|
|
441
446
|
* @returns A method to unsubscribe.
|
|
442
447
|
*/
|
|
443
448
|
onSelectionChanged(callback: () => void): () => void;
|
|
449
|
+
/**
|
|
450
|
+
* Subscribe to block click events.
|
|
451
|
+
* @param callback - This function is called at the end of the engine update if a block has been clicked.
|
|
452
|
+
* @returns A method to unsubscribe.
|
|
453
|
+
*/
|
|
454
|
+
onClicked(callback: (id: DesignBlockId) => void): () => void;
|
|
444
455
|
/**
|
|
445
456
|
* Confirms that a given set of blocks can be grouped together.
|
|
446
457
|
* @param ids - A non-empty array of block ids.
|
|
@@ -508,6 +519,32 @@ export declare class BlockAPI {
|
|
|
508
519
|
* @returns A list of block ids.
|
|
509
520
|
*/
|
|
510
521
|
findAllPlaceholders(): DesignBlockId[];
|
|
522
|
+
/**
|
|
523
|
+
* Create a new shape, fails if type is unknown.
|
|
524
|
+
* @param type - The type of the shape object that shall be created.
|
|
525
|
+
* @returns The created shape's handle.
|
|
526
|
+
*/
|
|
527
|
+
createShape(type: string): DesignBlockId;
|
|
528
|
+
/**
|
|
529
|
+
* Query if the given block has a shape property.
|
|
530
|
+
* @param id - The block to query.
|
|
531
|
+
* @returns true, if the block has a shape property, an error otherwise.
|
|
532
|
+
*/
|
|
533
|
+
hasShape(id: DesignBlockId): boolean;
|
|
534
|
+
/**
|
|
535
|
+
* Returns the block containing the shape properties of the given block.
|
|
536
|
+
* @param id - The block whose shape block should be returned.
|
|
537
|
+
* @returns The block that currently defines the given block's shape.
|
|
538
|
+
*/
|
|
539
|
+
getShape(id: DesignBlockId): DesignBlockId;
|
|
540
|
+
/**
|
|
541
|
+
* Sets the block containing the shape properties of the given block.
|
|
542
|
+
* Note that the previous shape block is not destroyed automatically.
|
|
543
|
+
* The new shape is disconnected from its previously attached block.
|
|
544
|
+
* @param id - The block whose shape should be changed.
|
|
545
|
+
* @param fill - The new shape.
|
|
546
|
+
*/
|
|
547
|
+
setShape(id: DesignBlockId, shape: DesignBlockId): void;
|
|
511
548
|
/**
|
|
512
549
|
* Query a block's visibility.
|
|
513
550
|
* @param id - The block to query.
|
|
@@ -1087,6 +1124,8 @@ export declare class BlockAPI {
|
|
|
1087
1124
|
setCropRotation(id: DesignBlockId, rotation: number): void;
|
|
1088
1125
|
/**
|
|
1089
1126
|
* Set the crop scale ratio of the given design block.
|
|
1127
|
+
* This will uniformly scale the content up or down. The center of the
|
|
1128
|
+
* scale operation is the center of the crop frame.
|
|
1090
1129
|
* @param id - The block whose crop should be set.
|
|
1091
1130
|
* @param scaleRatio - The crop scale ratio.
|
|
1092
1131
|
*/
|
|
@@ -1900,6 +1939,24 @@ export declare class BlockAPI {
|
|
|
1900
1939
|
* @returns the enabled state of the placeholder function.
|
|
1901
1940
|
*/
|
|
1902
1941
|
isPlaceholderEnabled(id: DesignBlockId): boolean;
|
|
1942
|
+
/**
|
|
1943
|
+
* Checks whether the block supports placeholder behavior.
|
|
1944
|
+
* @param block - The block to query.
|
|
1945
|
+
* @returns True, if the block supports placeholder behavior.
|
|
1946
|
+
*/
|
|
1947
|
+
hasPlaceholderBehavior(id: DesignBlockId): boolean;
|
|
1948
|
+
/**
|
|
1949
|
+
* Enable or disable the placeholder behavior for a block.
|
|
1950
|
+
* @param id - The block whose placeholder behavior should be enabled or disabled.
|
|
1951
|
+
* @param enabled - Whether the placeholder behavior should be enabled or disabled.
|
|
1952
|
+
*/
|
|
1953
|
+
setPlaceholderBehaviorEnabled(id: DesignBlockId, enabled: boolean): void;
|
|
1954
|
+
/**
|
|
1955
|
+
* Query whether the placeholder behavior for a block is enabled.
|
|
1956
|
+
* @param id - The block whose placeholder behavior state should be queried.
|
|
1957
|
+
* @returns the enabled state of the placeholder behavior.
|
|
1958
|
+
*/
|
|
1959
|
+
isPlaceholderBehaviorEnabled(id: DesignBlockId): boolean;
|
|
1903
1960
|
/**
|
|
1904
1961
|
* Query if the given block shows placeholder content.
|
|
1905
1962
|
* @param id - The block to query.
|
|
@@ -2178,11 +2235,36 @@ export declare class BlockAPI {
|
|
|
2178
2235
|
* @returns The video or audio file duration
|
|
2179
2236
|
*/
|
|
2180
2237
|
getAVResourceTotalDuration(id: DesignBlockId): number;
|
|
2238
|
+
/**
|
|
2239
|
+
* Get the video width in pixels of the video resource that is attached to the given block.
|
|
2240
|
+
* @param block - The video fill.
|
|
2241
|
+
* @returns The video width in pixels or an error.
|
|
2242
|
+
*/
|
|
2243
|
+
getVideoWidth(id: DesignBlockId): number;
|
|
2244
|
+
/**
|
|
2245
|
+
* Get the video height in pixels of the video resource that is attached to the given block.
|
|
2246
|
+
* @param block - The video fill.
|
|
2247
|
+
* @returns The video height in pixels or an error.
|
|
2248
|
+
*/
|
|
2249
|
+
getVideoHeight(id: DesignBlockId): number;
|
|
2250
|
+
/**
|
|
2251
|
+
* Generate a sequence of thumbnails for the given video fill or page.
|
|
2252
|
+
* Note: there can only be one thumbnail generation request in progress for a given block.
|
|
2253
|
+
* @param id - The video fill or page.
|
|
2254
|
+
* @param thumbnailHeight - The height of a thumbnail. The width will be calculated from the video aspect ratio.
|
|
2255
|
+
* @param timeBegin - The time in seconds at which the thumbnail sequence should start.
|
|
2256
|
+
* @param timeEnd - The time in seconds at which the thumbnail sequence should end.
|
|
2257
|
+
* @param numberOfFrames - The number of frames to generate.
|
|
2258
|
+
* @param onFrame - Gets passed the frame index and RGBA image data.
|
|
2259
|
+
* @returns A method that will cancel any thumbnail generation request in progress for this block.
|
|
2260
|
+
*/
|
|
2261
|
+
generateVideoThumbnailSequence(id: DesignBlockId, thumbnailHeight: number, timeBegin: number, timeEnd: number, numberOfFrames: number, onFrame: (frameIndex: number, result: ImageData | Error) => void): () => void;
|
|
2181
2262
|
/**
|
|
2182
2263
|
* Generate a thumbnail for the given video fill.
|
|
2183
2264
|
* @param id - The video fill.
|
|
2184
2265
|
* @param thumbnailHeight - The height of a thumbnail. The width will be calculated from the video aspect ratio.
|
|
2185
2266
|
* @returns A thumbnail encoded as JPEG.
|
|
2267
|
+
* @deprecated Use `generateVideoThumbnailSequence` instead.
|
|
2186
2268
|
*/
|
|
2187
2269
|
getVideoFillThumbnail(id: DesignBlockId, thumbnailHeight: number): Promise<Blob>;
|
|
2188
2270
|
/**
|
|
@@ -2192,6 +2274,7 @@ export declare class BlockAPI {
|
|
|
2192
2274
|
* @param numberOfRows - The number of rows to generate.
|
|
2193
2275
|
* @param thumbnailHeight - The height of a thumbnail. The width will be calculated from the video aspect ratio.
|
|
2194
2276
|
* @returns A thumbnail atlas of the video as JPEG.
|
|
2277
|
+
* @deprecated Use `generateVideoThumbnailSequence` instead.
|
|
2195
2278
|
*/
|
|
2196
2279
|
getVideoFillThumbnailAtlas(id: DesignBlockId, numberOfColumns: number, numberOfRows: number, thumbnailHeight: number): Promise<Blob>;
|
|
2197
2280
|
/**
|
|
@@ -2201,6 +2284,7 @@ export declare class BlockAPI {
|
|
|
2201
2284
|
* @param numberOfRows - The number of rows to generate.
|
|
2202
2285
|
* @param thumbnailHeight - The height of a thumbnail. The width will be calculated from the page aspect ratio.
|
|
2203
2286
|
* @returns A thumbnail atlas of the composition as JPEG.
|
|
2287
|
+
* @deprecated Use `generateVideoThumbnailSequence` instead.
|
|
2204
2288
|
*/
|
|
2205
2289
|
getPageThumbnailAtlas(id: DesignBlockId, numberOfColumns: number, numberOfRows: number, thumbnailHeight: number): Promise<Blob>;
|
|
2206
2290
|
}
|
|
@@ -2734,7 +2818,7 @@ export declare enum DesignBlockType {
|
|
|
2734
2818
|
}
|
|
2735
2819
|
|
|
2736
2820
|
/**
|
|
2737
|
-
* The
|
|
2821
|
+
* The unit type in which the page values (size, distances, etc.) are defined.
|
|
2738
2822
|
* @public
|
|
2739
2823
|
*/
|
|
2740
2824
|
export declare type DesignUnit = 'Pixel' | 'Millimeter' | 'Inch';
|
|
@@ -3175,7 +3259,10 @@ export declare type HistoryId = number;
|
|
|
3175
3259
|
*/
|
|
3176
3260
|
export declare type HorizontalBlockAlignment = 'Left' | 'Right' | 'Center';
|
|
3177
3261
|
|
|
3178
|
-
/**
|
|
3262
|
+
/**
|
|
3263
|
+
* The horizontal text alignment options.
|
|
3264
|
+
* @public
|
|
3265
|
+
*/
|
|
3179
3266
|
export declare type HorizontalTextAlignment = 'Left' | 'Right' | 'Center';
|
|
3180
3267
|
|
|
3181
3268
|
/**
|
|
@@ -3739,7 +3826,10 @@ export declare interface Vec4 {
|
|
|
3739
3826
|
*/
|
|
3740
3827
|
export declare type VerticalBlockAlignment = 'Top' | 'Bottom' | 'Center';
|
|
3741
3828
|
|
|
3742
|
-
/**
|
|
3829
|
+
/**
|
|
3830
|
+
* The vertical text alignment options.
|
|
3831
|
+
* @public
|
|
3832
|
+
*/
|
|
3743
3833
|
export declare type VerticalTextAlignment = 'Top' | 'Bottom' | 'Center';
|
|
3744
3834
|
|
|
3745
3835
|
/**
|
|
@@ -3800,7 +3890,10 @@ export declare type VideoExportOptions = {
|
|
|
3800
3890
|
*/
|
|
3801
3891
|
export declare type XYWH = [x: number, y: number, w: number, h: number];
|
|
3802
3892
|
|
|
3803
|
-
/**
|
|
3893
|
+
/**
|
|
3894
|
+
* The axis(es) for which to auto-fit.
|
|
3895
|
+
* @public
|
|
3896
|
+
*/
|
|
3804
3897
|
export declare type ZoomAutoFitAxis = 'Horizontal' | 'Vertical' | 'Both';
|
|
3805
3898
|
|
|
3806
3899
|
export { }
|