@types/sanitize-html
Advanced tools
Comparing version 2.9.0 to 2.9.1
@@ -22,73 +22,79 @@ // Type definitions for sanitize-html 2.9 | ||
declare namespace sanitize { | ||
interface Attributes { [attr: string]: string; } | ||
interface Attributes { | ||
[attr: string]: string; | ||
} | ||
interface Tag { tagName: string; attribs: Attributes; text?: string | undefined; } | ||
interface Tag { | ||
tagName: string; | ||
attribs: Attributes; | ||
text?: string | undefined; | ||
} | ||
type Transformer = (tagName: string, attribs: Attributes) => Tag; | ||
type Transformer = (tagName: string, attribs: Attributes) => Tag; | ||
type AllowedAttribute = string | { name: string; multiple?: boolean | undefined; values: string[] }; | ||
type AllowedAttribute = string | { name: string; multiple?: boolean | undefined; values: string[] }; | ||
type DisallowedTagsModes = 'discard' | 'escape' | 'recursiveEscape'; | ||
type DisallowedTagsModes = "discard" | "escape" | "recursiveEscape"; | ||
// tslint:disable-next-line:interface-name | ||
interface IDefaults { | ||
allowedAttributes: Record<string, AllowedAttribute[]>; | ||
allowedSchemes: string[]; | ||
allowedSchemesByTag: { [index: string]: string[] }; | ||
allowedSchemesAppliedToAttributes: string[]; | ||
allowedTags: string[]; | ||
allowProtocolRelative: boolean; | ||
disallowedTagsMode: DisallowedTagsModes; | ||
enforceHtmlBoundary: boolean; | ||
selfClosing: string[]; | ||
} | ||
// tslint:disable-next-line:interface-name | ||
interface IDefaults { | ||
allowedAttributes: Record<string, AllowedAttribute[]>; | ||
allowedSchemes: string[]; | ||
allowedSchemesByTag: { [index: string]: string[] }; | ||
allowedSchemesAppliedToAttributes: string[]; | ||
allowedTags: string[]; | ||
allowProtocolRelative: boolean; | ||
disallowedTagsMode: DisallowedTagsModes; | ||
enforceHtmlBoundary: boolean; | ||
selfClosing: string[]; | ||
} | ||
// tslint:disable-next-line:interface-name | ||
interface IFrame { | ||
tag: string; | ||
attribs: { [index: string]: string }; | ||
text: string; | ||
tagPosition: number; | ||
mediaChildren: string[]; | ||
} | ||
// tslint:disable-next-line:interface-name | ||
interface IFrame { | ||
tag: string; | ||
attribs: { [index: string]: string }; | ||
text: string; | ||
tagPosition: number; | ||
mediaChildren: string[]; | ||
} | ||
// tslint:disable-next-line:interface-name | ||
interface IOptions { | ||
allowedAttributes?: Record<string, AllowedAttribute[]> | false | undefined; | ||
allowedStyles?: { [index: string]: { [index: string]: RegExp[] } } | undefined; | ||
allowedClasses?: { [index: string]: boolean | Array<string | RegExp> } | undefined; | ||
allowedIframeDomains?: string[] | undefined; | ||
allowedIframeHostnames?: string[] | undefined; | ||
allowIframeRelativeUrls?: boolean | undefined; | ||
allowedSchemes?: string[] | boolean | undefined; | ||
allowedSchemesByTag?: { [index: string]: string[] } | boolean | undefined; | ||
allowedSchemesAppliedToAttributes?: string[] | undefined; | ||
allowedScriptDomains?: string[] | undefined; | ||
allowedScriptHostnames?: string[] | undefined; | ||
allowProtocolRelative?: boolean | undefined; | ||
allowedTags?: string[] | false | undefined; | ||
allowVulnerableTags?: boolean | undefined; | ||
textFilter?: ((text: string, tagName: string) => string) | undefined; | ||
exclusiveFilter?: ((frame: IFrame) => boolean) | undefined; | ||
nestingLimit?: number | undefined; | ||
nonTextTags?: string[] | undefined; | ||
/** @default true */ | ||
parseStyleAttributes?: boolean | undefined; | ||
selfClosing?: string[] | undefined; | ||
transformTags?: { [tagName: string]: string | Transformer } | undefined; | ||
parser?: ParserOptions | undefined; | ||
disallowedTagsMode?: DisallowedTagsModes | undefined; | ||
/** | ||
* Setting this option to true will instruct sanitize-html to discard all characters outside of html tag boundaries | ||
* -- before `<html>` and after `</html>` tags | ||
* @see {@link https://github.com/apostrophecms/sanitize-html/#discarding-text-outside-of-htmlhtml-tags} | ||
* @default true | ||
*/ | ||
enforceHtmlBoundary?: boolean | undefined; | ||
} | ||
// tslint:disable-next-line:interface-name | ||
interface IOptions { | ||
allowedAttributes?: Record<string, AllowedAttribute[]> | false | undefined; | ||
allowedStyles?: { [index: string]: { [index: string]: RegExp[] } } | undefined; | ||
allowedClasses?: { [index: string]: boolean | Array<string | RegExp> } | undefined; | ||
allowedIframeDomains?: string[] | undefined; | ||
allowedIframeHostnames?: string[] | undefined; | ||
allowIframeRelativeUrls?: boolean | undefined; | ||
allowedSchemes?: string[] | boolean | undefined; | ||
allowedSchemesByTag?: { [index: string]: string[] } | boolean | undefined; | ||
allowedSchemesAppliedToAttributes?: string[] | undefined; | ||
allowedScriptDomains?: string[] | undefined; | ||
allowedScriptHostnames?: string[] | undefined; | ||
allowProtocolRelative?: boolean | undefined; | ||
allowedTags?: string[] | false | undefined; | ||
allowVulnerableTags?: boolean | undefined; | ||
textFilter?: ((text: string, tagName: string) => string) | undefined; | ||
exclusiveFilter?: ((frame: IFrame) => boolean) | undefined; | ||
nestingLimit?: number | undefined; | ||
nonTextTags?: string[] | undefined; | ||
/** @default true */ | ||
parseStyleAttributes?: boolean | undefined; | ||
selfClosing?: string[] | undefined; | ||
transformTags?: { [tagName: string]: string | Transformer } | undefined; | ||
parser?: ParserOptions | undefined; | ||
disallowedTagsMode?: DisallowedTagsModes | undefined; | ||
/** | ||
* Setting this option to true will instruct sanitize-html to discard all characters outside of html tag boundaries | ||
* -- before `<html>` and after `</html>` tags | ||
* @see {@link https://github.com/apostrophecms/sanitize-html/#discarding-text-outside-of-htmlhtml-tags} | ||
* @default true | ||
*/ | ||
enforceHtmlBoundary?: boolean | undefined; | ||
} | ||
const defaults: IDefaults; | ||
const options: IOptions; | ||
const defaults: IDefaults; | ||
const options: IOptions; | ||
function simpleTransform(tagName: string, attribs: Attributes, merge?: boolean): Transformer; | ||
function simpleTransform(tagName: string, attribs: Attributes, merge?: boolean): Transformer; | ||
} |
{ | ||
"name": "@types/sanitize-html", | ||
"version": "2.9.0", | ||
"version": "2.9.1", | ||
"description": "TypeScript definitions for sanitize-html", | ||
@@ -70,4 +70,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sanitize-html", | ||
}, | ||
"typesPublisherContentHash": "70b02204b93fbee96189d86c606e178bb354f65412f49c0b61d6e5fdce23ef8c", | ||
"typeScriptVersion": "4.2" | ||
"typesPublisherContentHash": "c9fcf25c96a87e1cce4619e577412e0c27e81036031ba60e6c49e6459bcc1e2a", | ||
"typeScriptVersion": "4.5" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Tue, 14 Mar 2023 21:32:39 GMT | ||
* Last updated: Mon, 25 Sep 2023 13:39:06 GMT | ||
* Dependencies: [@types/htmlparser2](https://npmjs.com/package/@types/htmlparser2) | ||
@@ -14,0 +14,0 @@ * Global values: none |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8611
86