MCPcopy
hub / github.com/cure53/DOMPurify / DOMPurify

Interface DOMPurify

src/types.ts:7–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5import type { Config } from './config';
6
7export interface DOMPurify {
8 /**
9 * Creates a DOMPurify instance using the given window-like object. Defaults to `window`.
10 */
11 (root?: WindowLike): DOMPurify;
12
13 /**
14 * Version label, exposed for easier checks
15 * if DOMPurify is up to date or not
16 */
17 version: string;
18
19 /**
20 * Array of elements that DOMPurify removed during sanitation.
21 * Empty if nothing was removed.
22 */
23 removed: Array<RemovedElement | RemovedAttribute>;
24
25 /**
26 * Expose whether this browser supports running the full DOMPurify.
27 */
28 isSupported: boolean;
29
30 /**
31 * Set the configuration once.
32 *
33 * @param cfg configuration object
34 */
35 setConfig(cfg?: Config): void;
36
37 /**
38 * Removes the configuration.
39 */
40 clearConfig(): void;
41
42 /**
43 * Provides core sanitation functionality.
44 *
45 * @param dirty string or DOM node
46 * @param cfg object
47 * @returns Sanitized TrustedHTML.
48 */
49 sanitize(
50 dirty: string | Node,
51 cfg: Config & { RETURN_TRUSTED_TYPE: true }
52 ): TrustedHTML;
53
54 /**
55 * Provides core sanitation functionality.
56 *
57 * @param dirty DOM node
58 * @param cfg object
59 * @returns Sanitized DOM node.
60 */
61 sanitize(dirty: Node, cfg: Config & { IN_PLACE: true }): Node;
62
63 /**
64 * Provides core sanitation functionality.

Callers 1

test-suite.jsFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…