From 599e07d9a399f1ae34333d5f0d8123225b5badab Mon Sep 17 00:00:00 2001 From: Justin Halsall Date: Wed, 1 Apr 2026 12:00:00 +0800 Subject: [PATCH] yarn typings (#635) --- typings/replay/index.d.ts | 2 ++ typings/replay/virtual-styles.d.ts | 24 ++++++++++++++++++++++++ typings/types.d.ts | 3 +++ 3 files changed, 29 insertions(+) create mode 100644 typings/replay/virtual-styles.d.ts diff --git a/typings/replay/index.d.ts b/typings/replay/index.d.ts index 0f021d32..5fd7ad47 100644 --- a/typings/replay/index.d.ts +++ b/typings/replay/index.d.ts @@ -18,6 +18,7 @@ export declare class Replayer { private treeIndex; private fragmentParentMap; private elementStateMap; + private virtualStyleRulesMap; private imageMap; private mirror; private firstFullSnapshot; @@ -59,6 +60,7 @@ export declare class Replayer { private restoreRealParent; private storeState; private restoreState; + private restoreNodeSheet; private warnNodeNotFound; private warnCanvasMutationFailed; private debugNodeNotFound; diff --git a/typings/replay/virtual-styles.d.ts b/typings/replay/virtual-styles.d.ts new file mode 100644 index 00000000..107e0785 --- /dev/null +++ b/typings/replay/virtual-styles.d.ts @@ -0,0 +1,24 @@ +import { INode } from 'rrweb-snapshot'; +export declare enum StyleRuleType { + Insert = 0, + Remove = 1, + Snapshot = 2 +} +declare type InsertRule = { + cssText: string; + type: StyleRuleType.Insert; + index?: number; +}; +declare type RemoveRule = { + type: StyleRuleType.Remove; + index: number; +}; +declare type SnapshotRule = { + type: StyleRuleType.Snapshot; + cssTexts: string[]; +}; +export declare type VirtualStyleRules = Array; +export declare type VirtualStyleRulesMap = Map; +export declare function applyVirtualStyleRulesToNode(storedRules: VirtualStyleRules, styleNode: HTMLStyleElement): void; +export declare function storeCSSRules(parentElement: HTMLStyleElement, virtualStyleRulesMap: VirtualStyleRulesMap): void; +export {}; diff --git a/typings/types.d.ts b/typings/types.d.ts index 1bec3d70..73654ec5 100644 --- a/typings/types.d.ts +++ b/typings/types.d.ts @@ -144,6 +144,7 @@ export declare type recordOptions = { packFn?: PackFn; sampling?: SamplingStrategy; recordCanvas?: boolean; + userTriggeredOnInput?: boolean; collectFonts?: boolean; plugins?: RecordPlugin[]; mousemoveWait?: number; @@ -171,6 +172,7 @@ export declare type observerParam = { fontCb: fontCallback; sampling: SamplingStrategy; recordCanvas: boolean; + userTriggeredOnInput: boolean; collectFonts: boolean; slimDOMOptions: SlimDOMOptions; doc: Document; @@ -313,6 +315,7 @@ export declare type viewportResizeCallback = (d: viewportResizeDimension) => voi export declare type inputValue = { text: string; isChecked: boolean; + userTriggered?: boolean; }; export declare type inputCallback = (v: inputValue & { id: number;