update typing files

This commit is contained in:
Yanzhen Yu
2021-08-29 22:42:03 +08:00
parent 5dcbfa530f
commit 5857c7b718
5 changed files with 55 additions and 7 deletions

View File

@@ -24,6 +24,8 @@ export declare class Replayer {
private mirror;
private firstFullSnapshot;
private newDocumentQueue;
private mousePos;
private touchActive;
constructor(events: Array<eventWithTime | string>, config?: Partial<playerConfig>);
on(event: string, handler: Handler): this;
off(event: string, handler: Handler): this;
@@ -42,6 +44,7 @@ export declare class Replayer {
resetCache(): void;
private setupDom;
private handleResize;
private applyEventsSynchronously;
private getCastFn;
private rebuildFullSnapshot;
private insertStyleRules;

View File

@@ -46,9 +46,10 @@ export declare type PlayerState = {
export declare function discardPriorSnapshots(events: eventWithTime[], baselineTime: number): eventWithTime[];
declare type PlayerAssets = {
emitter: Emitter;
applyEventsSynchronously(events: Array<eventWithTime>): void;
getCastFn(event: eventWithTime, isSync: boolean): () => void;
};
export declare function createPlayerService(context: PlayerContext, { getCastFn, emitter }: PlayerAssets): StateMachine.Service<PlayerContext, PlayerEvent, PlayerState>;
export declare function createPlayerService(context: PlayerContext, { getCastFn, applyEventsSynchronously, emitter }: PlayerAssets): StateMachine.Service<PlayerContext, PlayerEvent, PlayerState>;
export declare type SpeedContext = {
normalSpeed: playerConfig['speed'];
timer: Timer;

View File

@@ -2,7 +2,9 @@ import { INode } from 'rrweb-snapshot';
export declare enum StyleRuleType {
Insert = 0,
Remove = 1,
Snapshot = 2
Snapshot = 2,
SetProperty = 3,
RemoveProperty = 4
}
declare type InsertRule = {
cssText: string;
@@ -17,9 +19,25 @@ declare type SnapshotRule = {
type: StyleRuleType.Snapshot;
cssTexts: string[];
};
export declare type VirtualStyleRules = Array<InsertRule | RemoveRule | SnapshotRule>;
declare type SetPropertyRule = {
type: StyleRuleType.SetProperty;
index: number[];
property: string;
value: string | null;
priority: string | undefined;
};
declare type RemovePropertyRule = {
type: StyleRuleType.RemoveProperty;
index: number[];
property: string;
};
export declare type VirtualStyleRules = Array<InsertRule | RemoveRule | SnapshotRule | SetPropertyRule | RemovePropertyRule>;
export declare type VirtualStyleRulesMap = Map<INode, VirtualStyleRules>;
export declare function getNestedRule(rules: CSSRuleList, position: number[]): CSSGroupingRule;
export declare function getPositionsAndIndex(nestedIndex: number[]): {
positions: number[];
index: number | undefined;
};
export declare function applyVirtualStyleRulesToNode(storedRules: VirtualStyleRules, styleNode: HTMLStyleElement): void;
export declare function storeCSSRules(parentElement: HTMLStyleElement, virtualStyleRulesMap: VirtualStyleRulesMap): void;
export {};