@cesdk/engine 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.
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
  /**
@@ -6565,7 +6655,7 @@ export declare function _createReactiveProperty<T>(initialValue: T, options?: _R
6565
6655
  */
6566
6656
  export declare type CreateSceneOptions = {
6567
6657
  /** The page options */
6568
- page: {
6658
+ page?: {
6569
6659
  /** The size of the page */
6570
6660
  size: number | {
6571
6661
  width: number;
@@ -6574,6 +6664,15 @@ export declare type CreateSceneOptions = {
6574
6664
  /** The background color of the page */
6575
6665
  color?: Color;
6576
6666
  };
6667
+ /**
6668
+ * The design unit of the new scene. Defaults to `Pixel`.
6669
+ */
6670
+ designUnit?: SceneDesignUnit;
6671
+ /**
6672
+ * The unit in which font sizes for `setTextFontSize` and `getTextFontSizes` are interpreted.
6673
+ * If omitted, it is paired with `designUnit`: `Pixel` scenes get `Pixel`, all other scenes get `Point`.
6674
+ */
6675
+ fontSizeUnit?: SceneFontSizeUnit;
6577
6676
  };
6578
6677
 
6579
6678
  /**
@@ -8429,6 +8528,7 @@ export declare interface _FindAssetsQuery {
8429
8528
  sortingOrder: SortingOrder;
8430
8529
  sortKey: string;
8431
8530
  sortActiveFirst: boolean;
8531
+ filter: AssetFilter[];
8432
8532
  }
8433
8533
 
8434
8534
  /**
@@ -9363,6 +9463,8 @@ export declare class SceneAPI {
9363
9463
  *
9364
9464
  * ```javascript
9365
9465
  * const scene = engine.scene.create(layout);
9466
+ * // With a specific design unit and auto-paired font-size unit:
9467
+ * const pxScene = engine.scene.create('Free', { designUnit: 'Pixel' });
9366
9468
  * ```
9367
9469
  *
9368
9470
  * @category Scene Creation
@@ -9371,6 +9473,9 @@ export declare class SceneAPI {
9371
9473
  * - `page` - Page options. Properties:
9372
9474
  * - `size` - The size of the page.
9373
9475
  * - `color` - Optional background color of the page.
9476
+ * - `designUnit` - The design unit of the new scene. Defaults to `Pixel`.
9477
+ * - `fontSizeUnit` - The font-size unit. If omitted, paired with `designUnit`
9478
+ * (`Pixel` design unit → `Pixel` font unit, others → `Point`).
9374
9479
  * @returns The scene's handle.
9375
9480
  */
9376
9481
  create(sceneLayout?: SceneLayout, options?: CreateSceneOptions): DesignBlockId;
@@ -9514,6 +9619,30 @@ export declare class SceneAPI {
9514
9619
  * @returns The current design unit.
9515
9620
  */
9516
9621
  getDesignUnit(): SceneDesignUnit;
9622
+ /**
9623
+ * Sets the unit in which font sizes for `setTextFontSize` and `getTextFontSizes` are interpreted.
9624
+ * The engine continues to store font sizes in points internally; this only affects how values
9625
+ * are interpreted at the API boundary when callers don't specify a `unit` in `TextFontSizeOptions`.
9626
+ *
9627
+ * ```javascript
9628
+ * engine.scene.setFontSizeUnit('Pixel');
9629
+ * ```
9630
+ *
9631
+ * @category Scene Properties
9632
+ * @param fontSizeUnit - The new font-size unit of the scene.
9633
+ */
9634
+ setFontSizeUnit(fontSizeUnit: SceneFontSizeUnit): void;
9635
+ /**
9636
+ * Returns the font-size unit of the current scene.
9637
+ *
9638
+ * ```javascript
9639
+ * engine.scene.getFontSizeUnit();
9640
+ * ```
9641
+ *
9642
+ * @category Scene Properties
9643
+ * @returns The current font-size unit.
9644
+ */
9645
+ getFontSizeUnit(): SceneFontSizeUnit;
9517
9646
  /**
9518
9647
  * Get the layout of the current scene.
9519
9648
  *
@@ -9859,6 +9988,12 @@ export { SceneDesignUnit }
9859
9988
  /** @public */
9860
9989
  export declare const SceneDesignUnitValues: readonly ["Pixel", "Millimeter", "Inch"];
9861
9990
 
9991
+ /** @public */
9992
+ export declare type SceneFontSizeUnit = (typeof SceneFontSizeUnitValues)[number];
9993
+
9994
+ /** @public */
9995
+ export declare const SceneFontSizeUnitValues: readonly ["Pixel", "Point"];
9996
+
9862
9997
  /** @public */
9863
9998
  export declare type SceneLayout = (typeof SceneLayoutValues)[number];
9864
9999
 
@@ -10515,7 +10650,10 @@ export declare type TextDecorationStyle = 'Solid' | 'Double' | 'Dotted' | 'Dashe
10515
10650
  * @public
10516
10651
  */
10517
10652
  export declare interface TextFontSizeOptions {
10518
- /** The unit of the font size. Defaults to 'Point' */
10653
+ /**
10654
+ * The unit of the font size. Defaults to the scene's `fontSizeUnit`
10655
+ * (configured via `engine.scene.setFontSizeUnit()`), which itself defaults to `'Point'`.
10656
+ */
10519
10657
  unit?: FontSizeUnit;
10520
10658
  /** The start index of the UTF-16 range. Defaults to -1 (start of selection/text) */
10521
10659
  from?: number;