UNPKG

799 BTypeScriptView Raw
1export type Scrubber = (key: string, value: unknown) => unknown;
2export interface ScrubberInterface {
3 setScrubber(scrubber: Scrubber | undefined): void;
4 stringify(value: any): string;
5}
6/**
7 * This interface implements a stringify() function, which is used by Slate
8 * internally when generating exceptions containing end user data. Developers
9 * using Slate may call Scrubber.setScrubber() to alter the behavior of this
10 * stringify() function.
11 *
12 * For example, to prevent the cleartext logging of 'text' fields within Nodes:
13 *
14 * import { Scrubber } from 'slate';
15 * Scrubber.setScrubber((key, val) => {
16 * if (key === 'text') return '...scrubbed...'
17 * return val
18 * });
19 *
20 */
21export declare const Scrubber: ScrubberInterface;
22//# sourceMappingURL=scrubber.d.ts.map
\No newline at end of file