Skip to content

Commit 57a124f

Browse files
committed
update typings
1 parent 8b0bc7c commit 57a124f

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

typings/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import snapshot, { serializeNodeWithId, transformAttribute, visitSnapshot } from './snapshot';
1+
import snapshot, { serializeNodeWithId, transformAttribute, visitSnapshot, IGNORED_NODE } from './snapshot';
22
import rebuild, { buildNodeWithSN, addHoverClass } from './rebuild';
33
export * from './types';
4-
export { snapshot, serializeNodeWithId, rebuild, buildNodeWithSN, addHoverClass, transformAttribute, visitSnapshot, };
4+
export { snapshot, serializeNodeWithId, rebuild, buildNodeWithSN, addHoverClass, transformAttribute, visitSnapshot, IGNORED_NODE, };

typings/snapshot.d.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { serializedNodeWithId, INode, idNodeMap, MaskInputOptions } from './types';
1+
import { serializedNodeWithId, INode, idNodeMap, MaskInputOptions, SlimDOMOptions } from './types';
2+
export declare const IGNORED_NODE = -2;
23
export declare function absoluteToStylesheet(cssText: string | null, href: string): string;
34
export declare function absoluteToDoc(doc: Document, attributeValue: string): string;
45
export declare function transformAttribute(doc: Document, name: string, value: string): string;
5-
export declare function serializeNodeWithId(n: Node | INode, doc: Document, map: idNodeMap, blockClass: string | RegExp, skipChild?: boolean, inlineStylesheet?: boolean, maskInputOptions?: MaskInputOptions, recordCanvas?: boolean): serializedNodeWithId | null;
6-
declare function snapshot(n: Document, blockClass: string | RegExp | undefined, inlineStylesheet: boolean | undefined, maskAllInputsOrOptions: boolean | MaskInputOptions, recordCanvas?: boolean): [serializedNodeWithId | null, idNodeMap];
6+
export declare function serializeNodeWithId(n: Node | INode, doc: Document, map: idNodeMap, blockClass: string | RegExp, skipChild?: boolean, inlineStylesheet?: boolean, maskInputOptions?: MaskInputOptions, slimDOMOptions?: SlimDOMOptions, recordCanvas?: boolean, preserveWhiteSpace?: boolean): serializedNodeWithId | null;
7+
declare function snapshot(n: Document, blockClass: string | RegExp | undefined, inlineStylesheet: boolean | undefined, maskAllInputsOrOptions: boolean | MaskInputOptions, slimDOMSensibleOrOptions: boolean | SlimDOMOptions, recordCanvas?: boolean): [serializedNodeWithId | null, idNodeMap];
78
export declare function visitSnapshot(node: serializedNodeWithId, onVisit: (node: serializedNodeWithId) => unknown): void;
89
export default snapshot;

typings/types.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,15 @@ export declare type MaskInputOptions = Partial<{
7070
textarea: boolean;
7171
select: boolean;
7272
}>;
73+
export declare type SlimDOMOptions = Partial<{
74+
script: boolean;
75+
comment: boolean;
76+
headFavicon: boolean;
77+
headWhitespace: boolean;
78+
headMetaDescKeywords: boolean;
79+
headMetaSocial: boolean;
80+
headMetaRobots: boolean;
81+
headMetaHttpEquiv: boolean;
82+
headMetaAuthorship: boolean;
83+
headMetaVerification: boolean;
84+
}>;

0 commit comments

Comments
 (0)