@splinetool/runtime 0.9.460 → 0.9.462
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/README.md +34 -6
- package/build/runtime.cjs +264 -264
- package/build/runtime.js +263 -263
- package/package.json +1 -1
- package/runtime.d.ts +28 -2
package/package.json
CHANGED
package/runtime.d.ts
CHANGED
|
@@ -69,13 +69,26 @@ declare module '@splinetool/runtime' {
|
|
|
69
69
|
/**
|
|
70
70
|
* Loads an exported Spline scene
|
|
71
71
|
* @param path the url pointing toward a .splinecode file
|
|
72
|
+
* @param variables a key:value object describing initial values of the variables in the file
|
|
72
73
|
*/
|
|
73
|
-
load(
|
|
74
|
+
load(
|
|
75
|
+
path: string,
|
|
76
|
+
variables?: Record<string, string | number | boolean>
|
|
77
|
+
): Promise<void>;
|
|
74
78
|
/**
|
|
75
79
|
* Initializes the application starting from a binary encoded .splinecode file
|
|
76
80
|
* @param array the binary ArrayBuffer of the .splinecode
|
|
77
81
|
*/
|
|
78
|
-
start(
|
|
82
|
+
start(
|
|
83
|
+
array: ArrayBuffer,
|
|
84
|
+
{
|
|
85
|
+
interactive = true,
|
|
86
|
+
variables,
|
|
87
|
+
}?: {
|
|
88
|
+
interactive?: boolean;
|
|
89
|
+
variables?: Record<string, string | number | boolean>;
|
|
90
|
+
}
|
|
91
|
+
): void;
|
|
79
92
|
/**
|
|
80
93
|
* Searches through scene's children and returns the object with that uuid
|
|
81
94
|
* @param uuid String to match to the object's uuid
|
|
@@ -187,5 +200,18 @@ declare module '@splinetool/runtime' {
|
|
|
187
200
|
* the scene will be rendered on next animation frame. Calling this more than once per frame will not trigger multiple render.
|
|
188
201
|
*/
|
|
189
202
|
requestRender(): void;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Change value for multiple variables
|
|
206
|
+
* @param variables a key:value object describing values by name of the variables to update
|
|
207
|
+
*/
|
|
208
|
+
setVariables(variables: Record<string, number | boolean | string>): void;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Change value for a specific variable
|
|
212
|
+
* @param name name of the variable to update
|
|
213
|
+
* @param value new value for this variable
|
|
214
|
+
*/
|
|
215
|
+
setVariable(name: string, value: number | boolean | string): void;
|
|
190
216
|
}
|
|
191
217
|
}
|