@types/sanitize-html 2.9.0 → 2.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
sanitize-html/LICENSE CHANGED
File without changes
sanitize-html/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for sanitize-html (https://github.com/pun
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sanitize-html.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Tue, 14 Mar 2023 21:32:39 GMT
11
+ * Last updated: Tue, 10 Oct 2023 18:07:33 GMT
12
12
  * Dependencies: [@types/htmlparser2](https://npmjs.com/package/@types/htmlparser2)
13
13
  * Global values: none
14
14
 
sanitize-html/index.d.ts CHANGED
@@ -19,75 +19,81 @@ export = sanitize;
19
19
  declare function sanitize(dirty: string, options?: sanitize.IOptions): string;
20
20
 
21
21
  declare namespace sanitize {
22
- interface Attributes { [attr: string]: string; }
22
+ interface Attributes {
23
+ [attr: string]: string;
24
+ }
23
25
 
24
- interface Tag { tagName: string; attribs: Attributes; text?: string | undefined; }
26
+ interface Tag {
27
+ tagName: string;
28
+ attribs: Attributes;
29
+ text?: string | undefined;
30
+ }
25
31
 
26
- type Transformer = (tagName: string, attribs: Attributes) => Tag;
32
+ type Transformer = (tagName: string, attribs: Attributes) => Tag;
27
33
 
28
- type AllowedAttribute = string | { name: string; multiple?: boolean | undefined; values: string[] };
34
+ type AllowedAttribute = string | { name: string; multiple?: boolean | undefined; values: string[] };
29
35
 
30
- type DisallowedTagsModes = 'discard' | 'escape' | 'recursiveEscape';
36
+ type DisallowedTagsModes = "discard" | "escape" | "recursiveEscape";
31
37
 
32
- // tslint:disable-next-line:interface-name
33
- interface IDefaults {
34
- allowedAttributes: Record<string, AllowedAttribute[]>;
35
- allowedSchemes: string[];
36
- allowedSchemesByTag: { [index: string]: string[] };
37
- allowedSchemesAppliedToAttributes: string[];
38
- allowedTags: string[];
39
- allowProtocolRelative: boolean;
40
- disallowedTagsMode: DisallowedTagsModes;
41
- enforceHtmlBoundary: boolean;
42
- selfClosing: string[];
43
- }
38
+ // tslint:disable-next-line:interface-name
39
+ interface IDefaults {
40
+ allowedAttributes: Record<string, AllowedAttribute[]>;
41
+ allowedSchemes: string[];
42
+ allowedSchemesByTag: { [index: string]: string[] };
43
+ allowedSchemesAppliedToAttributes: string[];
44
+ allowedTags: string[];
45
+ allowProtocolRelative: boolean;
46
+ disallowedTagsMode: DisallowedTagsModes;
47
+ enforceHtmlBoundary: boolean;
48
+ selfClosing: string[];
49
+ }
44
50
 
45
- // tslint:disable-next-line:interface-name
46
- interface IFrame {
47
- tag: string;
48
- attribs: { [index: string]: string };
49
- text: string;
50
- tagPosition: number;
51
- mediaChildren: string[];
52
- }
51
+ // tslint:disable-next-line:interface-name
52
+ interface IFrame {
53
+ tag: string;
54
+ attribs: { [index: string]: string };
55
+ text: string;
56
+ tagPosition: number;
57
+ mediaChildren: string[];
58
+ }
53
59
 
54
- // tslint:disable-next-line:interface-name
55
- interface IOptions {
56
- allowedAttributes?: Record<string, AllowedAttribute[]> | false | undefined;
57
- allowedStyles?: { [index: string]: { [index: string]: RegExp[] } } | undefined;
58
- allowedClasses?: { [index: string]: boolean | Array<string | RegExp> } | undefined;
59
- allowedIframeDomains?: string[] | undefined;
60
- allowedIframeHostnames?: string[] | undefined;
61
- allowIframeRelativeUrls?: boolean | undefined;
62
- allowedSchemes?: string[] | boolean | undefined;
63
- allowedSchemesByTag?: { [index: string]: string[] } | boolean | undefined;
64
- allowedSchemesAppliedToAttributes?: string[] | undefined;
65
- allowedScriptDomains?: string[] | undefined;
66
- allowedScriptHostnames?: string[] | undefined;
67
- allowProtocolRelative?: boolean | undefined;
68
- allowedTags?: string[] | false | undefined;
69
- allowVulnerableTags?: boolean | undefined;
70
- textFilter?: ((text: string, tagName: string) => string) | undefined;
71
- exclusiveFilter?: ((frame: IFrame) => boolean) | undefined;
72
- nestingLimit?: number | undefined;
73
- nonTextTags?: string[] | undefined;
74
- /** @default true */
75
- parseStyleAttributes?: boolean | undefined;
76
- selfClosing?: string[] | undefined;
77
- transformTags?: { [tagName: string]: string | Transformer } | undefined;
78
- parser?: ParserOptions | undefined;
79
- disallowedTagsMode?: DisallowedTagsModes | undefined;
80
- /**
81
- * Setting this option to true will instruct sanitize-html to discard all characters outside of html tag boundaries
82
- * -- before `<html>` and after `</html>` tags
83
- * @see {@link https://github.com/apostrophecms/sanitize-html/#discarding-text-outside-of-htmlhtml-tags}
84
- * @default true
85
- */
86
- enforceHtmlBoundary?: boolean | undefined;
87
- }
60
+ // tslint:disable-next-line:interface-name
61
+ interface IOptions {
62
+ allowedAttributes?: Record<string, AllowedAttribute[]> | false | undefined;
63
+ allowedStyles?: { [index: string]: { [index: string]: RegExp[] } } | undefined;
64
+ allowedClasses?: { [index: string]: boolean | Array<string | RegExp> } | undefined;
65
+ allowedIframeDomains?: string[] | undefined;
66
+ allowedIframeHostnames?: string[] | undefined;
67
+ allowIframeRelativeUrls?: boolean | undefined;
68
+ allowedSchemes?: string[] | boolean | undefined;
69
+ allowedSchemesByTag?: { [index: string]: string[] } | boolean | undefined;
70
+ allowedSchemesAppliedToAttributes?: string[] | undefined;
71
+ allowedScriptDomains?: string[] | undefined;
72
+ allowedScriptHostnames?: string[] | undefined;
73
+ allowProtocolRelative?: boolean | undefined;
74
+ allowedTags?: string[] | false | undefined;
75
+ allowVulnerableTags?: boolean | undefined;
76
+ textFilter?: ((text: string, tagName: string) => string) | undefined;
77
+ exclusiveFilter?: ((frame: IFrame) => boolean) | undefined;
78
+ nestingLimit?: number | undefined;
79
+ nonTextTags?: string[] | undefined;
80
+ /** @default true */
81
+ parseStyleAttributes?: boolean | undefined;
82
+ selfClosing?: string[] | undefined;
83
+ transformTags?: { [tagName: string]: string | Transformer } | undefined;
84
+ parser?: ParserOptions | undefined;
85
+ disallowedTagsMode?: DisallowedTagsModes | undefined;
86
+ /**
87
+ * Setting this option to true will instruct sanitize-html to discard all characters outside of html tag boundaries
88
+ * -- before `<html>` and after `</html>` tags
89
+ * @see {@link https://github.com/apostrophecms/sanitize-html/#discarding-text-outside-of-htmlhtml-tags}
90
+ * @default true
91
+ */
92
+ enforceHtmlBoundary?: boolean | undefined;
93
+ }
88
94
 
89
- const defaults: IDefaults;
90
- const options: IOptions;
95
+ const defaults: IDefaults;
96
+ const options: IOptions;
91
97
 
92
- function simpleTransform(tagName: string, attribs: Attributes, merge?: boolean): Transformer;
98
+ function simpleTransform(tagName: string, attribs: Attributes, merge?: boolean): Transformer;
93
99
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/sanitize-html",
3
- "version": "2.9.0",
3
+ "version": "2.9.2",
4
4
  "description": "TypeScript definitions for sanitize-html",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sanitize-html",
6
6
  "license": "MIT",
@@ -67,6 +67,6 @@
67
67
  "dependencies": {
68
68
  "htmlparser2": "^8.0.0"
69
69
  },
70
- "typesPublisherContentHash": "70b02204b93fbee96189d86c606e178bb354f65412f49c0b61d6e5fdce23ef8c",
71
- "typeScriptVersion": "4.2"
70
+ "typesPublisherContentHash": "5eedabb8a48f02ebc4e52b7ffaf273bfc4844d9335d968b2c19f96a2aec73166",
71
+ "typeScriptVersion": "4.5"
72
72
  }