@types/dompurify
Advanced tools
Comparing version 0.0.29 to 0.0.30
@@ -6,30 +6,61 @@ // Type definitions for DOM Purify | ||
interface IDOMPurify { | ||
sanitize(s:string):string; | ||
sanitize(s:string, config:IDOMPurifyConfig):any; | ||
export = DOMPurify; | ||
export as namespace DOMPurify; | ||
addHook(hook:string, cb:(currentNode:Element, data:any, config:IDOMPurifyConfig) => Element):void; | ||
declare var DOMPurify: DOMPurify; | ||
interface DOMPurify { | ||
sanitize(source: string | Node): string; | ||
sanitize(source: string | Node, config: DOMPurifyConfig & { RETURN_DOM_FRAGMENT?: false; RETURN_DOM?: false; }): string; | ||
sanitize(source: string | Node, config: DOMPurifyConfig & { RETURN_DOM_FRAGMENT: true; }): DocumentFragment; | ||
sanitize(source: string | Node, config: DOMPurifyConfig & { RETURN_DOM: true; }): HTMLElement; | ||
sanitize(source: string | Node, config: DOMPurifyConfig): string | HTMLElement | DocumentFragment; | ||
addHook(hook: 'uponSanitizeElement', cb: (currentNode: Element, data: DOMPurifySanitizeElementHookEvent, config: DOMPurifyConfig) => void): void; | ||
addHook(hook: 'uponSanitizeAttribute', cb: (currentNode: Element, data: DOMPurifySanitizeAttributeHookEvent, config: DOMPurifyConfig) => void): void; | ||
addHook(hook: DOMPurifyHookName, cb: (currentNode: Element, data: DOMPurifyHookEvent, config: DOMPurifyConfig) => void): 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; | ||
interface DOMPurifyConfig { | ||
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; | ||
type DOMPurifyHookName | ||
= 'beforeSanitizeElements' | ||
| 'uponSanitizeElement' | ||
| 'afterSanitizeElements' | ||
| 'beforeSanitizeAttributes' | ||
| 'uponSanitizeAttribute' | ||
| 'afterSanitizeAttributes' | ||
| 'beforeSanitizeShadowDOM' | ||
| 'uponSanitizeShadowNode' | ||
| 'afterSanitizeShadowDOM'; | ||
declare module 'dompurify' { | ||
export = DOMPurify; | ||
type DOMPurifyHookEvent | ||
= DOMPurifySanitizeElementHookEvent | ||
| DOMPurifySanitizeAttributeHookEvent | ||
| null; | ||
interface DOMPurifySanitizeElementHookEvent { | ||
tagName: string; | ||
allowedTags: string[]; | ||
} | ||
interface DOMPurifySanitizeAttributeHookEvent { | ||
attrName: string; | ||
attrValue: string; | ||
keepAttr: boolean; | ||
allowedAttributes: string[]; | ||
} |
{ | ||
"name": "@types/dompurify", | ||
"version": "0.0.29", | ||
"version": "0.0.30", | ||
"description": "TypeScript definitions for DOM Purify", | ||
"license": "MIT", | ||
"author": "Dave Taylor <http://davetayls.me>, Samira Bazuzi <https://github.com/bazuzi>", | ||
"contributors": [ | ||
{ | ||
"name": "Dave Taylor", | ||
"url": "http://davetayls.me" | ||
}, | ||
{ | ||
"name": "Samira Bazuzi", | ||
"url": "https://github.com/bazuzi" | ||
} | ||
], | ||
"main": "", | ||
@@ -14,4 +23,4 @@ "repository": { | ||
"dependencies": {}, | ||
"typings": "index.d.ts", | ||
"typesPublisherContentHash": "b5ceb1ad995d8c333e3afc86360274ee86fb64bbb410de8b84aa59d9234adc0c" | ||
"typesPublisherContentHash": "1c87624d070b7cc2c187508a7a54a947b0d383116ddc60d106b1aae91c0332d2", | ||
"typeScriptVersion": "2.0" | ||
} |
@@ -8,9 +8,7 @@ # Installation | ||
# Details | ||
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/dompurify | ||
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/dompurify | ||
Additional Details | ||
* Last updated: Mon, 19 Sep 2016 17:28:58 GMT | ||
* File structure: Mixed | ||
* Library Dependencies: none | ||
* Module Dependencies: none | ||
* Last updated: Mon, 21 Aug 2017 21:49:18 GMT | ||
* Dependencies: none | ||
* Global values: DOMPurify | ||
@@ -17,0 +15,0 @@ |
4771
57
17