//#region src/legacy/index.d.ts /** * sanitize-html: zero-dependency TypeScript rewrite. * Public API matches the original (apostrophecms/sanitize-html). */ type Attributes = Record; interface AllowedAttributeObject { name: string; multiple?: boolean; values: string[]; } type AllowedAttribute = string | AllowedAttributeObject; type DisallowedTagsMode = 'discard' | 'escape' | 'recursiveEscape' | 'completelyDiscard'; interface IFrame { tag: string; attribs: Attributes; text: string; tagPosition: number; mediaChildren: string[]; /** Set by transformTags when the transformer returns `text`. */ innerText?: string; /** Set when the transformer changed the tag name. */ name?: string; } interface TransformResult { tagName: string; attribs: Attributes; text?: string; } type Transformer = (tagName: string, attribs: Attributes) => TransformResult; interface ParserOptions { decodeEntities?: boolean; lowerCaseTags?: boolean; lowerCaseAttributeNames?: boolean; } interface AllowedStyles { [tagOrStar: string]: { [property: string]: RegExp[]; }; } interface IOptions { allowedTags?: string[] | false | null; disallowedTagsMode?: DisallowedTagsMode; allowedAttributes?: Record | false | null; allowedClasses?: Record | false>; allowedStyles?: AllowedStyles; allowedSchemes?: string[]; allowedSchemesByTag?: Record; allowedSchemesAppliedToAttributes?: string[]; allowProtocolRelative?: boolean; allowedIframeHostnames?: string[]; allowedIframeDomains?: string[]; allowIframeRelativeUrls?: boolean; allowedScriptHostnames?: string[]; allowedScriptDomains?: string[]; allowVulnerableTags?: boolean; enforceHtmlBoundary?: boolean; parseStyleAttributes?: boolean; preserveEscapedAttributes?: boolean; selfClosing?: string[]; nonTextTags?: string[]; nonBooleanAttributes?: string[]; allowedEmptyAttributes?: string[]; transformTags?: Record; textFilter?: (text: string, tagName?: string) => string; exclusiveFilter?: (frame: IFrame) => boolean | 'excludeTag'; onOpenTag?: (name: string, attribs: Attributes) => void; onCloseTag?: (name: string, isImplied: boolean) => void; nestingLimit?: number; parser?: ParserOptions; } interface Defaults { allowedTags: string[]; nonBooleanAttributes: string[]; disallowedTagsMode: DisallowedTagsMode; allowedAttributes: Record; allowedEmptyAttributes: string[]; selfClosing: string[]; allowedSchemes: string[]; allowedSchemesByTag: Record; allowedSchemesAppliedToAttributes: string[]; allowProtocolRelative: boolean; enforceHtmlBoundary: boolean; parseStyleAttributes: boolean; preserveEscapedAttributes: boolean; } interface SanitizeHtml { (html: string | number | null | undefined, options?: IOptions, _recursing?: boolean): string; defaults: Defaults; simpleTransform: (newTagName: string, newAttribs?: Attributes, merge?: boolean) => Transformer; } declare const sanitizeHtml: SanitizeHtml; //#endregion export { sanitizeHtml as default }; //# sourceMappingURL=index.d.mts.map