From 017f30bce68c6a0249a61fbc378f767f4b37528f Mon Sep 17 00:00:00 2001 From: David Newell Date: Tue, 9 Apr 2024 10:23:49 +0100 Subject: [PATCH 1/2] fix: typing of maskTextFn --- src/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types.ts b/src/types.ts index 818501c9c..ebcd8c999 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,4 @@ -import type { MaskInputOptions, SlimDOMOptions } from 'rrweb-snapshot' +import type { MaskInputOptions, MaskTextFn, SlimDOMOptions } from 'rrweb-snapshot' import { PostHog } from './posthog-core' export type Property = any @@ -177,7 +177,7 @@ export interface SessionRecordingOptions { ignoreClass?: string maskTextClass?: string | RegExp maskTextSelector?: string | null - maskTextFn?: ((text: string) => string) | null + maskTextFn?: MaskTextFn maskAllInputs?: boolean maskInputOptions?: MaskInputOptions maskInputFn?: ((text: string, element?: HTMLElement) => string) | null From 0d3c0813d9fa39e92407094f09ff1c91907d7c14 Mon Sep 17 00:00:00 2001 From: David Newell Date: Tue, 9 Apr 2024 10:27:02 +0100 Subject: [PATCH 2/2] better typing --- src/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types.ts b/src/types.ts index ebcd8c999..34cd30966 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,4 @@ -import type { MaskInputOptions, MaskTextFn, SlimDOMOptions } from 'rrweb-snapshot' +import type { MaskInputOptions, SlimDOMOptions } from 'rrweb-snapshot' import { PostHog } from './posthog-core' export type Property = any @@ -177,7 +177,7 @@ export interface SessionRecordingOptions { ignoreClass?: string maskTextClass?: string | RegExp maskTextSelector?: string | null - maskTextFn?: MaskTextFn + maskTextFn?: ((text: string, element: HTMLElement | null) => string) | null maskAllInputs?: boolean maskInputOptions?: MaskInputOptions maskInputFn?: ((text: string, element?: HTMLElement) => string) | null