@cesdk/node 1.76.0-nightly.20260521 → 1.76.0-rc.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
|
@@ -899,6 +899,35 @@ export declare interface AssetEnumProperty {
|
|
|
899
899
|
options: string[];
|
|
900
900
|
}
|
|
901
901
|
|
|
902
|
+
/**
|
|
903
|
+
* Filter expression — predicate or logical combinator. Combinators nest
|
|
904
|
+
* arbitrarily. The union is mutually exclusive: an object with both
|
|
905
|
+
* `and` and `or`, or with `property` next to a combinator key, is
|
|
906
|
+
* rejected at the type level.
|
|
907
|
+
*
|
|
908
|
+
* Missing-key semantics for `not`: a predicate is `false` on an asset
|
|
909
|
+
* that lacks the targeted field, so a negated `meta.foo === 'x'` matches
|
|
910
|
+
* assets where `meta.foo !== 'x'` **and** assets that lack `meta.foo`
|
|
911
|
+
* entirely.
|
|
912
|
+
* @public
|
|
913
|
+
*/
|
|
914
|
+
export declare type AssetFilter = AssetPropertyFilter | {
|
|
915
|
+
and: AssetFilter[];
|
|
916
|
+
or?: never;
|
|
917
|
+
not?: never;
|
|
918
|
+
property?: never;
|
|
919
|
+
} | {
|
|
920
|
+
or: AssetFilter[];
|
|
921
|
+
and?: never;
|
|
922
|
+
not?: never;
|
|
923
|
+
property?: never;
|
|
924
|
+
} | {
|
|
925
|
+
not: AssetFilter;
|
|
926
|
+
and?: never;
|
|
927
|
+
or?: never;
|
|
928
|
+
property?: never;
|
|
929
|
+
};
|
|
930
|
+
|
|
902
931
|
/**
|
|
903
932
|
* Asset transform preset payload fixed aspect ratio
|
|
904
933
|
* @public
|
|
@@ -1007,6 +1036,39 @@ export declare interface AssetPayload {
|
|
|
1007
1036
|
*/
|
|
1008
1037
|
export declare type AssetProperty = AssetBooleanProperty | AssetColorProperty | AssetEnumProperty | AssetNumberProperty | AssetStringProperty;
|
|
1009
1038
|
|
|
1039
|
+
/**
|
|
1040
|
+
* A single property predicate. Exactly one of `contains` (case-insensitive
|
|
1041
|
+
* substring) or `equals` (case-insensitive equality) must be set — the
|
|
1042
|
+
* type forbids passing both or neither. On a string-array property
|
|
1043
|
+
* (`tags`, `groups`), the operator matches if any element matches.
|
|
1044
|
+
*
|
|
1045
|
+
* `meta.<key>` values are flat strings in the engine; if a meta value
|
|
1046
|
+
* was originally serialized as a number or boolean, stringify it the
|
|
1047
|
+
* same way before comparing.
|
|
1048
|
+
* @public
|
|
1049
|
+
*/
|
|
1050
|
+
export declare type AssetPropertyFilter = {
|
|
1051
|
+
property: AssetPropertyPath;
|
|
1052
|
+
} & ({
|
|
1053
|
+
contains: string;
|
|
1054
|
+
equals?: never;
|
|
1055
|
+
} | {
|
|
1056
|
+
equals: string;
|
|
1057
|
+
contains?: never;
|
|
1058
|
+
});
|
|
1059
|
+
|
|
1060
|
+
/**
|
|
1061
|
+
* Dot-path against the resolved asset that a property predicate targets:
|
|
1062
|
+
* `label`, `id`, `tags`, `groups`, or `meta.<key>` (one segment — meta
|
|
1063
|
+
* values in the engine are flat strings).
|
|
1064
|
+
*
|
|
1065
|
+
* The template literal accepts `'meta.'` (empty key) because TypeScript's
|
|
1066
|
+
* `${string}` includes the empty string; the engine rejects this at
|
|
1067
|
+
* runtime with an explanatory error.
|
|
1068
|
+
* @public
|
|
1069
|
+
*/
|
|
1070
|
+
export declare type AssetPropertyPath = 'label' | 'tags' | 'id' | 'groups' | `meta.${string}`;
|
|
1071
|
+
|
|
1010
1072
|
/**
|
|
1011
1073
|
* Defines a request for querying assets
|
|
1012
1074
|
* @public
|
|
@@ -1053,6 +1115,34 @@ export declare interface AssetQueryData {
|
|
|
1053
1115
|
* Sort assets that are marked as active first.
|
|
1054
1116
|
*/
|
|
1055
1117
|
sortActiveFirst?: boolean;
|
|
1118
|
+
/**
|
|
1119
|
+
* Optional structured filter, AND-combined with the result of `query` /
|
|
1120
|
+
* `tags` / `groups` / `excludeGroups`. The top-level array is an implicit
|
|
1121
|
+
* AND of its entries. Each entry is either a property predicate
|
|
1122
|
+
* (`{ property, contains?, equals? }`) or a logical combinator
|
|
1123
|
+
* (`{ and: [...] }`, `{ or: [...] }`, `{ not: ... }`). Combinators nest.
|
|
1124
|
+
*
|
|
1125
|
+
* **When to use `filter` vs `tags` / `groups` / `excludeGroups`:**
|
|
1126
|
+
* The legacy `tags` / `groups` / `excludeGroups` fields remain
|
|
1127
|
+
* supported and are equivalent to filter predicates with `equals` and
|
|
1128
|
+
* implicit AND. Prefer `filter` for anything beyond a plain include/
|
|
1129
|
+
* exclude list — case-insensitive substrings, `meta.<key>` matches,
|
|
1130
|
+
* `or` / `not` combinators — and reach for the legacy fields only
|
|
1131
|
+
* when you want their case-sensitive exact-match semantics.
|
|
1132
|
+
*
|
|
1133
|
+
* Malformed filters reject the returned promise with the engine's
|
|
1134
|
+
* parse-error message (e.g. `"Unknown asset property '…'"`).
|
|
1135
|
+
*
|
|
1136
|
+
* @example
|
|
1137
|
+
* ```ts
|
|
1138
|
+
* filter: [
|
|
1139
|
+
* { property: 'label', contains: 'Roboto' },
|
|
1140
|
+
* { property: 'meta.languages', contains: 'de' },
|
|
1141
|
+
* { not: { property: 'meta.legacy', equals: 'true' } }
|
|
1142
|
+
* ]
|
|
1143
|
+
* ```
|
|
1144
|
+
*/
|
|
1145
|
+
filter?: AssetFilter[];
|
|
1056
1146
|
}
|
|
1057
1147
|
|
|
1058
1148
|
/**
|
|
@@ -6446,7 +6536,7 @@ export declare const ContentFillModeValues: readonly ["Crop", "Cover", "Contain"
|
|
|
6446
6536
|
*/
|
|
6447
6537
|
export declare type CreateSceneOptions = {
|
|
6448
6538
|
/** The page options */
|
|
6449
|
-
page
|
|
6539
|
+
page?: {
|
|
6450
6540
|
/** The size of the page */
|
|
6451
6541
|
size: number | {
|
|
6452
6542
|
width: number;
|
|
@@ -6455,6 +6545,15 @@ export declare type CreateSceneOptions = {
|
|
|
6455
6545
|
/** The background color of the page */
|
|
6456
6546
|
color?: Color;
|
|
6457
6547
|
};
|
|
6548
|
+
/**
|
|
6549
|
+
* The design unit of the new scene. Defaults to `Pixel`.
|
|
6550
|
+
*/
|
|
6551
|
+
designUnit?: SceneDesignUnit;
|
|
6552
|
+
/**
|
|
6553
|
+
* The unit in which font sizes for `setTextFontSize` and `getTextFontSizes` are interpreted.
|
|
6554
|
+
* If omitted, it is paired with `designUnit`: `Pixel` scenes get `Pixel`, all other scenes get `Point`.
|
|
6555
|
+
*/
|
|
6556
|
+
fontSizeUnit?: SceneFontSizeUnit;
|
|
6458
6557
|
};
|
|
6459
6558
|
|
|
6460
6559
|
/**
|
|
@@ -8120,6 +8219,7 @@ declare interface FindAssetsQuery {
|
|
|
8120
8219
|
sortingOrder: SortingOrder;
|
|
8121
8220
|
sortKey: string;
|
|
8122
8221
|
sortActiveFirst: boolean;
|
|
8222
|
+
filter: AssetFilter[];
|
|
8123
8223
|
}
|
|
8124
8224
|
|
|
8125
8225
|
/**
|
|
@@ -8803,6 +8903,8 @@ export declare class SceneAPI {
|
|
|
8803
8903
|
*
|
|
8804
8904
|
* ```javascript
|
|
8805
8905
|
* const scene = engine.scene.create(layout);
|
|
8906
|
+
* // With a specific design unit and auto-paired font-size unit:
|
|
8907
|
+
* const pxScene = engine.scene.create('Free', { designUnit: 'Pixel' });
|
|
8806
8908
|
* ```
|
|
8807
8909
|
*
|
|
8808
8910
|
* @category Scene Creation
|
|
@@ -8811,6 +8913,9 @@ export declare class SceneAPI {
|
|
|
8811
8913
|
* - `page` - Page options. Properties:
|
|
8812
8914
|
* - `size` - The size of the page.
|
|
8813
8915
|
* - `color` - Optional background color of the page.
|
|
8916
|
+
* - `designUnit` - The design unit of the new scene. Defaults to `Pixel`.
|
|
8917
|
+
* - `fontSizeUnit` - The font-size unit. If omitted, paired with `designUnit`
|
|
8918
|
+
* (`Pixel` design unit → `Pixel` font unit, others → `Point`).
|
|
8814
8919
|
* @returns The scene's handle.
|
|
8815
8920
|
*/
|
|
8816
8921
|
create(sceneLayout?: SceneLayout, options?: CreateSceneOptions): DesignBlockId;
|
|
@@ -8954,6 +9059,30 @@ export declare class SceneAPI {
|
|
|
8954
9059
|
* @returns The current design unit.
|
|
8955
9060
|
*/
|
|
8956
9061
|
getDesignUnit(): SceneDesignUnit;
|
|
9062
|
+
/**
|
|
9063
|
+
* Sets the unit in which font sizes for `setTextFontSize` and `getTextFontSizes` are interpreted.
|
|
9064
|
+
* The engine continues to store font sizes in points internally; this only affects how values
|
|
9065
|
+
* are interpreted at the API boundary when callers don't specify a `unit` in `TextFontSizeOptions`.
|
|
9066
|
+
*
|
|
9067
|
+
* ```javascript
|
|
9068
|
+
* engine.scene.setFontSizeUnit('Pixel');
|
|
9069
|
+
* ```
|
|
9070
|
+
*
|
|
9071
|
+
* @category Scene Properties
|
|
9072
|
+
* @param fontSizeUnit - The new font-size unit of the scene.
|
|
9073
|
+
*/
|
|
9074
|
+
setFontSizeUnit(fontSizeUnit: SceneFontSizeUnit): void;
|
|
9075
|
+
/**
|
|
9076
|
+
* Returns the font-size unit of the current scene.
|
|
9077
|
+
*
|
|
9078
|
+
* ```javascript
|
|
9079
|
+
* engine.scene.getFontSizeUnit();
|
|
9080
|
+
* ```
|
|
9081
|
+
*
|
|
9082
|
+
* @category Scene Properties
|
|
9083
|
+
* @returns The current font-size unit.
|
|
9084
|
+
*/
|
|
9085
|
+
getFontSizeUnit(): SceneFontSizeUnit;
|
|
8957
9086
|
/**
|
|
8958
9087
|
* Get the layout of the current scene.
|
|
8959
9088
|
*
|
|
@@ -9299,6 +9428,12 @@ export { SceneDesignUnit }
|
|
|
9299
9428
|
/** @public */
|
|
9300
9429
|
export declare const SceneDesignUnitValues: readonly ["Pixel", "Millimeter", "Inch"];
|
|
9301
9430
|
|
|
9431
|
+
/** @public */
|
|
9432
|
+
export declare type SceneFontSizeUnit = (typeof SceneFontSizeUnitValues)[number];
|
|
9433
|
+
|
|
9434
|
+
/** @public */
|
|
9435
|
+
export declare const SceneFontSizeUnitValues: readonly ["Pixel", "Point"];
|
|
9436
|
+
|
|
9302
9437
|
/** @public */
|
|
9303
9438
|
export declare type SceneLayout = (typeof SceneLayoutValues)[number];
|
|
9304
9439
|
|
|
@@ -9919,7 +10054,10 @@ export declare type TextDecorationStyle = 'Solid' | 'Double' | 'Dotted' | 'Dashe
|
|
|
9919
10054
|
* @public
|
|
9920
10055
|
*/
|
|
9921
10056
|
export declare interface TextFontSizeOptions {
|
|
9922
|
-
/**
|
|
10057
|
+
/**
|
|
10058
|
+
* The unit of the font size. Defaults to the scene's `fontSizeUnit`
|
|
10059
|
+
* (configured via `engine.scene.setFontSizeUnit()`), which itself defaults to `'Point'`.
|
|
10060
|
+
*/
|
|
9923
10061
|
unit?: FontSizeUnit;
|
|
9924
10062
|
/** The start index of the UTF-16 range. Defaults to -1 (start of selection/text) */
|
|
9925
10063
|
from?: number;
|