moved rrweb into packages/rrweb
This commit is contained in:
69
packages/rrweb/typings/replay/index.d.ts
vendored
Normal file
69
packages/rrweb/typings/replay/index.d.ts
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
import { Timer } from './timer';
|
||||
import { createPlayerService, createSpeedService } from './machine';
|
||||
import { eventWithTime, playerConfig, playerMetaData, Handler, Mirror } from '../types';
|
||||
import './styles/style.css';
|
||||
export declare class Replayer {
|
||||
wrapper: HTMLDivElement;
|
||||
iframe: HTMLIFrameElement;
|
||||
service: ReturnType<typeof createPlayerService>;
|
||||
speedService: ReturnType<typeof createSpeedService>;
|
||||
get timer(): Timer;
|
||||
config: playerConfig;
|
||||
private mouse;
|
||||
private mouseTail;
|
||||
private tailPositions;
|
||||
private emitter;
|
||||
private nextUserInteractionEvent;
|
||||
private legacy_missingNodeRetryMap;
|
||||
private treeIndex;
|
||||
private fragmentParentMap;
|
||||
private elementStateMap;
|
||||
private virtualStyleRulesMap;
|
||||
private imageMap;
|
||||
private mirror;
|
||||
private firstFullSnapshot;
|
||||
private newDocumentQueue;
|
||||
constructor(events: Array<eventWithTime | string>, config?: Partial<playerConfig>);
|
||||
on(event: string, handler: Handler): this;
|
||||
off(event: string, handler: Handler): this;
|
||||
setConfig(config: Partial<playerConfig>): void;
|
||||
getMetaData(): playerMetaData;
|
||||
getCurrentTime(): number;
|
||||
getTimeOffset(): number;
|
||||
getMirror(): Mirror;
|
||||
play(timeOffset?: number): void;
|
||||
pause(timeOffset?: number): void;
|
||||
resume(timeOffset?: number): void;
|
||||
startLive(baselineTime?: number): void;
|
||||
addEvent(rawEvent: eventWithTime | string): void;
|
||||
enableInteract(): void;
|
||||
disableInteract(): void;
|
||||
private setupDom;
|
||||
private handleResize;
|
||||
private getCastFn;
|
||||
private rebuildFullSnapshot;
|
||||
private insertStyleRules;
|
||||
private attachDocumentToIframe;
|
||||
private collectIframeAndAttachDocument;
|
||||
private waitForStylesheetLoad;
|
||||
private preloadAllImages;
|
||||
private applyIncremental;
|
||||
private applyMutation;
|
||||
private applyScroll;
|
||||
private applyInput;
|
||||
private legacy_resolveMissingNode;
|
||||
private moveAndHover;
|
||||
private drawMouseTail;
|
||||
private hoverElements;
|
||||
private isUserInteraction;
|
||||
private backToNormal;
|
||||
private restoreRealParent;
|
||||
private storeState;
|
||||
private restoreState;
|
||||
private restoreNodeSheet;
|
||||
private warnNodeNotFound;
|
||||
private warnCanvasMutationFailed;
|
||||
private debugNodeNotFound;
|
||||
private warn;
|
||||
private debug;
|
||||
}
|
||||
79
packages/rrweb/typings/replay/machine.d.ts
vendored
Normal file
79
packages/rrweb/typings/replay/machine.d.ts
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
import { StateMachine } from '@xstate/fsm';
|
||||
import { playerConfig, eventWithTime, Emitter } from '../types';
|
||||
import { Timer } from './timer';
|
||||
export declare type PlayerContext = {
|
||||
events: eventWithTime[];
|
||||
timer: Timer;
|
||||
timeOffset: number;
|
||||
baselineTime: number;
|
||||
lastPlayedEvent: eventWithTime | null;
|
||||
};
|
||||
export declare type PlayerEvent = {
|
||||
type: 'PLAY';
|
||||
payload: {
|
||||
timeOffset: number;
|
||||
};
|
||||
} | {
|
||||
type: 'CAST_EVENT';
|
||||
payload: {
|
||||
event: eventWithTime;
|
||||
};
|
||||
} | {
|
||||
type: 'PAUSE';
|
||||
} | {
|
||||
type: 'TO_LIVE';
|
||||
payload: {
|
||||
baselineTime?: number;
|
||||
};
|
||||
} | {
|
||||
type: 'ADD_EVENT';
|
||||
payload: {
|
||||
event: eventWithTime;
|
||||
};
|
||||
} | {
|
||||
type: 'END';
|
||||
};
|
||||
export declare type PlayerState = {
|
||||
value: 'playing';
|
||||
context: PlayerContext;
|
||||
} | {
|
||||
value: 'paused';
|
||||
context: PlayerContext;
|
||||
} | {
|
||||
value: 'live';
|
||||
context: PlayerContext;
|
||||
};
|
||||
export declare function discardPriorSnapshots(events: eventWithTime[], baselineTime: number): eventWithTime[];
|
||||
declare type PlayerAssets = {
|
||||
emitter: Emitter;
|
||||
getCastFn(event: eventWithTime, isSync: boolean): () => void;
|
||||
};
|
||||
export declare function createPlayerService(context: PlayerContext, { getCastFn, emitter }: PlayerAssets): StateMachine.Service<PlayerContext, PlayerEvent, PlayerState>;
|
||||
export declare type SpeedContext = {
|
||||
normalSpeed: playerConfig['speed'];
|
||||
timer: Timer;
|
||||
};
|
||||
export declare type SpeedEvent = {
|
||||
type: 'FAST_FORWARD';
|
||||
payload: {
|
||||
speed: playerConfig['speed'];
|
||||
};
|
||||
} | {
|
||||
type: 'BACK_TO_NORMAL';
|
||||
} | {
|
||||
type: 'SET_SPEED';
|
||||
payload: {
|
||||
speed: playerConfig['speed'];
|
||||
};
|
||||
};
|
||||
export declare type SpeedState = {
|
||||
value: 'normal';
|
||||
context: SpeedContext;
|
||||
} | {
|
||||
value: 'skipping';
|
||||
context: SpeedContext;
|
||||
};
|
||||
export declare function createSpeedService(context: SpeedContext): StateMachine.Service<SpeedContext, SpeedEvent, SpeedState>;
|
||||
export declare type PlayerMachineState = StateMachine.State<PlayerContext, PlayerEvent, PlayerState>;
|
||||
export declare type SpeedMachineState = StateMachine.State<SpeedContext, SpeedEvent, SpeedState>;
|
||||
export {};
|
||||
1
packages/rrweb/typings/replay/smoothscroll.d.ts
vendored
Normal file
1
packages/rrweb/typings/replay/smoothscroll.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function polyfill(w?: Window, d?: Document): void;
|
||||
2
packages/rrweb/typings/replay/styles/inject-style.d.ts
vendored
Normal file
2
packages/rrweb/typings/replay/styles/inject-style.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
declare const rules: (blockClass: string) => string[];
|
||||
export default rules;
|
||||
18
packages/rrweb/typings/replay/timer.d.ts
vendored
Normal file
18
packages/rrweb/typings/replay/timer.d.ts
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import { actionWithDelay, eventWithTime } from '../types';
|
||||
export declare class Timer {
|
||||
timeOffset: number;
|
||||
speed: number;
|
||||
private actions;
|
||||
private raf;
|
||||
private liveMode;
|
||||
constructor(actions: actionWithDelay[] | undefined, speed: number);
|
||||
addAction(action: actionWithDelay): void;
|
||||
addActions(actions: actionWithDelay[]): void;
|
||||
start(): void;
|
||||
clear(): void;
|
||||
setSpeed(speed: number): void;
|
||||
toggleLiveMode(mode: boolean): void;
|
||||
isActive(): boolean;
|
||||
private findActionIndex;
|
||||
}
|
||||
export declare function addDelay(event: eventWithTime, baselineTime: number): number;
|
||||
24
packages/rrweb/typings/replay/virtual-styles.d.ts
vendored
Normal file
24
packages/rrweb/typings/replay/virtual-styles.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { INode } from 'rrweb-snapshot';
|
||||
export declare enum StyleRuleType {
|
||||
Insert = 0,
|
||||
Remove = 1,
|
||||
Snapshot = 2
|
||||
}
|
||||
declare type InsertRule = {
|
||||
cssText: string;
|
||||
type: StyleRuleType.Insert;
|
||||
index?: number;
|
||||
};
|
||||
declare type RemoveRule = {
|
||||
type: StyleRuleType.Remove;
|
||||
index: number;
|
||||
};
|
||||
declare type SnapshotRule = {
|
||||
type: StyleRuleType.Snapshot;
|
||||
cssTexts: string[];
|
||||
};
|
||||
export declare type VirtualStyleRules = Array<InsertRule | RemoveRule | SnapshotRule>;
|
||||
export declare type VirtualStyleRulesMap = Map<INode, VirtualStyleRules>;
|
||||
export declare function applyVirtualStyleRulesToNode(storedRules: VirtualStyleRules, styleNode: HTMLStyleElement): void;
|
||||
export declare function storeCSSRules(parentElement: HTMLStyleElement, virtualStyleRulesMap: VirtualStyleRulesMap): void;
|
||||
export {};
|
||||
Reference in New Issue
Block a user