@splinetool/runtime 1.10.16 → 1.10.18

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.18",
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
@@ -6,6 +6,16 @@ declare module '@splinetool/runtime' {
6
6
  };
7
7
  };
8
8
 
9
+ export enum Easing {
10
+ LINEAR = 0,
11
+ EASE = 1,
12
+ EASE_IN = 2,
13
+ EASE_OUT = 3,
14
+ EASE_IN_OUT = 4,
15
+ CUBIC = 5,
16
+ SPRING = 6,
17
+ }
18
+
9
19
  export type SplineEventName =
10
20
  | 'mouseDown'
11
21
  | 'mouseUp'
@@ -19,6 +29,42 @@ declare module '@splinetool/runtime' {
19
29
  | 'collision'
20
30
  | 'rendered';
21
31
 
32
+ export type TransitionChainParams = {
33
+ /**
34
+ * When set, the transition will start from this state. If undefined (or not set) it will start from current state in the timeline.
35
+ * When null it will start from the Base State / default state.
36
+ */
37
+ from?: string | null;
38
+ to: string | null;
39
+ duration?: number;
40
+ delay?: number;
41
+ } & EasingData;
42
+
43
+ export type TransitionParams = TransitionChainParams & {
44
+ autoPlay?: boolean;
45
+ };
46
+
47
+ export type TransitionFactory = {
48
+ transition: (params: TransitionChainParams) => TransitionFactory;
49
+ /**
50
+ * Starts the transition.
51
+ */
52
+ play: () => TransitionFactory;
53
+ /**
54
+ * Pauses the transition.
55
+ */
56
+ pause: () => TransitionFactory;
57
+ /**
58
+ * Resets the transition.
59
+ */
60
+ reset: () => TransitionFactory;
61
+ /**
62
+ * Seeks the transition to a specific time.
63
+ * @param ms The time in milliseconds.
64
+ */
65
+ seek: (ms: number) => TransitionFactory;
66
+ };
67
+
22
68
  export type SPEObject = {
23
69
  name: string;
24
70
  uuid: string;
@@ -27,6 +73,11 @@ declare module '@splinetool/runtime' {
27
73
  position: { x: number; y: number; z: number };
28
74
  rotation: { x: number; y: number; z: number };
29
75
  scale: { x: number; y: number; z: number };
76
+
77
+ /**
78
+ * Gets or sets the object's current state from a given state name or id. Default state value is undefined.
79
+ */
80
+ state: string | number | undefined;
30
81
  /**
31
82
  * Triggers a Spline event.
32
83
  * Starts from firt state to last state.
@@ -40,6 +91,18 @@ declare module '@splinetool/runtime' {
40
91
  * @param {string} eventName String that matches Spline event's name
41
92
  */
42
93
  emitEventReverse: (eventName: SplineEventName) => void;
94
+ /**
95
+ * Hides the object.
96
+ * Equivalent to object.visible = false
97
+ */
98
+ hide: () => void;
99
+ /**
100
+ * Hides the object.
101
+ * Equivalent to object.visible = true
102
+ */
103
+ show: () => void;
104
+
105
+ transition: (params: TransitionParams) => TransitionFactory;
43
106
  };
44
107
 
45
108
  export class Application {
@@ -231,5 +294,8 @@ declare module '@splinetool/runtime' {
231
294
  * @param url
232
295
  */
233
296
  setUIWasmUrl(url: string): void;
297
+
298
+ pauseGameControls(): void {}
299
+ resumeGameControls(): void {}
234
300
  }
235
301
  }