@cesdk/node 1.44.0 → 1.45.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
|
package/index.d.ts
CHANGED
|
@@ -42,8 +42,41 @@ export declare interface Asset {
|
|
|
42
42
|
export declare class AssetAPI {
|
|
43
43
|
#private;
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Register a middleware that is called before applying an asset to the scene.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* engine.asset.unstable_registerApplyAssetMiddleware(async (sourceId, assetResult, apply) => {
|
|
51
|
+
* // do something before applying the asset
|
|
52
|
+
* // You still have the choice to call apply or skip it
|
|
53
|
+
* const blockId = await apply(sourceId, assetResult);
|
|
54
|
+
* // do something after applying the asset
|
|
55
|
+
* return blockId;
|
|
56
|
+
* })
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @param middleware - The middleware function that is called before applying the asset.
|
|
60
|
+
* @returns A function that can be used to remove the middleware.
|
|
61
|
+
*/
|
|
62
|
+
unstable_registerApplyAssetMiddleware(middleware: (sourceId: string, assetResult: AssetResult, apply: AssetAPI['apply']) => Promise<DesignBlockId | undefined>): VoidFunction;
|
|
63
|
+
/**
|
|
64
|
+
* Register a middleware that is called before applying an asset to a block.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* engine.asset.unstable_registerApplyAssetToBlockMiddleware(async (sourceId, assetResult, block, applyToBlock) => {
|
|
69
|
+
* // do something before applying the asset
|
|
70
|
+
* // You still have the choice to call applyToBlock or skip it
|
|
71
|
+
* await applyToBlock(sourceId, assetResult, block);
|
|
72
|
+
* // do something after applying the asset
|
|
73
|
+
* })
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @param middleware - The middleware function that is called before applying the asset.
|
|
77
|
+
* @returns A function that can be used to remove the middleware.
|
|
78
|
+
*/
|
|
79
|
+
unstable_registerApplyAssetToBlockMiddleware(middleware: (sourceId: string, assetResult: AssetResult, block: DesignBlockId, applyToBlock: AssetAPI['applyToBlock']) => Promise<void>): VoidFunction;
|
|
47
80
|
/**
|
|
48
81
|
* Adds a custom asset source. Its ID has to be unique.
|
|
49
82
|
* @param source - The asset source.
|
|
@@ -2825,6 +2858,7 @@ export declare class BlockAPI {
|
|
|
2825
2858
|
getVolume(id: DesignBlockId): number;
|
|
2826
2859
|
/**
|
|
2827
2860
|
* Begins loading the required audio and video resource for the given video fill or audio block.
|
|
2861
|
+
* If the resource had been loaded earlier and resulted in an error, it will be reloaded.
|
|
2828
2862
|
* @param id - The video fill or audio block whose resource should be loaded.
|
|
2829
2863
|
* @returns A Promise that resolves once the resource has finished loading.
|
|
2830
2864
|
*/
|
|
@@ -2988,6 +3022,7 @@ export declare class BlockAPI {
|
|
|
2988
3022
|
onStateChanged: (ids: DesignBlockId[], callback: (ids: DesignBlockId[]) => void) => (() => void);
|
|
2989
3023
|
/**
|
|
2990
3024
|
* Begins loading the resources of the given blocks and their children.
|
|
3025
|
+
* If the resource had been loaded earlier and resulted in an error, it will be reloaded.
|
|
2991
3026
|
* This function is useful for preloading resources before they are needed.
|
|
2992
3027
|
* Warning: For elements with a source set, all elements in the source set will be loaded.
|
|
2993
3028
|
* @param ids - The blocks whose resources should be loaded. The given blocks don't require to have resources and
|
|
@@ -3585,7 +3620,7 @@ export declare class EditorAPI {
|
|
|
3585
3620
|
* Sets a custom URI resolver.
|
|
3586
3621
|
* This function can be called more than once. Subsequent calls will overwrite previous calls.
|
|
3587
3622
|
* To remove a previously set resolver, pass the value `null`.
|
|
3588
|
-
* The given function must return an absolute path with a scheme.
|
|
3623
|
+
* The given function must return an absolute path with a scheme. The input is allowed to be invalid URI, e.g., due to placeholders.
|
|
3589
3624
|
* @param resolver - Custom resolution function. The resolution function
|
|
3590
3625
|
* should not reference variables outside of its scope.
|
|
3591
3626
|
* It receives the default URI resolver as its second argument
|
|
@@ -4456,7 +4491,7 @@ export declare type SceneMode = 'Design' | 'Video';
|
|
|
4456
4491
|
export declare type Scope = 'text/edit' | 'text/character' | 'fill/change' | 'fill/changeType' | 'stroke/change' | 'shape/change' | 'layer/move' | 'layer/resize' | 'layer/rotate' | 'layer/flip' | 'layer/crop' | 'layer/opacity' | 'layer/blendMode' | 'layer/visibility' | 'layer/clipping' | 'appearance/adjustments' | 'appearance/filter' | 'appearance/effect' | 'appearance/blur' | 'appearance/shadow' | 'appearance/animation' | 'lifecycle/destroy' | 'lifecycle/duplicate' | 'editor/add' | 'editor/select';
|
|
4457
4492
|
|
|
4458
4493
|
/** @public */
|
|
4459
|
-
export declare type SettingsBool = 'controlGizmo/showCropHandles' | 'controlGizmo/showCropScaleHandles' | 'controlGizmo/showMoveHandles' | 'controlGizmo/showResizeHandles' | 'controlGizmo/showRotateHandles' | 'controlGizmo/showScaleHandles' | 'doubleClickToCropEnabled' | 'features/singlePageModeEnabled' | 'features/pageCarouselEnabled' | 'features/transformEditsRetainCoverMode' | 'mouse/enableScroll' | 'mouse/enableZoom' | 'page/allowCropInteraction' | 'page/allowMoveInteraction' | 'page/allowResizeInteraction' | 'page/allowRotateInteraction' | 'page/dimOutOfPageAreas' | 'page/restrictResizeInteractionToFixedAspectRatio' | 'page/moveChildrenWhenCroppingFill' | 'page/title/appendPageName' | 'page/title/show' | 'page/title/showOnSinglePage' | 'page/title/showPageTitleTemplate' | 'placeholderControls/showButton' | 'placeholderControls/showOverlay' | 'blockAnimations/enabled' | 'showBuildVersion' | 'touch/dragStartCanSelect' | 'touch/singlePointPanning';
|
|
4494
|
+
export declare type SettingsBool = 'controlGizmo/showCropHandles' | 'controlGizmo/showCropScaleHandles' | 'controlGizmo/showMoveHandles' | 'controlGizmo/showResizeHandles' | 'controlGizmo/showRotateHandles' | 'controlGizmo/showScaleHandles' | 'doubleClickToCropEnabled' | 'features/singlePageModeEnabled' | 'features/pageCarouselEnabled' | 'features/transformEditsRetainCoverMode' | 'mouse/enableScroll' | 'mouse/enableZoom' | 'page/allowCropInteraction' | 'page/allowMoveInteraction' | 'page/allowResizeInteraction' | 'page/allowRotateInteraction' | 'page/dimOutOfPageAreas' | 'page/restrictResizeInteractionToFixedAspectRatio' | 'page/moveChildrenWhenCroppingFill' | 'page/title/appendPageName' | 'page/title/show' | 'page/title/showOnSinglePage' | 'page/title/showPageTitleTemplate' | 'placeholderControls/showButton' | 'placeholderControls/showOverlay' | 'blockAnimations/enabled' | 'showBuildVersion' | 'touch/dragStartCanSelect' | 'touch/singlePointPanning' | 'useSystemFontFallback' | 'forceSystemEmojis';
|
|
4460
4495
|
|
|
4461
4496
|
/** @public
|
|
4462
4497
|
*/
|
|
@@ -4479,7 +4514,7 @@ export declare type SettingsEnum = {
|
|
|
4479
4514
|
export declare type SettingsFloat = 'controlGizmo/blockScaleDownLimit' | 'positionSnappingThreshold' | 'rotationSnappingThreshold';
|
|
4480
4515
|
|
|
4481
4516
|
/** @public */
|
|
4482
|
-
export declare type SettingsString = 'basePath' | 'defaultEmojiFontFileUri' | 'defaultFontFileUri' | 'license' | 'page/title/fontFileUri' | 'page/title/separator';
|
|
4517
|
+
export declare type SettingsString = 'basePath' | 'defaultEmojiFontFileUri' | 'defaultFontFileUri' | 'license' | 'page/title/fontFileUri' | 'page/title/separator' | 'fallbackFontUri';
|
|
4483
4518
|
|
|
4484
4519
|
/** @public */
|
|
4485
4520
|
export declare type SettingType = 'Bool' | 'Int' | 'Float' | 'String' | 'Color' | 'Enum';
|