diff --git a/types/sanitize-html/index.d.ts b/types/sanitize-html/index.d.ts index 383ab80d95..6880736833 100644 --- a/types/sanitize-html/index.d.ts +++ b/types/sanitize-html/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for sanitize-html 1.18.2 +// Type definitions for sanitize-html 1.20.1 // Project: https://github.com/punkave/sanitize-html // Definitions by: Rogier Schouten // Afshin Darian @@ -7,6 +7,7 @@ // Will Gibson // A penguin // Johan Davidsson +// Jianrong Yu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import {Options} from "htmlparser2"; @@ -47,11 +48,13 @@ declare namespace sanitize { allowedStyles?: { [index: string]: { [index: string]: RegExp[] } }; allowedClasses?: { [index: string]: string[] } | boolean; allowedIframeHostnames?: string[]; + allowIframeRelativeUrls?: boolean; allowedSchemes?: string[] | boolean; allowedSchemesByTag?: { [index: string]: string[] } | boolean; allowedSchemesAppliedToAttributes?: string[]; allowProtocolRelative?: boolean; allowedTags?: string[] | boolean; + textFilter?: (text: string) => string; exclusiveFilter?: (frame: IFrame) => boolean; nonTextTags?: string[]; selfClosing?: string[]; diff --git a/types/sanitize-html/sanitize-html-tests.ts b/types/sanitize-html/sanitize-html-tests.ts index 0fbce8ed44..83a0b076c5 100644 --- a/types/sanitize-html/sanitize-html-tests.ts +++ b/types/sanitize-html/sanitize-html-tests.ts @@ -23,6 +23,8 @@ let options: sanitize.IOptions = { return img; } }, + textFilter: text => text, + allowIframeRelativeUrls: false, exclusiveFilter: function(frame: sanitize.IFrame) { return frame.tag === 'a' && !frame.text.trim(); },