Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update types #13

Merged
merged 2 commits into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/rrweb-snapshot/typings/snapshot.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ export declare function absoluteToStylesheet(cssText: string | null, href: strin
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 needMaskingText(node: Node | null, maskTextClass: string | RegExp, maskTextSelector: string | null): boolean;
export declare function needMaskingText(node: Node | null, maskTextClass: string | RegExp, maskTextSelector: string | null, unmaskTextSelector: string | null): boolean;
export declare function serializeNodeWithId(n: Node | INode, options: {
doc: Document;
map: idNodeMap;
blockClass: string | RegExp;
blockSelector: string | null;
maskTextClass: string | RegExp;
maskTextSelector: string | null;
unmaskTextSelector: string | null;
skipChild: boolean;
inlineStylesheet: boolean;
maskInputSelector: string | null;
unmaskInputSelector: string | null;
maskInputOptions?: MaskInputOptions;
maskTextFn: MaskTextFn | undefined;
maskInputFn: MaskInputFn | undefined;
Expand All @@ -32,6 +35,9 @@ declare function snapshot(n: Document, options?: {
blockSelector?: string | null;
maskTextClass?: string | RegExp;
maskTextSelector?: string | null;
unmaskTextSelector?: string | null;
maskInputSelector?: string | null;
unmaskInputSelector?: string | null;
inlineStylesheet?: boolean;
maskAllInputs?: boolean | MaskInputOptions;
maskTextFn?: MaskTextFn;
Expand Down
5 changes: 4 additions & 1 deletion packages/rrweb-snapshot/typings/utils.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { INode, MaskInputFn, MaskInputOptions } from './types';
export declare function isElement(n: Node | INode): n is Element;
export declare function isShadowRoot(n: Node): n is ShadowRoot;
export declare function maskInputValue({ maskInputOptions, tagName, type, value, maskInputFn, }: {
export declare function maskInputValue({ input, maskInputSelector, unmaskInputSelector, maskInputOptions, tagName, type, value, maskInputFn, }: {
input: HTMLElement;
maskInputSelector: string | null;
unmaskInputSelector: string | null;
maskInputOptions: MaskInputOptions;
tagName: string;
type: string | number | boolean | null;
Expand Down
3 changes: 3 additions & 0 deletions packages/rrweb/typings/record/mutation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export default class MutationBuffer {
private blockSelector;
private maskTextClass;
private maskTextSelector;
private unmaskTextSelector;
private maskInputSelector;
private unmaskInputSelector;
private inlineStylesheet;
private maskInputOptions;
private maskTextFn;
Expand Down
8 changes: 7 additions & 1 deletion packages/rrweb/typings/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,12 @@ export declare type recordOptions<T> = {
maskTextClass?: maskTextClass;
maskTextSelector?: string;
maskAllInputs?: boolean;
maskInputSelector?: string;
maskInputOptions?: MaskInputOptions;
maskInputFn?: MaskInputFn;
maskTextFn?: MaskTextFn;
unmaskTextSelector?: string;
unmaskInputSelector?: string;
slimDOMOptions?: SlimDOMOptions | 'all' | true;
inlineStylesheet?: boolean;
hooks?: hooksParam;
Expand All @@ -170,6 +173,9 @@ export declare type observerParam = {
ignoreClass: string;
maskTextClass: maskTextClass;
maskTextSelector: string | null;
unmaskTextSelector: string | null;
maskInputSelector: string | null;
unmaskInputSelector: string | null;
maskInputOptions: MaskInputOptions;
maskInputFn?: MaskInputFn;
maskTextFn?: MaskTextFn;
Expand All @@ -195,7 +201,7 @@ export declare type observerParam = {
options: unknown;
}>;
};
export declare type MutationBufferParam = Pick<observerParam, 'mutationCb' | 'blockClass' | 'blockSelector' | 'maskTextClass' | 'maskTextSelector' | 'inlineStylesheet' | 'maskInputOptions' | 'maskTextFn' | 'maskInputFn' | 'recordCanvas' | 'inlineImages' | 'slimDOMOptions' | 'doc' | 'mirror' | 'iframeManager' | 'shadowDomManager' | 'canvasManager'>;
export declare type MutationBufferParam = Pick<observerParam, 'mutationCb' | 'blockClass' | 'blockSelector' | 'maskTextClass' | 'maskTextSelector' | 'unmaskTextSelector' | 'inlineStylesheet' | 'maskInputSelector' | 'unmaskInputSelector' | 'maskInputOptions' | 'maskTextFn' | 'maskInputFn' | 'recordCanvas' | 'inlineImages' | 'slimDOMOptions' | 'doc' | 'mirror' | 'iframeManager' | 'shadowDomManager' | 'canvasManager'>;
export declare type hooksParam = {
mutation?: mutationCallBack;
mousemove?: mousemoveCallBack;
Expand Down