@rive-app/canvas-advanced-single 2.47.1 → 2.49.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 +87 -1
package/package.json
CHANGED
package/rive_advanced.mjs.d.ts
CHANGED
|
@@ -46,6 +46,9 @@ export interface RiveCanvas {
|
|
|
46
46
|
RenderPaintStyle: typeof RenderPaintStyle;
|
|
47
47
|
StrokeCap: typeof StrokeCap;
|
|
48
48
|
StrokeJoin: typeof StrokeJoin;
|
|
49
|
+
StrokePosition: typeof StrokePosition;
|
|
50
|
+
ImageFilter: typeof ImageFilter;
|
|
51
|
+
ImageWrap: typeof ImageWrap;
|
|
49
52
|
decodeAudio: DecodeAudio;
|
|
50
53
|
decodeImage: DecodeImage;
|
|
51
54
|
decodeFont: DecodeFont;
|
|
@@ -73,6 +76,15 @@ export interface RiveCanvas {
|
|
|
73
76
|
*/
|
|
74
77
|
makeDeferredSession?(): DeferredSession | undefined;
|
|
75
78
|
|
|
79
|
+
/**
|
|
80
|
+
* @experimental Lets deferred renderers replay on one worker shared by the
|
|
81
|
+
* page. Only in the threaded webgl2 build; call it before loading files, so
|
|
82
|
+
* their images reach the worker too.
|
|
83
|
+
*
|
|
84
|
+
* @returns false where the browser cannot draw WebGL2 on a transferred canvas
|
|
85
|
+
*/
|
|
86
|
+
enableReplayWorker?(): boolean;
|
|
87
|
+
|
|
76
88
|
/**
|
|
77
89
|
* Loads a Rive file for the runtime and returns a Rive-specific File class
|
|
78
90
|
*
|
|
@@ -203,6 +215,18 @@ export interface RendererOptions {
|
|
|
203
215
|
* converted to clockwise on a best-effort basis
|
|
204
216
|
*/
|
|
205
217
|
inkbleed?: boolean;
|
|
218
|
+
/**
|
|
219
|
+
* @experimental (webgl2-threads only) Hands the canvas to the replay worker,
|
|
220
|
+
* once `enableReplayWorker()` has succeeded. The renderer then replays only
|
|
221
|
+
* deferred sessions. A canvas handed over before keeps going to the worker.
|
|
222
|
+
*/
|
|
223
|
+
replayWorker?: boolean;
|
|
224
|
+
/**
|
|
225
|
+
* @experimental (webgl2-threads only) Called when the replay worker
|
|
226
|
+
* restores the renderer's lost context, so an idle instance still draws
|
|
227
|
+
* and notices it.
|
|
228
|
+
*/
|
|
229
|
+
onContextRestored?: () => void;
|
|
206
230
|
}
|
|
207
231
|
|
|
208
232
|
/**
|
|
@@ -277,6 +301,22 @@ export declare class RendererWrapper {
|
|
|
277
301
|
* @returns false if inkbleed was requested but the canvas context does not support it
|
|
278
302
|
*/
|
|
279
303
|
setInkbleed?(enabled: boolean): boolean;
|
|
304
|
+
/**
|
|
305
|
+
* @experimental Present on renderers whose canvas is on the replay worker,
|
|
306
|
+
* which can only draw deferred sessions.
|
|
307
|
+
*/
|
|
308
|
+
replaysOnWorker?(): boolean;
|
|
309
|
+
/**
|
|
310
|
+
* @experimental False while the replay worker has yet to take the canvas, or
|
|
311
|
+
* is as many frames behind as it queues. Skip the frame rather than record it.
|
|
312
|
+
*/
|
|
313
|
+
acceptsFrame?(): boolean;
|
|
314
|
+
/**
|
|
315
|
+
* @experimental True once the replay worker's context was lost and restored.
|
|
316
|
+
* What it held is gone, so the renderer and the file's session must be
|
|
317
|
+
* recreated.
|
|
318
|
+
*/
|
|
319
|
+
contextRestored?(): boolean;
|
|
280
320
|
}
|
|
281
321
|
|
|
282
322
|
export declare class RenderPathWrapper {
|
|
@@ -304,11 +344,15 @@ export declare class RenderPathWrapper {
|
|
|
304
344
|
close(): void;
|
|
305
345
|
}
|
|
306
346
|
|
|
347
|
+
export declare class RenderImageWrapper {
|
|
348
|
+
}
|
|
349
|
+
|
|
307
350
|
export declare class RenderPaintWrapper {
|
|
308
351
|
color(value: number): void;
|
|
309
352
|
thickness(value: number): void;
|
|
310
353
|
join(value: StrokeJoin): void;
|
|
311
354
|
cap(value: StrokeCap): void;
|
|
355
|
+
strokePosition(value: StrokePosition): void;
|
|
312
356
|
blendMode(value: BlendMode): void;
|
|
313
357
|
style(value: RenderPaintStyle): void;
|
|
314
358
|
linearGradient(sx: number, sy: number, ex: number, ey: number): void;
|
|
@@ -323,6 +367,19 @@ export declare class RenderPaintWrapper {
|
|
|
323
367
|
tx: number,
|
|
324
368
|
ty: number,
|
|
325
369
|
): void;
|
|
370
|
+
|
|
371
|
+
modulatedImage(
|
|
372
|
+
image: RenderImage,
|
|
373
|
+
filter: ImageFilter,
|
|
374
|
+
wrapX: ImageWrap,
|
|
375
|
+
wrapY: ImageWrap,
|
|
376
|
+
xx: number,
|
|
377
|
+
xy: number,
|
|
378
|
+
yx: number,
|
|
379
|
+
yy: number,
|
|
380
|
+
tx: number,
|
|
381
|
+
ty: number,
|
|
382
|
+
): void;
|
|
326
383
|
}
|
|
327
384
|
|
|
328
385
|
/**
|
|
@@ -352,6 +409,8 @@ export declare class RenderPath extends RenderPathWrapper { }
|
|
|
352
409
|
|
|
353
410
|
export declare class RenderPaint extends RenderPaintWrapper { }
|
|
354
411
|
|
|
412
|
+
export declare class RenderImage extends RenderImageWrapper { }
|
|
413
|
+
|
|
355
414
|
/////////////////////
|
|
356
415
|
// CANVAS RENDERER //
|
|
357
416
|
/////////////////////
|
|
@@ -1200,9 +1259,19 @@ export declare class StateMachineInstance {
|
|
|
1200
1259
|
*/
|
|
1201
1260
|
textInput(text: string): boolean;
|
|
1202
1261
|
|
|
1262
|
+
/**
|
|
1263
|
+
* Submit one frame of gamepad input encoded in the v2 wire format
|
|
1264
|
+
* (see rive-runtime/include/rive/input/gamepad_batch.hpp). Events route to the primary focus
|
|
1265
|
+
* node and bubble up its ancestors; with nothing focused, only scripted drawables receive them.
|
|
1266
|
+
* @param batch - little-endian v2 batch of connected/update/disconnected records
|
|
1267
|
+
* @returns false if the batch was rejected (bad version, malformed record, unknown device,
|
|
1268
|
+
* or no focus manager)
|
|
1269
|
+
*/
|
|
1270
|
+
submitGamepadsFromBuffer(batch: Uint8Array): boolean;
|
|
1271
|
+
|
|
1203
1272
|
/**
|
|
1204
1273
|
* The selected text of the focused element, or an empty string when nothing with a
|
|
1205
|
-
* selection is focused. Used to fill the clipboard on copy/cut. An obscured field
|
|
1274
|
+
* selection is focused. Used to fill the clipboard on copy/cut. An obscured field
|
|
1206
1275
|
* (i.e. a password) reports empty string.
|
|
1207
1276
|
*/
|
|
1208
1277
|
selectedText(): string;
|
|
@@ -1531,6 +1600,23 @@ export enum BlendMode {
|
|
|
1531
1600
|
luminosity = 28,
|
|
1532
1601
|
}
|
|
1533
1602
|
|
|
1603
|
+
export enum ImageFilter {
|
|
1604
|
+
bilinear,
|
|
1605
|
+
nearest,
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
export enum ImageWrap {
|
|
1609
|
+
clamp,
|
|
1610
|
+
repeat,
|
|
1611
|
+
mirror,
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
export enum StrokePosition {
|
|
1615
|
+
inside,
|
|
1616
|
+
center,
|
|
1617
|
+
outside,
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1534
1620
|
///////////
|
|
1535
1621
|
// UTILS //
|
|
1536
1622
|
///////////
|