* introduce pako and add general packer interface

* add tests for packer

* use function API instead of class API for better tree shaking support

* refcatoring the rollup bundle config
This commit is contained in:
yz-yu
2026-04-01 12:00:00 +08:00
committed by GitHub
parent f1adef4693
commit dcad6ff922
23 changed files with 316 additions and 218 deletions

7
typings/types.d.ts vendored
View File

@@ -1,4 +1,5 @@
import { serializedNodeWithId, idNodeMap, INode } from 'rrweb-snapshot';
import { PackFn, UnpackFn } from './packer/base';
export declare enum EventType {
DomContentLoaded = 0,
Load = 1,
@@ -89,8 +90,8 @@ export declare type eventWithTime = event & {
delay?: number;
};
export declare type blockClass = string | RegExp;
export declare type recordOptions = {
emit?: (e: eventWithTime, isCheckout?: boolean) => void;
export declare type recordOptions<T> = {
emit?: (e: T, isCheckout?: boolean) => void;
checkoutEveryNth?: number;
checkoutEveryNms?: number;
blockClass?: blockClass;
@@ -99,6 +100,7 @@ export declare type recordOptions = {
inlineStylesheet?: boolean;
hooks?: hooksParam;
mousemoveWait?: number;
packFn?: PackFn;
};
export declare type observerParam = {
mutationCb: mutationCallBack;
@@ -252,6 +254,7 @@ export declare type playerConfig = {
liveMode: boolean;
insertStyleRules: string[];
triggerFocus: boolean;
unpackFn?: UnpackFn;
};
export declare type playerMetaData = {
totalTime: number;