@cesdk/engine 1.7.0 → 1.8.0-alpha.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
|
|
File without changes
|
package/index.d.ts
CHANGED
|
@@ -77,6 +77,8 @@ export declare class AssetAPI {
|
|
|
77
77
|
url: string | undefined;
|
|
78
78
|
} | undefined;
|
|
79
79
|
canManageAssets(sourceId: string): boolean;
|
|
80
|
+
|
|
81
|
+
|
|
80
82
|
/**
|
|
81
83
|
* Apply an asset result to the active scene.
|
|
82
84
|
* The default behavior will instantiate a block and configure it according to the asset's properties.
|
|
@@ -85,6 +87,12 @@ export declare class AssetAPI {
|
|
|
85
87
|
* @param assetResult - A single assetResult of a `findAssets` query.
|
|
86
88
|
*/
|
|
87
89
|
apply(sourceId: string, assetResult: AssetResult): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* The default implementation for applying an asset to the scene.
|
|
92
|
+
* This implementation is used when no `applyAsset` function is provided to `addSource`.
|
|
93
|
+
* @param assetResult - A single assetResult of a `findAssets` query.
|
|
94
|
+
*/
|
|
95
|
+
defaultApplyAsset(assetResult: AssetResult): Promise<void>;
|
|
88
96
|
}
|
|
89
97
|
|
|
90
98
|
/**
|
|
@@ -243,7 +251,7 @@ export declare interface AssetSource {
|
|
|
243
251
|
/**
|
|
244
252
|
* @returns the asset or undefined if no asset with the given id could be found
|
|
245
253
|
*/
|
|
246
|
-
getAsset(id: string): Promise<AssetResult | undefined>;
|
|
254
|
+
getAsset?(id: string): Promise<AssetResult | undefined>;
|
|
247
255
|
/**
|
|
248
256
|
* Can the source add, update and remove assets dynamically? If `false`
|
|
249
257
|
* methods like `addAsset` `updateAsset` and `removeAsset` will throw an
|
|
@@ -261,20 +269,20 @@ export declare interface AssetSource {
|
|
|
261
269
|
*
|
|
262
270
|
* @returns the id of the added asset
|
|
263
271
|
*/
|
|
264
|
-
addAsset(asset: AssetDefinition): Promise<string>;
|
|
272
|
+
addAsset?(asset: AssetDefinition): Promise<string>;
|
|
265
273
|
/**
|
|
266
274
|
* Updates the asset of this source. Throws an error if `canManageAssets`
|
|
267
275
|
* is `false` or no asset with the given id could not be found.
|
|
268
276
|
*
|
|
269
277
|
* @returns the id of the added asset
|
|
270
278
|
*/
|
|
271
|
-
updateAsset(assetId: string, asset: AssetDefinition): Promise<void>;
|
|
279
|
+
updateAsset?(assetId: string, asset: AssetDefinition): Promise<void>;
|
|
272
280
|
/**
|
|
273
281
|
* Removes the given asset from this source.
|
|
274
282
|
*
|
|
275
283
|
* @returns true if asset was found and removed, and false otherwise
|
|
276
284
|
*/
|
|
277
|
-
removeAsset(assetId: string): Promise<boolean>;
|
|
285
|
+
removeAsset?(assetId: string): Promise<boolean>;
|
|
278
286
|
}
|
|
279
287
|
|
|
280
288
|
/**
|
|
@@ -351,9 +359,6 @@ declare interface AssetsQueryResult_2 {
|
|
|
351
359
|
*/
|
|
352
360
|
export declare type BlendMode = 'PassThrough' | 'Normal' | 'Darken' | 'Multiply' | 'ColorBurn' | 'Lighten' | 'Screen' | 'ColorDodge' | 'Overlay' | 'SoftLight' | 'HardLight' | 'Difference' | 'Exclusion' | 'Hue' | 'Saturation' | 'Color' | 'Luminosity';
|
|
353
361
|
|
|
354
|
-
/** @public */
|
|
355
|
-
declare type Block = number;
|
|
356
|
-
|
|
357
362
|
/**
|
|
358
363
|
* @public
|
|
359
364
|
*/
|
|
@@ -1603,17 +1608,9 @@ export declare class BlockAPI {
|
|
|
1603
1608
|
isAllowedByScope(id: DesignBlockId, key: string): boolean;
|
|
1604
1609
|
}
|
|
1605
1610
|
|
|
1606
|
-
/**
|
|
1607
|
-
* @public
|
|
1608
|
-
*/
|
|
1609
|
-
export declare type BlockEvent = {
|
|
1610
|
-
block: DesignBlockId;
|
|
1611
|
-
type: 'Created' | 'Updated' | 'Destroyed';
|
|
1612
|
-
};
|
|
1613
|
-
|
|
1614
1611
|
/** @public */
|
|
1615
|
-
declare interface
|
|
1616
|
-
block:
|
|
1612
|
+
export declare interface BlockEvent {
|
|
1613
|
+
block: DesignBlockId;
|
|
1617
1614
|
type: 'Created' | 'Updated' | 'Destroyed';
|
|
1618
1615
|
}
|
|
1619
1616
|
|
|
@@ -1759,6 +1756,19 @@ declare class CreativeEngine {
|
|
|
1759
1756
|
}
|
|
1760
1757
|
export default CreativeEngine;
|
|
1761
1758
|
|
|
1759
|
+
/**
|
|
1760
|
+
* Dispatched on the engine canvas when the text input has been blurred.
|
|
1761
|
+
* Call `preventDefault()` to disallow this and refocus the engine text input.
|
|
1762
|
+
* @public
|
|
1763
|
+
*/
|
|
1764
|
+
export declare interface CursorEvent extends CustomEvent<string> {
|
|
1765
|
+
readonly type: 'cesdk-cursor';
|
|
1766
|
+
/** Contains the cursor style */
|
|
1767
|
+
readonly detail: string;
|
|
1768
|
+
/** If default is prevented, the Creative Engine won't apply the cursor style to itself. */
|
|
1769
|
+
preventDefault(): void;
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1762
1772
|
/**
|
|
1763
1773
|
* A numerical identifier for a design block
|
|
1764
1774
|
* @public
|
|
@@ -1951,6 +1961,13 @@ export declare class EditorAPI {
|
|
|
1951
1961
|
* @param resolver - Custom resolution function.
|
|
1952
1962
|
*/
|
|
1953
1963
|
setURIResolver(resolver: (URI: string) => string): void;
|
|
1964
|
+
/**
|
|
1965
|
+
* This is the default implementation for the URI resolver.
|
|
1966
|
+
* It resolves the given path relative to the `ubq://basePath` setting.
|
|
1967
|
+
* @param relativePath - The relative path that should be resolved.
|
|
1968
|
+
* @returns The resolved absolute URI.
|
|
1969
|
+
*/
|
|
1970
|
+
defaultURIResolver(relativePath: string): string;
|
|
1954
1971
|
/**
|
|
1955
1972
|
* Resolves the given path.
|
|
1956
1973
|
* If a custom resolver has been set with `setURIResolver`, it invokes it with the given path.
|
|
@@ -2023,6 +2040,12 @@ export declare type ExportOptions = {
|
|
|
2023
2040
|
* size entirely while maintaining its aspect ratio.
|
|
2024
2041
|
*/
|
|
2025
2042
|
targetHeight?: number;
|
|
2043
|
+
/**
|
|
2044
|
+
* Export the PDF document with a higher compatibility to different PDF viewers.
|
|
2045
|
+
* Bitmap images and some effects like gradients will be rasterized with the DPI
|
|
2046
|
+
* setting instead of embedding them directly.
|
|
2047
|
+
*/
|
|
2048
|
+
exportPdfWithHighCompatibility?: boolean;
|
|
2026
2049
|
};
|
|
2027
2050
|
|
|
2028
2051
|
/** @public */
|
|
@@ -2032,6 +2055,7 @@ declare interface ExportOptions_2 {
|
|
|
2032
2055
|
useTargetSize: boolean;
|
|
2033
2056
|
targetWidth: number;
|
|
2034
2057
|
targetHeight: number;
|
|
2058
|
+
exportPdfWithHighCompatibility: boolean;
|
|
2035
2059
|
}
|
|
2036
2060
|
|
|
2037
2061
|
/** @public */
|
|
@@ -2182,6 +2206,7 @@ declare type PageFormatDefinition = Preset & {
|
|
|
2182
2206
|
unit: DesignUnit;
|
|
2183
2207
|
dpi?: number;
|
|
2184
2208
|
bleedMargin?: number;
|
|
2209
|
+
fixedOrientation?: boolean;
|
|
2185
2210
|
};
|
|
2186
2211
|
|
|
2187
2212
|
/**
|