@splinetool/runtime 1.10.16 → 1.10.17

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": "1.10.16",
3
+ "version": "1.10.17",
4
4
  "description": "Spline is a collaborative design platform for creating production-ready interactive experiences in multiple dimensions. © 2024 Spline, Inc.",
5
5
  "keywords": [
6
6
  "spline",
package/runtime.d.ts CHANGED
@@ -19,6 +19,44 @@ declare module '@splinetool/runtime' {
19
19
  | 'collision'
20
20
  | 'rendered';
21
21
 
22
+ export { EASING_TYPE as Easing } from 'spline-data';
23
+
24
+ export type TransitionChainParams = {
25
+ /**
26
+ * When set, the transition will start from this state. If undefined (or not set) it will start from current state in the timeline.
27
+ * When null it will start from the Base State / default state.
28
+ */
29
+ from?: string | null;
30
+ to: string | null;
31
+ duration?: number;
32
+ delay?: number;
33
+ } & Easing;
34
+
35
+ export type TransitionParams = TransitionChainParams & {
36
+ autoPlay?: boolean;
37
+ };
38
+
39
+ export type TransitionFactory = {
40
+ transition: (params: TransitionChainParams) => TransitionFactory;
41
+ /**
42
+ * Starts the transition.
43
+ */
44
+ play: () => TransitionFactory;
45
+ /**
46
+ * Pauses the transition.
47
+ */
48
+ pause: () => TransitionFactory;
49
+ /**
50
+ * Resets the transition.
51
+ */
52
+ reset: () => TransitionFactory;
53
+ /**
54
+ * Seeks the transition to a specific time.
55
+ * @param ms The time in milliseconds.
56
+ */
57
+ seek: (ms: number) => TransitionFactory;
58
+ };
59
+
22
60
  export type SPEObject = {
23
61
  name: string;
24
62
  uuid: string;
@@ -27,6 +65,11 @@ declare module '@splinetool/runtime' {
27
65
  position: { x: number; y: number; z: number };
28
66
  rotation: { x: number; y: number; z: number };
29
67
  scale: { x: number; y: number; z: number };
68
+
69
+ /**
70
+ * Gets or sets the object's current state from a given state name or id. Default state value is undefined.
71
+ */
72
+ state: string | number | undefined;
30
73
  /**
31
74
  * Triggers a Spline event.
32
75
  * Starts from firt state to last state.
@@ -40,6 +83,18 @@ declare module '@splinetool/runtime' {
40
83
  * @param {string} eventName String that matches Spline event's name
41
84
  */
42
85
  emitEventReverse: (eventName: SplineEventName) => void;
86
+ /**
87
+ * Hides the object.
88
+ * Equivalent to object.visible = false
89
+ */
90
+ hide: () => void;
91
+ /**
92
+ * Hides the object.
93
+ * Equivalent to object.visible = true
94
+ */
95
+ show: () => void;
96
+
97
+ transition: (params: TransitionParams) => TransitionFactory;
43
98
  };
44
99
 
45
100
  export class Application {
@@ -231,5 +286,8 @@ declare module '@splinetool/runtime' {
231
286
  * @param url
232
287
  */
233
288
  setUIWasmUrl(url: string): void;
289
+
290
+ pauseGameControls(): void {}
291
+ resumeGameControls(): void {}
234
292
  }
235
293
  }