@rive-app/canvas-advanced-single 2.50.0 → 2.51.0
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/canvas_advanced_single.mjs +1 -1
- package/package.json +1 -1
- package/rive_advanced.mjs.d.ts +18 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rive-app/canvas-advanced-single",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.51.0",
|
|
4
4
|
"description": "Rive web runtime, low-level API, canvas renderer, bundled as a single JS file. Rive is an agent-native 2D and 3D engine for games, apps, and interactive UI.",
|
|
5
5
|
"main": "canvas_advanced_single.mjs",
|
|
6
6
|
"homepage": "https://rive.app",
|
package/rive_advanced.mjs.d.ts
CHANGED
|
@@ -26,8 +26,6 @@ export default Rive;
|
|
|
26
26
|
export interface ScriptFetchConfig {
|
|
27
27
|
proxyUrl: string | null;
|
|
28
28
|
allowedHosts: string[] | null;
|
|
29
|
-
/** 0 is no limit. */
|
|
30
|
-
maxRequestsPerMinute: number;
|
|
31
29
|
/** 0 keeps the runtime's default. */
|
|
32
30
|
maxResponseBytes: number;
|
|
33
31
|
}
|
|
@@ -62,8 +60,12 @@ export interface RiveCanvas {
|
|
|
62
60
|
decodeAudio: DecodeAudio;
|
|
63
61
|
decodeImage: DecodeImage;
|
|
64
62
|
decodeFont: DecodeFont;
|
|
65
|
-
// Returns a pointer value to the FontWrapper
|
|
66
|
-
|
|
63
|
+
// Returns a pointer value to the FontWrapper. [languages] are BCP 47 tags,
|
|
64
|
+
// the text's own language first, then the system languages.
|
|
65
|
+
setFallbackFontCallback: (callback: (missingGlyph: number, fallbackFontIndex: number, weight: number, languages: string[]) => number | null) => void;
|
|
66
|
+
// The preferred languages text without a language of its own shapes and
|
|
67
|
+
// falls back with, most preferred first.
|
|
68
|
+
setSystemLanguages: (languages: string[]) => void;
|
|
67
69
|
|
|
68
70
|
/**
|
|
69
71
|
* @experimental Creates a deferred recording session. Only present in builds
|
|
@@ -118,6 +120,9 @@ export interface RiveCanvas {
|
|
|
118
120
|
* @param enableRiveAssetCDN - boolean flag to allow loading assets from the Rive CDN, enabled by default.
|
|
119
121
|
* @param session - @experimental Deferred session to import through. The file's mode is fixed
|
|
120
122
|
* at import: pass null (the default) for an immediate file.
|
|
123
|
+
* @param deferDecoding - Decode animations, artboards (other than the default
|
|
124
|
+
* one) and file level view model instances the first time they're used instead of at import.
|
|
125
|
+
* False by default.
|
|
121
126
|
* @returns A Promise for a Rive File class
|
|
122
127
|
*/
|
|
123
128
|
load(
|
|
@@ -125,6 +130,7 @@ export interface RiveCanvas {
|
|
|
125
130
|
assetLoader?: FileAssetLoader,
|
|
126
131
|
enableRiveAssetCDN?: boolean,
|
|
127
132
|
session?: DeferredSession | null,
|
|
133
|
+
deferDecoding?: boolean,
|
|
128
134
|
): Promise<File>;
|
|
129
135
|
|
|
130
136
|
/**
|
|
@@ -167,9 +173,14 @@ export interface RiveCanvas {
|
|
|
167
173
|
* A Rive-specific requestAnimationFrame function; this must be used instead of the global
|
|
168
174
|
* requestAnimationFrame function.
|
|
169
175
|
* @param cb - Callback function to call with an elapsed timestamp
|
|
176
|
+
* @param onWorker - True when the caller's renderer draws on the replay
|
|
177
|
+
* worker (`replaysOnWorker()`), so a worker's frames pace it
|
|
170
178
|
* @returns number - An ID of the requestAnimationFrame request
|
|
171
179
|
*/
|
|
172
|
-
requestAnimationFrame(
|
|
180
|
+
requestAnimationFrame(
|
|
181
|
+
cb: (timestamp: DOMHighResTimeStamp) => void,
|
|
182
|
+
onWorker?: boolean,
|
|
183
|
+
): number;
|
|
173
184
|
/**
|
|
174
185
|
* A Rive-specific cancelAnimationFrame function; this must be used instead of the global
|
|
175
186
|
* cancelAnimationFrame function.
|
|
@@ -338,7 +349,7 @@ export declare class RendererWrapper {
|
|
|
338
349
|
acceptsFrame?(): boolean;
|
|
339
350
|
/**
|
|
340
351
|
* @experimental How long the replay worker's recent frames took to finish,
|
|
341
|
-
* in milliseconds, or 0 before its
|
|
352
|
+
* in milliseconds, or 0 before its third.
|
|
342
353
|
*/
|
|
343
354
|
replayMs?(): number;
|
|
344
355
|
/**
|
|
@@ -1167,7 +1178,7 @@ export declare class StateMachineInstance {
|
|
|
1167
1178
|
* @param dy - Vertical distance the content moves, in Artboard pixels. Revealing content below
|
|
1168
1179
|
* is negative.
|
|
1169
1180
|
* @param phase - Where the event sits within its gesture: 0 begin, 1 update, 2 end,
|
|
1170
|
-
* 3 momentum, 4 inertiaCancel. A phaseless wheel
|
|
1181
|
+
* 3 momentum, 4 inertiaCancel. A phaseless wheel sends 1 (update), or 3 for momentum.
|
|
1171
1182
|
* @param precise - True for a pixel-precise source such as a trackpad, false for a detented
|
|
1172
1183
|
* wheel.
|
|
1173
1184
|
* @param timeStamp - Event time in seconds.
|