update typescript to 3.9.5
This commit is contained in:
@@ -55,7 +55,7 @@
|
||||
"ts-node": "^7.0.1",
|
||||
"tslib": "^1.9.3",
|
||||
"tslint": "^4.5.1",
|
||||
"typescript": "^3.8.3"
|
||||
"typescript": "^3.9.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/smoothscroll-polyfill": "^0.3.0",
|
||||
|
||||
@@ -218,7 +218,7 @@ export class Replayer {
|
||||
private setupDom() {
|
||||
this.wrapper = document.createElement('div');
|
||||
this.wrapper.classList.add('replayer-wrapper');
|
||||
this.config.root.appendChild(this.wrapper);
|
||||
this.config.root!.appendChild(this.wrapper);
|
||||
|
||||
this.mouse = document.createElement('div');
|
||||
this.mouse.classList.add('replayer-mouse');
|
||||
@@ -554,7 +554,7 @@ export class Replayer {
|
||||
const { triggerFocus } = this.config;
|
||||
switch (d.type) {
|
||||
case MouseInteractions.Blur:
|
||||
if (((target as Node) as HTMLElement).blur) {
|
||||
if ('blur' in ((target as Node) as HTMLElement)) {
|
||||
((target as Node) as HTMLElement).blur();
|
||||
}
|
||||
break;
|
||||
|
||||
2
typings/boost.d.ts
vendored
Normal file
2
typings/boost.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './index';
|
||||
export * from './packer';
|
||||
1
typings/index.d.ts
vendored
1
typings/index.d.ts
vendored
@@ -2,6 +2,5 @@ import record from './record';
|
||||
import { Replayer } from './replay';
|
||||
import { mirror } from './utils';
|
||||
export { EventType, IncrementalSource, MouseInteractions, ReplayerEvents, } from './types';
|
||||
export { pack, unpack } from './packer';
|
||||
declare const addCustomEvent: <T>(tag: string, payload: T) => void;
|
||||
export { record, addCustomEvent, Replayer, mirror };
|
||||
|
||||
4
typings/record/mutation.d.ts
vendored
4
typings/record/mutation.d.ts
vendored
@@ -13,8 +13,8 @@ export default class MutationBuffer {
|
||||
private inlineStylesheet;
|
||||
private maskAllInputs;
|
||||
constructor(cb: mutationCallBack, blockClass: blockClass, inlineStylesheet: boolean, maskAllInputs: boolean);
|
||||
processMutations(mutations: mutationRecord[]): void;
|
||||
processMutations: (mutations: mutationRecord[]) => void;
|
||||
private processMutation;
|
||||
private genAdds;
|
||||
emit(): void;
|
||||
emit: () => void;
|
||||
}
|
||||
|
||||
17
typings/replay/index.d.ts
vendored
17
typings/replay/index.d.ts
vendored
@@ -1,20 +1,17 @@
|
||||
import Timer from './timer';
|
||||
import { Timer } from './timer';
|
||||
import { eventWithTime, playerConfig, playerMetaData, Handler } from '../types';
|
||||
import './styles/style.css';
|
||||
export declare class Replayer {
|
||||
wrapper: HTMLDivElement;
|
||||
iframe: HTMLIFrameElement;
|
||||
timer: Timer;
|
||||
private events;
|
||||
get timer(): Timer;
|
||||
private config;
|
||||
private mouse;
|
||||
private emitter;
|
||||
private baselineTime;
|
||||
private lastPlayedEvent;
|
||||
private nextUserInteractionEvent;
|
||||
private noramlSpeed;
|
||||
private missingNodeRetryMap;
|
||||
private playing;
|
||||
private legacy_missingNodeRetryMap;
|
||||
private service;
|
||||
constructor(events: Array<eventWithTime | string>, config?: Partial<playerConfig>);
|
||||
on(event: string, handler: Handler): void;
|
||||
setConfig(config: Partial<playerConfig>): void;
|
||||
@@ -24,15 +21,17 @@ export declare class Replayer {
|
||||
play(timeOffset?: number): void;
|
||||
pause(): void;
|
||||
resume(timeOffset?: number): void;
|
||||
startLive(baselineTime?: number): void;
|
||||
addEvent(rawEvent: eventWithTime | string): void;
|
||||
enableInteract(): void;
|
||||
disableInteract(): void;
|
||||
private setupDom;
|
||||
private handleResize;
|
||||
private getDelay;
|
||||
private getCastFn;
|
||||
private rebuildFullSnapshot;
|
||||
private waitForStylesheetLoad;
|
||||
private applyIncremental;
|
||||
private resolveMissingNode;
|
||||
private legacy_resolveMissingNode;
|
||||
private moveAndHover;
|
||||
private hoverElements;
|
||||
private isUserInteraction;
|
||||
|
||||
71
typings/replay/machine.d.ts
vendored
Normal file
71
typings/replay/machine.d.ts
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
import { playerConfig, eventWithTime, Emitter } from '../types';
|
||||
import { Timer } from './timer';
|
||||
export declare type PlayerContext = {
|
||||
events: eventWithTime[];
|
||||
timer: Timer;
|
||||
speed: playerConfig['speed'];
|
||||
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: 'RESUME';
|
||||
payload: {
|
||||
timeOffset: number;
|
||||
};
|
||||
} | {
|
||||
type: 'END';
|
||||
} | {
|
||||
type: 'REPLAY';
|
||||
} | {
|
||||
type: 'FAST_FORWARD';
|
||||
} | {
|
||||
type: 'BACK_TO_NORMAL';
|
||||
} | {
|
||||
type: 'TO_LIVE';
|
||||
payload: {
|
||||
baselineTime?: number;
|
||||
};
|
||||
} | {
|
||||
type: 'ADD_EVENT';
|
||||
payload: {
|
||||
event: eventWithTime;
|
||||
};
|
||||
};
|
||||
export declare type PlayerState = {
|
||||
value: 'inited';
|
||||
context: PlayerContext;
|
||||
} | {
|
||||
value: 'playing';
|
||||
context: PlayerContext;
|
||||
} | {
|
||||
value: 'paused';
|
||||
context: PlayerContext;
|
||||
} | {
|
||||
value: 'ended';
|
||||
context: PlayerContext;
|
||||
} | {
|
||||
value: 'skipping';
|
||||
context: PlayerContext;
|
||||
} | {
|
||||
value: 'live';
|
||||
context: PlayerContext;
|
||||
};
|
||||
declare type PlayerAssets = {
|
||||
emitter: Emitter;
|
||||
getCastFn(event: eventWithTime, isSync: boolean): () => void;
|
||||
};
|
||||
export declare function createPlayerService(context: PlayerContext, { getCastFn, emitter }: PlayerAssets): import("@xstate/fsm").StateMachine.Service<PlayerContext, PlayerEvent, PlayerState>;
|
||||
export {};
|
||||
5
typings/replay/timer.d.ts
vendored
5
typings/replay/timer.d.ts
vendored
@@ -1,5 +1,5 @@
|
||||
import { playerConfig, actionWithDelay } from '../types';
|
||||
export default class Timer {
|
||||
import { playerConfig, actionWithDelay, eventWithTime } from '../types';
|
||||
export declare class Timer {
|
||||
timeOffset: number;
|
||||
private actions;
|
||||
private config;
|
||||
@@ -11,3 +11,4 @@ export default class Timer {
|
||||
clear(): void;
|
||||
private findActionIndex;
|
||||
}
|
||||
export declare function getDelay(event: eventWithTime, baselineTime: number): number;
|
||||
|
||||
5
typings/types.d.ts
vendored
5
typings/types.d.ts
vendored
@@ -161,7 +161,7 @@ export declare type removedNodeMutation = {
|
||||
};
|
||||
export declare type addedNodeMutation = {
|
||||
parentId: number;
|
||||
previousId: number | null;
|
||||
previousId?: number | null;
|
||||
nextId: number | null;
|
||||
node: serializedNodeWithId;
|
||||
};
|
||||
@@ -296,6 +296,7 @@ export declare enum ReplayerEvents {
|
||||
SkipStart = "skip-start",
|
||||
SkipEnd = "skip-end",
|
||||
MouseInteraction = "mouse-interaction",
|
||||
EventCast = "event-cast"
|
||||
EventCast = "event-cast",
|
||||
CustomEvent = "custom-event"
|
||||
}
|
||||
export {};
|
||||
|
||||
Reference in New Issue
Block a user