@cesdk/engine 1.8.0-alpha.0 → 1.8.0-alpha.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
@@ -1741,18 +1741,24 @@ declare class CreativeEngine {
1741
1741
  scene: SceneAPI;
1742
1742
  variable: VariableAPI;
1743
1743
 
1744
+ get element(): HTMLCreativeEngineCanvasElement | undefined;
1744
1745
  /**
1745
1746
  * Dispose the engine.
1746
1747
  */
1747
1748
  dispose(): void;
1748
1749
  /**
1749
1750
  * Initialize a `CreativeEngine` using the given `canvas` element and an optional config.
1750
- * @param config - A configuration object.
1751
+ * @param config - An optional configuration object.
1751
1752
  * @param canvas - The canvas to use for drawing. Optional, if no canvas is provided,
1752
1753
  * the engine works with an internal offscreen-canvas.
1753
1754
  * @returns An engine instance.
1754
1755
  */
1755
- static init(config?: Partial<Configuration>, canvas?: HTMLCanvasElement | OffscreenCanvas): Promise<CreativeEngine>;
1756
+ static init(config?: Partial<Configuration>): Promise<CreativeEngine & {
1757
+ readonly element: HTMLCreativeEngineCanvasElement;
1758
+ }>;
1759
+ static init(config: Partial<Configuration> | undefined, canvas: HTMLCanvasElement | OffscreenCanvas): Promise<CreativeEngine & {
1760
+ readonly element: undefined;
1761
+ }>;
1756
1762
  }
1757
1763
  export default CreativeEngine;
1758
1764
 
@@ -2141,6 +2147,23 @@ declare type Groups = string[];
2141
2147
  */
2142
2148
  declare type HexColorString = string;
2143
2149
 
2150
+ /**
2151
+ * A wrapper around a plain canvas
2152
+ *
2153
+ * The idea is to shield the user from the weird semantics of changing width
2154
+ * and height of a canvas by making this a opaque block element instead and
2155
+ * managing the internal render resolution of the canvas dynamically
2156
+ *
2157
+ * @public
2158
+ */
2159
+ export declare class HTMLCreativeEngineCanvasElement extends HTMLElement {
2160
+ #private;
2161
+ constructor();
2162
+ connectedCallback(): void;
2163
+ disconnectedCallback(): void;
2164
+
2165
+ }
2166
+
2144
2167
  /** @public */
2145
2168
  declare type ImageDefinition = Preset & {
2146
2169
  imageURL: string;