add hooks API (#132)

This commit is contained in:
yz-yu
2019-09-17 23:33:38 +08:00
committed by GitHub
parent a5152de531
commit b64e1492ab
5 changed files with 150 additions and 69 deletions

View File

@@ -119,6 +119,7 @@ export type recordOptions = {
ignoreClass?: string;
maskAllInputs?: boolean;
inlineStylesheet?: boolean;
hooks?: hooksParam;
};
export type observerParam = {
@@ -134,6 +135,15 @@ export type observerParam = {
inlineStylesheet: boolean;
};
export type hooksParam = {
mutation?: mutationCallBack;
mousemove?: mousemoveCallBack;
mouseInteraction?: mouseInteractionCallBack;
scroll?: scrollCallback;
viewportResize?: viewportResizeCallback;
input?: inputCallback;
};
export type textCursor = {
node: Node;
value: string | null;
@@ -285,6 +295,10 @@ export type Emitter = {
emit(type: string, event?: unknown): void;
};
export type Arguments<T> = T extends (...payload: infer U) => unknown
? U
: unknown;
export enum ReplayerEvents {
Start = 'start',
Pause = 'pause',