chore: remove all typings, add them all to .gitignore file and update turbo.json (#949)
This commit is contained in:
1
packages/rrweb-snapshot/.gitignore
vendored
1
packages/rrweb-snapshot/.gitignore
vendored
@@ -6,3 +6,4 @@ dist
|
||||
es
|
||||
lib
|
||||
temp
|
||||
typings
|
||||
|
||||
92
packages/rrweb-snapshot/typings/css.d.ts
vendored
92
packages/rrweb-snapshot/typings/css.d.ts
vendored
@@ -1,92 +0,0 @@
|
||||
export interface ParserOptions {
|
||||
silent?: boolean;
|
||||
source?: string;
|
||||
}
|
||||
export interface ParserError {
|
||||
message?: string;
|
||||
reason?: string;
|
||||
filename?: string;
|
||||
line?: number;
|
||||
column?: number;
|
||||
source?: string;
|
||||
}
|
||||
export interface Loc {
|
||||
line?: number;
|
||||
column?: number;
|
||||
}
|
||||
export interface Node {
|
||||
type?: string;
|
||||
parent?: Node;
|
||||
position?: {
|
||||
start?: Loc;
|
||||
end?: Loc;
|
||||
source?: string;
|
||||
content?: string;
|
||||
};
|
||||
}
|
||||
export interface Rule extends Node {
|
||||
selectors?: string[];
|
||||
declarations?: Array<Declaration | Comment>;
|
||||
}
|
||||
export interface Declaration extends Node {
|
||||
property?: string;
|
||||
value?: string;
|
||||
}
|
||||
export interface Comment extends Node {
|
||||
comment?: string;
|
||||
}
|
||||
export interface Charset extends Node {
|
||||
charset?: string;
|
||||
}
|
||||
export interface CustomMedia extends Node {
|
||||
name?: string;
|
||||
media?: string;
|
||||
}
|
||||
export interface Document extends Node {
|
||||
document?: string;
|
||||
vendor?: string;
|
||||
rules?: Array<Rule | Comment | AtRule>;
|
||||
}
|
||||
export interface FontFace extends Node {
|
||||
declarations?: Array<Declaration | Comment>;
|
||||
}
|
||||
export interface Host extends Node {
|
||||
rules?: Array<Rule | Comment | AtRule>;
|
||||
}
|
||||
export interface Import extends Node {
|
||||
import?: string;
|
||||
}
|
||||
export interface KeyFrames extends Node {
|
||||
name?: string;
|
||||
vendor?: string;
|
||||
keyframes?: Array<KeyFrame | Comment>;
|
||||
}
|
||||
export interface KeyFrame extends Node {
|
||||
values?: string[];
|
||||
declarations?: Array<Declaration | Comment>;
|
||||
}
|
||||
export interface Media extends Node {
|
||||
media?: string;
|
||||
rules?: Array<Rule | Comment | AtRule>;
|
||||
}
|
||||
export interface Namespace extends Node {
|
||||
namespace?: string;
|
||||
}
|
||||
export interface Page extends Node {
|
||||
selectors?: string[];
|
||||
declarations?: Array<Declaration | Comment>;
|
||||
}
|
||||
export interface Supports extends Node {
|
||||
supports?: string;
|
||||
rules?: Array<Rule | Comment | AtRule>;
|
||||
}
|
||||
export declare type AtRule = Charset | CustomMedia | Document | FontFace | Host | Import | KeyFrames | Media | Namespace | Page | Supports;
|
||||
export interface StyleRules {
|
||||
source?: string;
|
||||
rules: Array<Rule | Comment | AtRule>;
|
||||
parsingErrors?: ParserError[];
|
||||
}
|
||||
export interface Stylesheet extends Node {
|
||||
stylesheet?: StyleRules;
|
||||
}
|
||||
export declare function parse(css: string, options?: ParserOptions): Stylesheet;
|
||||
5
packages/rrweb-snapshot/typings/index.d.ts
vendored
5
packages/rrweb-snapshot/typings/index.d.ts
vendored
@@ -1,5 +0,0 @@
|
||||
import snapshot, { serializeNodeWithId, transformAttribute, visitSnapshot, cleanupSnapshot, needMaskingText, classMatchesRegex, IGNORED_NODE } from './snapshot';
|
||||
import rebuild, { buildNodeWithSN, addHoverClass, createCache } from './rebuild';
|
||||
export * from './types';
|
||||
export * from './utils';
|
||||
export { snapshot, serializeNodeWithId, rebuild, buildNodeWithSN, addHoverClass, createCache, transformAttribute, visitSnapshot, cleanupSnapshot, needMaskingText, classMatchesRegex, IGNORED_NODE, };
|
||||
21
packages/rrweb-snapshot/typings/rebuild.d.ts
vendored
21
packages/rrweb-snapshot/typings/rebuild.d.ts
vendored
@@ -1,21 +0,0 @@
|
||||
import { serializedNodeWithId, BuildCache } from './types';
|
||||
import { Mirror } from './utils';
|
||||
export declare function addHoverClass(cssText: string, cache: BuildCache): string;
|
||||
export declare function createCache(): BuildCache;
|
||||
export declare function buildNodeWithSN(n: serializedNodeWithId, options: {
|
||||
doc: Document;
|
||||
mirror: Mirror;
|
||||
skipChild?: boolean;
|
||||
hackCss: boolean;
|
||||
afterAppend?: (n: Node) => unknown;
|
||||
cache: BuildCache;
|
||||
}): Node | null;
|
||||
declare function rebuild(n: serializedNodeWithId, options: {
|
||||
doc: Document;
|
||||
onVisit?: (node: Node) => unknown;
|
||||
hackCss?: boolean;
|
||||
afterAppend?: (n: Node) => unknown;
|
||||
cache: BuildCache;
|
||||
mirror: Mirror;
|
||||
}): Node | null;
|
||||
export default rebuild;
|
||||
59
packages/rrweb-snapshot/typings/snapshot.d.ts
vendored
59
packages/rrweb-snapshot/typings/snapshot.d.ts
vendored
@@ -1,59 +0,0 @@
|
||||
import { serializedNodeWithId, MaskInputOptions, SlimDOMOptions, DataURLOptions, MaskTextFn, MaskInputFn, KeepIframeSrcFn, serializedElementNodeWithId } from './types';
|
||||
import { Mirror } from './utils';
|
||||
export declare const IGNORED_NODE = -2;
|
||||
export declare function absoluteToStylesheet(cssText: string | null, href: string): string;
|
||||
export declare function absoluteToDoc(doc: Document, attributeValue: string): string;
|
||||
export declare function transformAttribute(doc: Document, tagName: string, name: string, value: string): string;
|
||||
export declare function _isBlockedElement(element: HTMLElement, blockClass: string | RegExp, blockSelector: string | null): boolean;
|
||||
export declare function classMatchesRegex(node: Node | null, regex: RegExp, checkAncestors: boolean): boolean;
|
||||
export declare function needMaskingText(node: Node, maskTextClass: string | RegExp, maskTextSelector: string | null): boolean;
|
||||
export declare function serializeNodeWithId(n: Node, options: {
|
||||
doc: Document;
|
||||
mirror: Mirror;
|
||||
blockClass: string | RegExp;
|
||||
blockSelector: string | null;
|
||||
maskTextClass: string | RegExp;
|
||||
maskTextSelector: string | null;
|
||||
skipChild: boolean;
|
||||
inlineStylesheet: boolean;
|
||||
newlyAddedElement?: boolean;
|
||||
maskInputOptions?: MaskInputOptions;
|
||||
maskTextFn: MaskTextFn | undefined;
|
||||
maskInputFn: MaskInputFn | undefined;
|
||||
slimDOMOptions: SlimDOMOptions;
|
||||
dataURLOptions?: DataURLOptions;
|
||||
keepIframeSrcFn?: KeepIframeSrcFn;
|
||||
inlineImages?: boolean;
|
||||
recordCanvas?: boolean;
|
||||
preserveWhiteSpace?: boolean;
|
||||
onSerialize?: (n: Node) => unknown;
|
||||
onIframeLoad?: (iframeNode: HTMLIFrameElement, node: serializedElementNodeWithId) => unknown;
|
||||
iframeLoadTimeout?: number;
|
||||
onStylesheetLoad?: (linkNode: HTMLLinkElement, node: serializedElementNodeWithId) => unknown;
|
||||
stylesheetLoadTimeout?: number;
|
||||
}): serializedNodeWithId | null;
|
||||
declare function snapshot(n: Document, options?: {
|
||||
mirror?: Mirror;
|
||||
blockClass?: string | RegExp;
|
||||
blockSelector?: string | null;
|
||||
maskTextClass?: string | RegExp;
|
||||
maskTextSelector?: string | null;
|
||||
inlineStylesheet?: boolean;
|
||||
maskAllInputs?: boolean | MaskInputOptions;
|
||||
maskTextFn?: MaskTextFn;
|
||||
maskInputFn?: MaskTextFn;
|
||||
slimDOM?: boolean | SlimDOMOptions;
|
||||
dataURLOptions?: DataURLOptions;
|
||||
inlineImages?: boolean;
|
||||
recordCanvas?: boolean;
|
||||
preserveWhiteSpace?: boolean;
|
||||
onSerialize?: (n: Node) => unknown;
|
||||
onIframeLoad?: (iframeNode: HTMLIFrameElement, node: serializedElementNodeWithId) => unknown;
|
||||
iframeLoadTimeout?: number;
|
||||
onStylesheetLoad?: (linkNode: HTMLLinkElement, node: serializedElementNodeWithId) => unknown;
|
||||
stylesheetLoadTimeout?: number;
|
||||
keepIframeSrcFn?: KeepIframeSrcFn;
|
||||
}): serializedNodeWithId | null;
|
||||
export declare function visitSnapshot(node: serializedNodeWithId, onVisit: (node: serializedNodeWithId) => unknown): void;
|
||||
export declare function cleanupSnapshot(): void;
|
||||
export default snapshot;
|
||||
27
packages/rrweb-snapshot/typings/utils.d.ts
vendored
27
packages/rrweb-snapshot/typings/utils.d.ts
vendored
@@ -1,27 +0,0 @@
|
||||
import { MaskInputFn, MaskInputOptions, IMirror, serializedNodeWithId } from './types';
|
||||
export declare function isElement(n: Node): n is Element;
|
||||
export declare function isShadowRoot(n: Node): n is ShadowRoot;
|
||||
export declare function isNativeShadowDom(shadowRoot: ShadowRoot): boolean;
|
||||
export declare class Mirror implements IMirror<Node> {
|
||||
private idNodeMap;
|
||||
private nodeMetaMap;
|
||||
getId(n: Node | undefined | null): number;
|
||||
getNode(id: number): Node | null;
|
||||
getIds(): number[];
|
||||
getMeta(n: Node): serializedNodeWithId | null;
|
||||
removeNodeFromMap(n: Node): void;
|
||||
has(id: number): boolean;
|
||||
hasNode(node: Node): boolean;
|
||||
add(n: Node, meta: serializedNodeWithId): void;
|
||||
replace(id: number, n: Node): void;
|
||||
reset(): void;
|
||||
}
|
||||
export declare function createMirror(): Mirror;
|
||||
export declare function maskInputValue({ maskInputOptions, tagName, type, value, maskInputFn, }: {
|
||||
maskInputOptions: MaskInputOptions;
|
||||
tagName: string;
|
||||
type: string | number | boolean | null;
|
||||
value: string | null;
|
||||
maskInputFn?: MaskInputFn;
|
||||
}): string;
|
||||
export declare function is2DCanvasBlank(canvas: HTMLCanvasElement): boolean;
|
||||
1
packages/rrweb/.gitignore
vendored
1
packages/rrweb/.gitignore
vendored
@@ -7,6 +7,7 @@ build
|
||||
dist
|
||||
es
|
||||
lib
|
||||
typings
|
||||
|
||||
temp
|
||||
|
||||
|
||||
4
packages/rrweb/typings/entries/all.d.ts
vendored
4
packages/rrweb/typings/entries/all.d.ts
vendored
@@ -1,4 +0,0 @@
|
||||
export * from '../index';
|
||||
export * from '../packer';
|
||||
export * from '../plugins/console/record';
|
||||
export * from '../plugins/console/replay';
|
||||
@@ -1,2 +0,0 @@
|
||||
export * from '../record/index';
|
||||
export * from '../packer/pack';
|
||||
@@ -1,2 +0,0 @@
|
||||
export * from '../replay';
|
||||
export * from '../packer/unpack';
|
||||
8
packages/rrweb/typings/index.d.ts
vendored
8
packages/rrweb/typings/index.d.ts
vendored
@@ -1,8 +0,0 @@
|
||||
import record from './record';
|
||||
import { Replayer } from './replay';
|
||||
import { _mirror } from './utils';
|
||||
import * as utils from './utils';
|
||||
export { EventType, IncrementalSource, MouseInteractions, ReplayerEvents, } from './types';
|
||||
declare const addCustomEvent: <T>(tag: string, payload: T) => void;
|
||||
declare const freezePage: () => void;
|
||||
export { record, addCustomEvent, freezePage, Replayer, _mirror as mirror, utils, };
|
||||
7
packages/rrweb/typings/packer/base.d.ts
vendored
7
packages/rrweb/typings/packer/base.d.ts
vendored
@@ -1,7 +0,0 @@
|
||||
import type { eventWithTime } from '../types';
|
||||
export declare type PackFn = (event: eventWithTime) => string;
|
||||
export declare type UnpackFn = (raw: string) => eventWithTime;
|
||||
export declare type eventWithTimeAndPacker = eventWithTime & {
|
||||
v: string;
|
||||
};
|
||||
export declare const MARK = "v1";
|
||||
2
packages/rrweb/typings/packer/index.d.ts
vendored
2
packages/rrweb/typings/packer/index.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
export { pack } from './pack';
|
||||
export { unpack } from './unpack';
|
||||
2
packages/rrweb/typings/packer/pack.d.ts
vendored
2
packages/rrweb/typings/packer/pack.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
import { PackFn } from './base';
|
||||
export declare const pack: PackFn;
|
||||
2
packages/rrweb/typings/packer/unpack.d.ts
vendored
2
packages/rrweb/typings/packer/unpack.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
import { UnpackFn } from './base';
|
||||
export declare const unpack: UnpackFn;
|
||||
@@ -1,37 +0,0 @@
|
||||
export declare class StackFrame {
|
||||
private fileName;
|
||||
private functionName;
|
||||
private lineNumber?;
|
||||
private columnNumber?;
|
||||
constructor(obj: {
|
||||
fileName?: string;
|
||||
functionName?: string;
|
||||
lineNumber?: number;
|
||||
columnNumber?: number;
|
||||
});
|
||||
toString(): string;
|
||||
}
|
||||
export declare const ErrorStackParser: {
|
||||
parse: (error: Error) => StackFrame[];
|
||||
extractLocation: (urlLike: string) => (string | undefined)[];
|
||||
parseV8OrIE: (error: {
|
||||
stack: string;
|
||||
}) => StackFrame[];
|
||||
parseFFOrSafari: (error: {
|
||||
stack: string;
|
||||
}) => StackFrame[];
|
||||
parseOpera: (e: {
|
||||
stacktrace?: string;
|
||||
message: string;
|
||||
stack?: string;
|
||||
}) => StackFrame[];
|
||||
parseOpera9: (e: {
|
||||
message: string;
|
||||
}) => StackFrame[];
|
||||
parseOpera10: (e: {
|
||||
stacktrace: string;
|
||||
}) => StackFrame[];
|
||||
parseOpera11: (error: {
|
||||
stack: string;
|
||||
}) => StackFrame[];
|
||||
};
|
||||
@@ -1,42 +0,0 @@
|
||||
import type { RecordPlugin } from '../../../types';
|
||||
export declare type StringifyOptions = {
|
||||
stringLengthLimit?: number;
|
||||
numOfKeysLimit: number;
|
||||
depthOfLimit: number;
|
||||
};
|
||||
declare type LogRecordOptions = {
|
||||
level?: LogLevel[];
|
||||
lengthThreshold?: number;
|
||||
stringifyOptions?: StringifyOptions;
|
||||
logger?: Logger | 'console';
|
||||
};
|
||||
export declare type LogData = {
|
||||
level: LogLevel;
|
||||
trace: string[];
|
||||
payload: string[];
|
||||
};
|
||||
export declare type Logger = {
|
||||
assert?: typeof console.assert;
|
||||
clear?: typeof console.clear;
|
||||
count?: typeof console.count;
|
||||
countReset?: typeof console.countReset;
|
||||
debug?: typeof console.debug;
|
||||
dir?: typeof console.dir;
|
||||
dirxml?: typeof console.dirxml;
|
||||
error?: typeof console.error;
|
||||
group?: typeof console.group;
|
||||
groupCollapsed?: typeof console.groupCollapsed;
|
||||
groupEnd?: () => void;
|
||||
info?: typeof console.info;
|
||||
log?: typeof console.log;
|
||||
table?: typeof console.table;
|
||||
time?: typeof console.time;
|
||||
timeEnd?: typeof console.timeEnd;
|
||||
timeLog?: typeof console.timeLog;
|
||||
trace?: typeof console.trace;
|
||||
warn?: typeof console.warn;
|
||||
};
|
||||
export declare type LogLevel = keyof Logger;
|
||||
export declare const PLUGIN_NAME = "rrweb/console@1";
|
||||
export declare const getRecordConsolePlugin: (options?: LogRecordOptions) => RecordPlugin;
|
||||
export {};
|
||||
@@ -1,2 +0,0 @@
|
||||
import type { StringifyOptions } from './index';
|
||||
export declare function stringify(obj: unknown, stringifyOptions?: StringifyOptions): string;
|
||||
@@ -1,9 +0,0 @@
|
||||
import { LogLevel, LogData } from '../record';
|
||||
import { ReplayPlugin } from '../../../types';
|
||||
declare type ReplayLogger = Partial<Record<LogLevel, (data: LogData) => void>>;
|
||||
declare type LogReplayConfig = {
|
||||
level?: LogLevel[];
|
||||
replayLogger?: ReplayLogger;
|
||||
};
|
||||
export declare const getReplayConsolePlugin: (options?: LogReplayConfig) => ReplayPlugin;
|
||||
export {};
|
||||
@@ -1,6 +0,0 @@
|
||||
import type { RecordPlugin } from '../../../types';
|
||||
export declare type SequentialIdOptions = {
|
||||
key: string;
|
||||
};
|
||||
export declare const PLUGIN_NAME = "rrweb/sequential-id@1";
|
||||
export declare const getRecordSequentialIdPlugin: (options?: Partial<SequentialIdOptions>) => RecordPlugin;
|
||||
@@ -1,7 +0,0 @@
|
||||
import type { SequentialIdOptions } from '../record';
|
||||
import type { ReplayPlugin } from '../../../types';
|
||||
declare type Options = SequentialIdOptions & {
|
||||
warnOnMissingId: boolean;
|
||||
};
|
||||
export declare const getReplaySequentialIdPlugin: (options?: Partial<Options>) => ReplayPlugin;
|
||||
export {};
|
||||
@@ -1,13 +0,0 @@
|
||||
import type { Mirror, serializedNodeWithId } from 'rrweb-snapshot';
|
||||
import type { mutationCallBack } from '../types';
|
||||
export declare class IframeManager {
|
||||
private iframes;
|
||||
private mutationCb;
|
||||
private loadListener?;
|
||||
constructor(options: {
|
||||
mutationCb: mutationCallBack;
|
||||
});
|
||||
addIframe(iframeEl: HTMLIFrameElement): void;
|
||||
addLoadListener(cb: (iframeEl: HTMLIFrameElement) => unknown): void;
|
||||
attachIframe(iframeEl: HTMLIFrameElement, childSn: serializedNodeWithId, mirror: Mirror): void;
|
||||
}
|
||||
9
packages/rrweb/typings/record/index.d.ts
vendored
9
packages/rrweb/typings/record/index.d.ts
vendored
@@ -1,9 +0,0 @@
|
||||
import { eventWithTime, recordOptions, listenerHandler } from '../types';
|
||||
declare function record<T = eventWithTime>(options?: recordOptions<T>): listenerHandler | undefined;
|
||||
declare namespace record {
|
||||
var addCustomEvent: <T>(tag: string, payload: T) => void;
|
||||
var freezePage: () => void;
|
||||
var takeFullSnapshot: (isCheckout?: boolean | undefined) => void;
|
||||
var mirror: import("rrweb-snapshot").Mirror;
|
||||
}
|
||||
export default record;
|
||||
42
packages/rrweb/typings/record/mutation.d.ts
vendored
42
packages/rrweb/typings/record/mutation.d.ts
vendored
@@ -1,42 +0,0 @@
|
||||
import type { mutationRecord, MutationBufferParam } from '../types';
|
||||
export default class MutationBuffer {
|
||||
private frozen;
|
||||
private locked;
|
||||
private texts;
|
||||
private attributes;
|
||||
private removes;
|
||||
private mapRemoves;
|
||||
private movedMap;
|
||||
private addedSet;
|
||||
private movedSet;
|
||||
private droppedSet;
|
||||
private mutationCb;
|
||||
private blockClass;
|
||||
private blockSelector;
|
||||
private maskTextClass;
|
||||
private maskTextSelector;
|
||||
private inlineStylesheet;
|
||||
private maskInputOptions;
|
||||
private maskTextFn;
|
||||
private maskInputFn;
|
||||
private recordCanvas;
|
||||
private inlineImages;
|
||||
private slimDOMOptions;
|
||||
private doc;
|
||||
private mirror;
|
||||
private iframeManager;
|
||||
private stylesheetManager;
|
||||
private shadowDomManager;
|
||||
private canvasManager;
|
||||
init(options: MutationBufferParam): void;
|
||||
freeze(): void;
|
||||
unfreeze(): void;
|
||||
isFrozen(): boolean;
|
||||
lock(): void;
|
||||
unlock(): void;
|
||||
reset(): void;
|
||||
processMutations: (mutations: mutationRecord[]) => void;
|
||||
emit: () => void;
|
||||
private processMutation;
|
||||
private genAdds;
|
||||
}
|
||||
7
packages/rrweb/typings/record/observer.d.ts
vendored
7
packages/rrweb/typings/record/observer.d.ts
vendored
@@ -1,7 +0,0 @@
|
||||
import { observerParam, listenerHandler, hooksParam, MutationBufferParam } from '../types';
|
||||
import MutationBuffer from './mutation';
|
||||
export declare const mutationBuffers: MutationBuffer[];
|
||||
export declare function initMutationObserver(options: MutationBufferParam, rootEl: Node): MutationObserver;
|
||||
export declare function initScrollObserver({ scrollCb, doc, mirror, blockClass, sampling, }: Pick<observerParam, 'scrollCb' | 'doc' | 'mirror' | 'blockClass' | 'sampling'>): listenerHandler;
|
||||
export declare const INPUT_TAGS: string[];
|
||||
export declare function initObservers(o: observerParam, hooks?: hooksParam): listenerHandler;
|
||||
@@ -1,3 +0,0 @@
|
||||
import type { Mirror } from 'rrweb-snapshot';
|
||||
import { blockClass, canvasManagerMutationCallback, IWindow, listenerHandler } from '../../../types';
|
||||
export default function initCanvas2DMutationObserver(cb: canvasManagerMutationCallback, win: IWindow, blockClass: blockClass, mirror: Mirror): listenerHandler;
|
||||
@@ -1,35 +0,0 @@
|
||||
import type { Mirror } from 'rrweb-snapshot';
|
||||
import type { blockClass, canvasMutationCallback, IWindow } from '../../../types';
|
||||
export declare type RafStamps = {
|
||||
latestId: number;
|
||||
invokeId: number | null;
|
||||
};
|
||||
export declare class CanvasManager {
|
||||
private pendingCanvasMutations;
|
||||
private rafStamps;
|
||||
private mirror;
|
||||
private mutationCb;
|
||||
private resetObservers?;
|
||||
private frozen;
|
||||
private locked;
|
||||
reset(): void;
|
||||
freeze(): void;
|
||||
unfreeze(): void;
|
||||
lock(): void;
|
||||
unlock(): void;
|
||||
constructor(options: {
|
||||
recordCanvas: boolean;
|
||||
mutationCb: canvasMutationCallback;
|
||||
win: IWindow;
|
||||
blockClass: blockClass;
|
||||
mirror: Mirror;
|
||||
sampling?: 'all' | number;
|
||||
});
|
||||
private processMutation;
|
||||
private initCanvasFPSObserver;
|
||||
private initCanvasMutationObserver;
|
||||
private startPendingCanvasMutationFlusher;
|
||||
private startRAFTimestamping;
|
||||
flushPendingCanvasMutations(): void;
|
||||
flushPendingCanvasMutationFor(canvas: HTMLCanvasElement, id: number): void;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
import type { blockClass, IWindow, listenerHandler } from '../../../types';
|
||||
export default function initCanvasContextObserver(win: IWindow, blockClass: blockClass): listenerHandler;
|
||||
@@ -1,6 +0,0 @@
|
||||
import type { IWindow, CanvasArg } from '../../../types';
|
||||
export declare function variableListFor(ctx: RenderingContext, ctor: string): unknown[];
|
||||
export declare const saveWebGLVar: (value: unknown, win: IWindow, ctx: RenderingContext) => number | void;
|
||||
export declare function serializeArg(value: unknown, win: IWindow, ctx: RenderingContext): CanvasArg;
|
||||
export declare const serializeArgs: (args: Array<unknown>, win: IWindow, ctx: RenderingContext) => CanvasArg[];
|
||||
export declare const isInstanceOfWebGLObject: (value: unknown, win: IWindow) => value is WebGLTexture | WebGLShader | WebGLBuffer | WebGLVertexArrayObject | WebGLProgram | WebGLActiveInfo | WebGLUniformLocation | WebGLFramebuffer | WebGLRenderbuffer | WebGLShaderPrecisionFormat;
|
||||
@@ -1,3 +0,0 @@
|
||||
import type { Mirror } from 'rrweb-snapshot';
|
||||
import { blockClass, canvasManagerMutationCallback, IWindow, listenerHandler } from '../../../types';
|
||||
export default function initCanvasWebGLMutationObserver(cb: canvasManagerMutationCallback, win: IWindow, blockClass: blockClass, mirror: Mirror): listenerHandler;
|
||||
@@ -1,2 +0,0 @@
|
||||
import { blockClass, canvasMutationCallback, IWindow, listenerHandler, Mirror } from '../../../types';
|
||||
export default function initCanvasWebGLMutationObserver(cb: canvasMutationCallback, win: IWindow, blockClass: blockClass, mirror: Mirror): listenerHandler;
|
||||
@@ -1,22 +0,0 @@
|
||||
import type { mutationCallBack, scrollCallback, MutationBufferParam, SamplingStrategy } from '../types';
|
||||
import type { Mirror } from 'rrweb-snapshot';
|
||||
declare type BypassOptions = Omit<MutationBufferParam, 'doc' | 'mutationCb' | 'mirror' | 'shadowDomManager'> & {
|
||||
sampling: SamplingStrategy;
|
||||
};
|
||||
export declare class ShadowDomManager {
|
||||
private mutationCb;
|
||||
private scrollCb;
|
||||
private bypassOptions;
|
||||
private mirror;
|
||||
private restorePatches;
|
||||
constructor(options: {
|
||||
mutationCb: mutationCallBack;
|
||||
scrollCb: scrollCallback;
|
||||
bypassOptions: BypassOptions;
|
||||
mirror: Mirror;
|
||||
});
|
||||
addShadowRoot(shadowRoot: ShadowRoot, doc: Document): void;
|
||||
observeAttachShadow(iframeElement: HTMLIFrameElement): void;
|
||||
reset(): void;
|
||||
}
|
||||
export {};
|
||||
@@ -1,12 +0,0 @@
|
||||
import type { Mirror, serializedNodeWithId } from 'rrweb-snapshot';
|
||||
import type { mutationCallBack } from '../types';
|
||||
export declare class StylesheetManager {
|
||||
private trackedStylesheets;
|
||||
private mutationCb;
|
||||
constructor(options: {
|
||||
mutationCb: mutationCallBack;
|
||||
});
|
||||
addStylesheet(linkEl: HTMLLinkElement): void;
|
||||
private trackStylesheet;
|
||||
attachStylesheet(linkEl: HTMLLinkElement, childSn: serializedNodeWithId, mirror: Mirror): void;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import type { ImageBitmapDataURLWorkerParams, ImageBitmapDataURLWorkerResponse } from '../../types';
|
||||
export interface ImageBitmapDataURLRequestWorker {
|
||||
postMessage: (message: ImageBitmapDataURLWorkerParams, transfer?: [ImageBitmap]) => void;
|
||||
onmessage: (message: MessageEvent<ImageBitmapDataURLWorkerResponse>) => void;
|
||||
}
|
||||
9
packages/rrweb/typings/replay/canvas/2d.d.ts
vendored
9
packages/rrweb/typings/replay/canvas/2d.d.ts
vendored
@@ -1,9 +0,0 @@
|
||||
import type { Replayer } from '../';
|
||||
import type { canvasMutationCommand } from '../../types';
|
||||
export default function canvasMutation({ event, mutation, target, imageMap, errorHandler, }: {
|
||||
event: Parameters<Replayer['applyIncremental']>[0];
|
||||
mutation: canvasMutationCommand;
|
||||
target: HTMLCanvasElement;
|
||||
imageMap: Replayer['imageMap'];
|
||||
errorHandler: Replayer['warnCanvasMutationFailed'];
|
||||
}): Promise<void>;
|
||||
@@ -1,7 +0,0 @@
|
||||
import type { Replayer } from '../';
|
||||
import type { CanvasArg, SerializedCanvasArg } from '../../types';
|
||||
export declare function variableListFor(ctx: CanvasRenderingContext2D | WebGLRenderingContext | WebGL2RenderingContext, ctor: string): any[];
|
||||
export declare function isSerializedArg(arg: unknown): arg is SerializedCanvasArg;
|
||||
export declare function deserializeArg(imageMap: Replayer['imageMap'], ctx: CanvasRenderingContext2D | WebGLRenderingContext | WebGL2RenderingContext | null, preload?: {
|
||||
isUnchanged: boolean;
|
||||
}): (arg: CanvasArg) => Promise<any>;
|
||||
10
packages/rrweb/typings/replay/canvas/index.d.ts
vendored
10
packages/rrweb/typings/replay/canvas/index.d.ts
vendored
@@ -1,10 +0,0 @@
|
||||
import type { Replayer } from '..';
|
||||
import { canvasMutationData } from '../../types';
|
||||
export default function canvasMutation({ event, mutation, target, imageMap, canvasEventMap, errorHandler, }: {
|
||||
event: Parameters<Replayer['applyIncremental']>[0];
|
||||
mutation: canvasMutationData;
|
||||
target: HTMLCanvasElement;
|
||||
imageMap: Replayer['imageMap'];
|
||||
canvasEventMap: Replayer['canvasEventMap'];
|
||||
errorHandler: Replayer['warnCanvasMutationFailed'];
|
||||
}): Promise<void>;
|
||||
@@ -1,9 +0,0 @@
|
||||
import type { Replayer } from '../';
|
||||
import { CanvasContext, canvasMutationCommand } from '../../types';
|
||||
export default function webglMutation({ mutation, target, type, imageMap, errorHandler, }: {
|
||||
mutation: canvasMutationCommand;
|
||||
target: HTMLCanvasElement;
|
||||
type: CanvasContext;
|
||||
imageMap: Replayer['imageMap'];
|
||||
errorHandler: Replayer['warnCanvasMutationFailed'];
|
||||
}): Promise<void>;
|
||||
73
packages/rrweb/typings/replay/index.d.ts
vendored
73
packages/rrweb/typings/replay/index.d.ts
vendored
@@ -1,73 +0,0 @@
|
||||
import { Mirror } from 'rrweb-snapshot';
|
||||
import { RRDocument } from 'rrdom';
|
||||
import { Timer } from './timer';
|
||||
import { createPlayerService, createSpeedService } from './machine';
|
||||
import { eventWithTime, playerConfig, playerMetaData, Handler } 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;
|
||||
usingVirtualDom: boolean;
|
||||
virtualDom: RRDocument;
|
||||
private mouse;
|
||||
private mouseTail;
|
||||
private tailPositions;
|
||||
private emitter;
|
||||
private nextUserInteractionEvent;
|
||||
private legacy_missingNodeRetryMap;
|
||||
private cache;
|
||||
private imageMap;
|
||||
private canvasEventMap;
|
||||
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;
|
||||
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;
|
||||
resetCache(): void;
|
||||
private setupDom;
|
||||
private handleResize;
|
||||
private applyEventsSynchronously;
|
||||
private getCastFn;
|
||||
private rebuildFullSnapshot;
|
||||
private insertStyleRules;
|
||||
private attachDocumentToIframe;
|
||||
private collectIframeAndAttachDocument;
|
||||
private waitForStylesheetLoad;
|
||||
private preloadAllImages;
|
||||
private preloadImages;
|
||||
private deserializeAndPreloadCanvasEvents;
|
||||
private applyIncremental;
|
||||
private applyMutation;
|
||||
private applyScroll;
|
||||
private applyInput;
|
||||
private legacy_resolveMissingNode;
|
||||
private moveAndHover;
|
||||
private drawMouseTail;
|
||||
private hoverElements;
|
||||
private isUserInteraction;
|
||||
private backToNormal;
|
||||
private warnNodeNotFound;
|
||||
private warnCanvasMutationFailed;
|
||||
private debugNodeNotFound;
|
||||
private warn;
|
||||
private debug;
|
||||
}
|
||||
80
packages/rrweb/typings/replay/machine.d.ts
vendored
80
packages/rrweb/typings/replay/machine.d.ts
vendored
@@ -1,80 +0,0 @@
|
||||
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;
|
||||
applyEventsSynchronously(events: Array<eventWithTime>): void;
|
||||
getCastFn(event: eventWithTime, isSync: boolean): () => void;
|
||||
};
|
||||
export declare function createPlayerService(context: PlayerContext, { getCastFn, applyEventsSynchronously, 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 +0,0 @@
|
||||
export declare function polyfill(w?: Window, d?: Document): void;
|
||||
@@ -1,2 +0,0 @@
|
||||
declare const rules: (blockClass: string) => string[];
|
||||
export default rules;
|
||||
18
packages/rrweb/typings/replay/timer.d.ts
vendored
18
packages/rrweb/typings/replay/timer.d.ts
vendored
@@ -1,18 +0,0 @@
|
||||
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;
|
||||
1
packages/rrweb/typings/rrdom/index.d.ts
vendored
1
packages/rrweb/typings/rrdom/index.d.ts
vendored
@@ -1 +0,0 @@
|
||||
export {};
|
||||
20
packages/rrweb/typings/rrdom/tree-node.d.ts
vendored
20
packages/rrweb/typings/rrdom/tree-node.d.ts
vendored
@@ -1,20 +0,0 @@
|
||||
export declare type AnyObject = {
|
||||
[key: string]: any;
|
||||
__rrdom__?: RRdomTreeNode;
|
||||
};
|
||||
export declare class RRdomTreeNode implements AnyObject {
|
||||
parent: AnyObject | null;
|
||||
previousSibling: AnyObject | null;
|
||||
nextSibling: AnyObject | null;
|
||||
firstChild: AnyObject | null;
|
||||
lastChild: AnyObject | null;
|
||||
childrenVersion: number;
|
||||
childIndexCachedUpTo: AnyObject | null;
|
||||
cachedIndex: number;
|
||||
cachedIndexVersion: number;
|
||||
get isAttached(): boolean;
|
||||
get hasChildren(): boolean;
|
||||
childrenChanged(): void;
|
||||
getCachedIndex(parentNode: AnyObject): number;
|
||||
setCachedIndex(parentNode: AnyObject, index: number): void;
|
||||
}
|
||||
42
packages/rrweb/typings/utils.d.ts
vendored
42
packages/rrweb/typings/utils.d.ts
vendored
@@ -1,42 +0,0 @@
|
||||
import type { throttleOptions, listenerHandler, hookResetter, blockClass, addedNodeMutation, DocumentDimension, IWindow, DeprecatedMirror, textMutation } from './types';
|
||||
import type { IMirror, Mirror } from 'rrweb-snapshot';
|
||||
import type { RRNode, RRIFrameElement } from 'rrdom';
|
||||
export declare function on(type: string, fn: EventListenerOrEventListenerObject, target?: Document | IWindow): listenerHandler;
|
||||
export declare let _mirror: DeprecatedMirror;
|
||||
export declare function throttle<T>(func: (arg: T) => void, wait: number, options?: throttleOptions): (...args: T[]) => void;
|
||||
export declare function hookSetter<T>(target: T, key: string | number | symbol, d: PropertyDescriptor, isRevoked?: boolean, win?: Window & typeof globalThis): hookResetter;
|
||||
export declare function patch(source: {
|
||||
[key: string]: any;
|
||||
}, name: string, replacement: (...args: unknown[]) => unknown): () => void;
|
||||
export declare function getWindowHeight(): number;
|
||||
export declare function getWindowWidth(): number;
|
||||
export declare function isBlocked(node: Node | null, blockClass: blockClass, checkAncestors: boolean): boolean;
|
||||
export declare function isSerialized(n: Node, mirror: Mirror): boolean;
|
||||
export declare function isIgnored(n: Node, mirror: Mirror): boolean;
|
||||
export declare function isAncestorRemoved(target: Node, mirror: Mirror): boolean;
|
||||
export declare function isTouchEvent(event: MouseEvent | TouchEvent): event is TouchEvent;
|
||||
export declare function polyfill(win?: Window & typeof globalThis): void;
|
||||
declare type ResolveTree = {
|
||||
value: addedNodeMutation;
|
||||
children: ResolveTree[];
|
||||
parent: ResolveTree | null;
|
||||
};
|
||||
export declare function queueToResolveTrees(queue: addedNodeMutation[]): ResolveTree[];
|
||||
export declare function iterateResolveTree(tree: ResolveTree, cb: (mutation: addedNodeMutation) => unknown): void;
|
||||
export declare type AppendedIframe = {
|
||||
mutationInQueue: addedNodeMutation;
|
||||
builtNode: HTMLIFrameElement | RRIFrameElement;
|
||||
};
|
||||
export declare function isSerializedIframe<TNode extends Node | RRNode>(n: TNode, mirror: IMirror<TNode>): boolean;
|
||||
export declare function isSerializedStylesheet<TNode extends Node | RRNode>(n: TNode, mirror: IMirror<TNode>): boolean;
|
||||
export declare function getBaseDimension(node: Node, rootIframe: Node): DocumentDimension;
|
||||
export declare function hasShadowRoot<T extends Node | RRNode>(n: T): n is T & {
|
||||
shadowRoot: ShadowRoot;
|
||||
};
|
||||
export declare function getNestedRule(rules: CSSRuleList, position: number[]): CSSGroupingRule;
|
||||
export declare function getPositionsAndIndex(nestedIndex: number[]): {
|
||||
positions: number[];
|
||||
index: number | undefined;
|
||||
};
|
||||
export declare function uniqueTextMutations(mutations: textMutation[]): textMutation[];
|
||||
export {};
|
||||
@@ -4,7 +4,7 @@
|
||||
"pipeline": {
|
||||
"prepublish": {
|
||||
"dependsOn": ["^prepublish"],
|
||||
"outputs": ["lib/**", "es/**", "dist/**"]
|
||||
"outputs": ["lib/**", "es/**", "dist/**", "typings/**"]
|
||||
},
|
||||
"test": {},
|
||||
"test:watch": {},
|
||||
|
||||
Reference in New Issue
Block a user