forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dompurify.d.ts
34 lines (29 loc) · 939 Bytes
/
dompurify.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Type definitions for DOM Purify
// Project: https://github.com/cure53/DOMPurify
// Definitions by: Dave Taylor <http://davetayls.me>, Samira Bazuzi <https://github.com/bazuzi>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface IDOMPurify {
sanitize(s:string):string;
sanitize(s:string, config:IDOMPurifyConfig):any;
addHook(hook:string, cb:(currentNode:Element, data:any, config:IDOMPurifyConfig) => Element):void;
}
interface IDOMPurifyConfig {
ADD_ATTR?:string[];
ADD_TAGS?:string[];
ALLOW_DATA_ATTR?:boolean;
ALLOWED_ATTR?:string[];
ALLOWED_TAGS?:string[];
FORBID_ATTR?:string[];
FORBID_TAGS?:string[];
KEEP_CONTENT?:boolean;
RETURN_DOM?:boolean;
RETURN_DOM_FRAGMENT?:boolean;
RETURN_DOM_IMPORT?:boolean;
SAFE_FOR_JQUERY?:boolean;
SANITIZE_DOM?:boolean;
WHOLE_DOCUMENT?:boolean;
}
declare var DOMPurify:IDOMPurify;
declare module 'dompurify' {
export = DOMPurify;
}