Correct allowedAttributes type (#38370)

Correct the allowedAttribute to match https://www.npmjs.com/package/sanitize-html#what-if-i-want-to-allow-only-specific-values-on-some-attributes
This commit is contained in:
Kyle Sletten 2019-09-16 12:06:34 -06:00 committed by Daniel Rosenwasser
parent 2581ebe5f0
commit 2acfcc2764

View File

@ -29,9 +29,10 @@ declare namespace sanitize {
type Transformer = (tagName: string, attribs: Attributes) => Tag;
type AllowedAttribute = string | { name: string; multiple?: boolean; values: string[] };
interface IDefaults {
allowedAttributes: { [index: string]: string[] };
allowedAttributes: { [index: string]: AllowedAttribute[] };
allowedSchemes: string[];
allowedSchemesByTag: { [index: string]: string[] };
allowedTags: string[];
@ -48,7 +49,7 @@ declare namespace sanitize {
interface IOptions {
allowedAttributes?: { [index: string]: string[] } | boolean;
allowedAttributes?: { [index: string]: AllowedAttribute[] } | boolean;
allowedStyles?: { [index: string]: { [index: string]: RegExp[] } };
allowedClasses?: { [index: string]: string[] } | boolean;
allowedIframeHostnames?: string[];