Files
rrweb/packages/rrweb-player/typings/index.d.ts
Justin Halsall 2e03e4da2a Fix types in rrwebPlayer (#1247)
* Export correct mirror in player

Was using DeprecatedMirror in its types, that shouldn't be used anymore.

* Add playRange to types

* Create smooth-poems-bake.md

* Apply formatting changes

* Add $set to player type

* Update smooth-poems-bake.md

* Apply formatting changes

* Last two arguments of playRange are optional
2026-04-01 12:00:00 +08:00

88 lines
2.2 KiB
TypeScript
Executable File

import { playerConfig } from 'rrweb/typings/types';
import { eventWithTime } from '@rrweb/types';
import { Replayer } from 'rrweb';
import { Mirror } from 'rrweb-snapshot';
import { SvelteComponent } from 'svelte';
export type RRwebPlayerOptions = {
target: HTMLElement;
props: {
/**
* The events to replay.
* @default `[]`
*/
events: eventWithTime[];
/**
* The width of the replayer
* @defaultValue `1024`
*/
width?: number;
/**
* The height of the replayer
* @defaultValue `576`
*/
height?: number;
/**
* The maximum scale of the replayer (1 = 100%). Set to 0 for unlimited
* @defaultValue `1`
*/
maxScale?: number;
/**
* Whether to autoplay
* @defaultValue `true`
*/
autoPlay?: boolean;
/**
* The default speed to play at
* @defaultValue `1`
*/
speed?: number;
/**
* Speed options in UI
* @defaultValue `[1, 2, 4, 8]`
*/
speedOption?: number[];
/**
* Whether to show the controller UI
* @defaultValue `true`
*/
showController?: boolean;
/**
* Customize the custom events style with a key-value map
* @defaultValue `{}`
*/
tags?: Record<string, string>;
/**
* Customize the color of inactive periods indicator in the progress bar with a valid CSS color string.
* @defaultValue `#D4D4D4`
*/
inactiveColor?: string;
} & Partial<playerConfig>;
};
export default class rrwebPlayer extends SvelteComponent {
constructor(options: RRwebPlayerOptions);
addEventListener(event: string, handler: (params: any) => unknown): void;
addEvent(event: eventWithTime): void;
getMetaData: Replayer['getMetaData'];
getReplayer: () => Replayer;
getMirror: () => Mirror;
toggle: () => void;
setSpeed: (speed: number) => void;
toggleSkipInactive: () => void;
triggerResize: () => void;
$set: (options: { width: number; height: number }) => void;
play: () => void;
pause: () => void;
goto: (timeOffset: number, play?: boolean) => void;
playRange: (
timeOffset: number,
endTimeOffset: number,
startLooping?: boolean,
afterHook?: undefined | (() => void),
) => void;
}