@splinetool/runtime 0.9.342 → 0.9.344

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splinetool/runtime",
3
- "version": "0.9.342",
3
+ "version": "0.9.344",
4
4
  "type": "module",
5
5
  "main": "./build/runtime.js",
6
6
  "module": "./build/runtime.js",
package/runtime.d.ts CHANGED
@@ -19,7 +19,8 @@ declare module '@splinetool/runtime' {
19
19
  | 'lookAt'
20
20
  | 'follow'
21
21
  | 'scroll'
22
- | 'collision';
22
+ | 'collision'
23
+ | 'rendered';
23
24
 
24
25
  export type SPEObject = {
25
26
  name: string;
@@ -47,10 +48,26 @@ declare module '@splinetool/runtime' {
47
48
  export class Application {
48
49
  _controls: any;
49
50
  renderOnDemand: boolean;
51
+
50
52
  canvas: HTMLCanvasElement;
51
53
  constructor(
52
54
  canvas: HTMLCanvasElement,
53
- { renderOnDemand }?: { renderOnDemand: boolean }
55
+ {
56
+ renderOnDemand,
57
+ }?: {
58
+ /**
59
+ * @deprecated use options.renderMode instead
60
+ */
61
+ renderOnDemand?: boolean;
62
+
63
+ /**
64
+ * Can either be:
65
+ * - `auto` runtime tries to only render when necessary (default).
66
+ * - `manual` only renders when spline.requestRender() is called.
67
+ * - `continuous` continuously render, once per frame.
68
+ */
69
+ renderMode?: 'auto' | 'manual' | 'continuous';
70
+ }
54
71
  );
55
72
  /**
56
73
  * Loads an exported Spline scene
@@ -74,6 +91,11 @@ declare module '@splinetool/runtime' {
74
91
  * @returns {Object} SPEObject
75
92
  */
76
93
  findObjectByName(name: string): SPEObject | undefined;
94
+ /**
95
+ * A flat list of all scene objects
96
+ * @returns {Array.<SPEObject>}
97
+ */
98
+ getAllObjects(): SPEObject[];
77
99
  /**
78
100
  * Returns an array of Spline events
79
101
  * @returns {Array.<Object>}
@@ -128,6 +150,12 @@ declare module '@splinetool/runtime' {
128
150
  */
129
151
  setBackgroundColor(color: string): void;
130
152
 
153
+ /**
154
+ * Change the event type to global when passing true and local when passing false
155
+ * @param global
156
+ */
157
+ setGlobalEvents(global:boolean):void;
158
+
131
159
  /**
132
160
  * Manually sets the canvas size to a specific value.
133
161
  * When this is called, the canvas will no longer be
@@ -140,5 +168,27 @@ declare module '@splinetool/runtime' {
140
168
  get data(): DocumentData;
141
169
  get eventManager(): EventManager;
142
170
  get controls(): ControlsManager;
171
+
172
+ /**
173
+ * Returns true if spline.stop() was previously called
174
+ */
175
+ get isStopped(): boolean;
176
+
177
+ /**
178
+ * Stop/Pause all rendering controls and events
179
+ */
180
+ stop(): void;
181
+
182
+ /**
183
+ * Play/Resume rendering, controls and events
184
+ */
185
+ play(): void;
186
+
187
+ /**
188
+ * To be used concurrently with spline.renderMode = 'manual
189
+ * When called this function will flag the render to dirty which means that
190
+ * the scene will be rendered on next animation frame. Calling this more than once per frame will not trigger multiple render.
191
+ */
192
+ requestRender(): void;
143
193
  }
144
194
  }