add keepIframeSrcFn option (#81)

* add allowIframe option to snapshot

* rename allowIframe to keepIframeSrcFn
This commit is contained in:
bachmanity1
2021-06-29 19:07:47 +09:00
committed by GitHub
parent 2cf4ddd9e2
commit b1a8b6926a
5 changed files with 20 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
import { serializedNodeWithId, INode, idNodeMap, MaskInputOptions, SlimDOMOptions, MaskTextFn } from './types';
import { serializedNodeWithId, INode, idNodeMap, MaskInputOptions, SlimDOMOptions, MaskTextFn, KeepIframeSrcFn } from './types';
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;
@@ -17,6 +17,7 @@ export declare function serializeNodeWithId(n: Node | INode, options: {
maskInputOptions?: MaskInputOptions;
maskTextFn: MaskTextFn | undefined;
slimDOMOptions: SlimDOMOptions;
keepIframeSrcFn?: KeepIframeSrcFn;
recordCanvas?: boolean;
preserveWhiteSpace?: boolean;
onSerialize?: (n: INode) => unknown;
@@ -37,6 +38,7 @@ declare function snapshot(n: Document, options?: {
onSerialize?: (n: INode) => unknown;
onIframeLoad?: (iframeINode: INode, node: serializedNodeWithId) => unknown;
iframeLoadTimeout?: number;
keepIframeSrcFn?: KeepIframeSrcFn;
}): [serializedNodeWithId | null, idNodeMap];
export declare function visitSnapshot(node: serializedNodeWithId, onVisit: (node: serializedNodeWithId) => unknown): void;
export declare function cleanupSnapshot(): void;

1
typings/types.d.ts vendored
View File

@@ -88,3 +88,4 @@ export declare type SlimDOMOptions = Partial<{
headMetaVerification: boolean;
}>;
export declare type MaskTextFn = (text: string) => string;
export declare type KeepIframeSrcFn = (src: string) => boolean;