@cesdk/engine 1.76.0-nightly.20260522 → 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
@@ -6655,7 +6655,7 @@ export declare function _createReactiveProperty<T>(initialValue: T, options?: _R
6655
6655
  */
6656
6656
  export declare type CreateSceneOptions = {
6657
6657
  /** The page options */
6658
- page: {
6658
+ page?: {
6659
6659
  /** The size of the page */
6660
6660
  size: number | {
6661
6661
  width: number;
@@ -6664,6 +6664,15 @@ export declare type CreateSceneOptions = {
6664
6664
  /** The background color of the page */
6665
6665
  color?: Color;
6666
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;
6667
6676
  };
6668
6677
 
6669
6678
  /**
@@ -9454,6 +9463,8 @@ export declare class SceneAPI {
9454
9463
  *
9455
9464
  * ```javascript
9456
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' });
9457
9468
  * ```
9458
9469
  *
9459
9470
  * @category Scene Creation
@@ -9462,6 +9473,9 @@ export declare class SceneAPI {
9462
9473
  * - `page` - Page options. Properties:
9463
9474
  * - `size` - The size of the page.
9464
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`).
9465
9479
  * @returns The scene's handle.
9466
9480
  */
9467
9481
  create(sceneLayout?: SceneLayout, options?: CreateSceneOptions): DesignBlockId;
@@ -9605,6 +9619,30 @@ export declare class SceneAPI {
9605
9619
  * @returns The current design unit.
9606
9620
  */
9607
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;
9608
9646
  /**
9609
9647
  * Get the layout of the current scene.
9610
9648
  *
@@ -9950,6 +9988,12 @@ export { SceneDesignUnit }
9950
9988
  /** @public */
9951
9989
  export declare const SceneDesignUnitValues: readonly ["Pixel", "Millimeter", "Inch"];
9952
9990
 
9991
+ /** @public */
9992
+ export declare type SceneFontSizeUnit = (typeof SceneFontSizeUnitValues)[number];
9993
+
9994
+ /** @public */
9995
+ export declare const SceneFontSizeUnitValues: readonly ["Pixel", "Point"];
9996
+
9953
9997
  /** @public */
9954
9998
  export declare type SceneLayout = (typeof SceneLayoutValues)[number];
9955
9999
 
@@ -10606,7 +10650,10 @@ export declare type TextDecorationStyle = 'Solid' | 'Double' | 'Dotted' | 'Dashe
10606
10650
  * @public
10607
10651
  */
10608
10652
  export declare interface TextFontSizeOptions {
10609
- /** 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
+ */
10610
10657
  unit?: FontSizeUnit;
10611
10658
  /** The start index of the UTF-16 range. Defaults to -1 (start of selection/text) */
10612
10659
  from?: number;