@cesdk/node 1.9.0-preview.1 → 1.9.0-preview.3

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
@@ -789,6 +789,18 @@ export declare class BlockAPI {
789
789
  * @returns A list of the property names.
790
790
  */
791
791
  findAllProperties(id: DesignBlockId): string[];
792
+ /**
793
+ * Check if a property with a given name is readable
794
+ * @param property - The name of the property whose type should be queried.
795
+ * @returns Whether the property is readable or not. Will return false for unknown properties
796
+ */
797
+ isPropertyReadable(property: string): boolean;
798
+ /**
799
+ * Check if a property with a given name is writable
800
+ * @param property - The name of the property whose type should be queried.
801
+ * @returns Whether the property is writable or not. Will return false for unknown properties
802
+ */
803
+ isPropertyWritable(property: string): boolean;
792
804
  /**
793
805
  * Get the type of a property given its name.
794
806
  * @param property - The name of the property whose type should be queried.
@@ -1895,6 +1907,13 @@ export declare interface Configuration {
1895
1907
  * If not configured the fallback font is used.
1896
1908
  */
1897
1909
  defaultFont?: string;
1910
+ /**
1911
+ * By default the engine tries to create a webgl2 context. If this fails it
1912
+ * falls back to trying to create a webgl1 context. If this configuration
1913
+ * option is set to true, it will no longer try to create a webgl2 context
1914
+ * and always create a webgl1 context.
1915
+ */
1916
+ forceWebGL1?: boolean;
1898
1917
  }
1899
1918
 
1900
1919
  /**
@@ -2531,7 +2550,7 @@ export declare class SceneAPI {
2531
2550
  * Create a new design scene, along with its own camera.
2532
2551
  * @returns The scene's handle.
2533
2552
  */
2534
- create(): DesignBlockId;
2553
+ create(sceneLayout?: SceneLayout): DesignBlockId;
2535
2554
  /**
2536
2555
  * Create a new scene in video mode, along with its own camera and page stack.
2537
2556
  * @returns The scene's handle.
@@ -2546,7 +2565,7 @@ export declare class SceneAPI {
2546
2565
  * @param pixelScaleFactor - The displays pixel scale factor.
2547
2566
  * @returns A promise that resolves with the scene ID on success or rejected with an error otherwise.
2548
2567
  */
2549
- createFromImage(url: string, dpi?: number, pixelScaleFactor?: number): Promise<DesignBlockId>;
2568
+ createFromImage(url: string, dpi?: number, pixelScaleFactor?: number, sceneLayout?: SceneLayout, spacing?: number, spacingInScreenSpace?: boolean): Promise<DesignBlockId>;
2550
2569
  /**
2551
2570
  * Return the currently active scene.
2552
2571
  * @returns The scene or null, if none was created yet.
@@ -2595,6 +2614,13 @@ export declare class SceneAPI {
2595
2614
  * @returns A promise that resolves once the zoom was set or rejects with an error otherwise.
2596
2615
  */
2597
2616
  zoomToBlock(id: DesignBlockId, paddingLeft?: number, paddingTop?: number, paddingRight?: number, paddingBottom?: number): Promise<void>;
2617
+ /**
2618
+ * Subscribe to changes to the zoom level.
2619
+ * @param callback - This function is called at the end of the engine update, if the zoom level has changed.
2620
+ * @returns A method to unsubscribe.
2621
+ * @privateRemarks This will currently fire on _all_ changes to camera properties
2622
+ */
2623
+ onZoomLevelChanged(callback: () => void): () => void;
2598
2624
  /**
2599
2625
  * Converts all values of the current scene into the given design unit.
2600
2626
  * @param designUnit - The new design unit of the scene
@@ -2607,6 +2633,9 @@ export declare class SceneAPI {
2607
2633
  unstable_getDesignUnit(): DesignUnit;
2608
2634
  }
2609
2635
 
2636
+ /** @public */
2637
+ export declare type SceneLayout = 'Free' | 'VerticalStack' | 'HorizontalStack' | 'DepthStack';
2638
+
2610
2639
  /** @public */
2611
2640
  export declare interface Size2 {
2612
2641
  width: number;