isomorphic-dompurify
Version:
Makes it possible to use DOMPurify on server and client in the same way.
31 lines (28 loc) • 2.21 kB
TypeScript
import * as dompurify from 'dompurify';
import dompurify__default from 'dompurify';
export { default } from 'dompurify';
declare const sanitize: typeof dompurify__default.sanitize;
declare const isSupported: boolean;
declare const addHook: {
(entryPoint: "beforeSanitizeElements" | "afterSanitizeElements" | "uponSanitizeShadowNode", hookFunction: dompurify.NodeHook): void;
(entryPoint: "beforeSanitizeAttributes" | "afterSanitizeAttributes", hookFunction: dompurify.ElementHook): void;
(entryPoint: "beforeSanitizeShadowDOM" | "afterSanitizeShadowDOM", hookFunction: dompurify.DocumentFragmentHook): void;
(entryPoint: "uponSanitizeElement", hookFunction: dompurify.UponSanitizeElementHook): void;
(entryPoint: "uponSanitizeAttribute", hookFunction: dompurify.UponSanitizeAttributeHook): void;
};
declare const removeHook: {
(entryPoint: "beforeSanitizeElements" | "afterSanitizeElements" | "uponSanitizeShadowNode", hookFunction?: dompurify.NodeHook): dompurify.NodeHook | undefined;
(entryPoint: "beforeSanitizeAttributes" | "afterSanitizeAttributes", hookFunction?: dompurify.ElementHook): dompurify.ElementHook | undefined;
(entryPoint: "beforeSanitizeShadowDOM" | "afterSanitizeShadowDOM", hookFunction?: dompurify.DocumentFragmentHook): dompurify.DocumentFragmentHook | undefined;
(entryPoint: "uponSanitizeElement", hookFunction?: dompurify.UponSanitizeElementHook): dompurify.UponSanitizeElementHook | undefined;
(entryPoint: "uponSanitizeAttribute", hookFunction?: dompurify.UponSanitizeAttributeHook): dompurify.UponSanitizeAttributeHook | undefined;
};
declare const removeHooks: (entryPoint: dompurify.HookName) => void;
declare const removeAllHooks: () => void;
declare const setConfig: (cfg?: dompurify.Config) => void;
declare const clearConfig: () => void;
declare const isValidAttribute: (tag: string, attr: string, value: string) => boolean;
declare const version: string;
declare const removed: (dompurify.RemovedElement | dompurify.RemovedAttribute)[];
declare function clearWindow(): void;
export { addHook, clearConfig, clearWindow, isSupported, isValidAttribute, removeAllHooks, removeHook, removeHooks, removed, sanitize, setConfig, version };