@types/sanitize-html 2.8.1 → 2.9.1

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: Thu, 02 Mar 2023 08:32:41 GMT
11
+ * Last updated: Mon, 25 Sep 2023 13:39:06 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
@@ -1,4 +1,4 @@
1
- // Type definitions for sanitize-html 2.8
1
+ // Type definitions for sanitize-html 2.9
2
2
  // Project: https://github.com/punkave/sanitize-html
3
3
  // Definitions by: Rogier Schouten <https://github.com/rogierschouten>
4
4
  // Afshin Darian <https://github.com/afshin>
@@ -19,73 +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
- selfClosing?: string[] | undefined;
75
- transformTags?: { [tagName: string]: string | Transformer } | undefined;
76
- parser?: ParserOptions | undefined;
77
- disallowedTagsMode?: DisallowedTagsModes | undefined;
78
- /**
79
- * Setting this option to true will instruct sanitize-html to discard all characters outside of html tag boundaries
80
- * -- before `<html>` and after `</html>` tags
81
- * @see {@link https://github.com/apostrophecms/sanitize-html/#discarding-text-outside-of-htmlhtml-tags}
82
- * @default true
83
- */
84
- enforceHtmlBoundary?: boolean | undefined;
85
- }
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
+ }
86
94
 
87
- const defaults: IDefaults;
88
- const options: IOptions;
95
+ const defaults: IDefaults;
96
+ const options: IOptions;
89
97
 
90
- function simpleTransform(tagName: string, attribs: Attributes, merge?: boolean): Transformer;
98
+ function simpleTransform(tagName: string, attribs: Attributes, merge?: boolean): Transformer;
91
99
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/sanitize-html",
3
- "version": "2.8.1",
3
+ "version": "2.9.1",
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": "da591a56107410800601c7753613244a4696749357bca7a2517a9c4440dc6a84",
71
- "typeScriptVersion": "4.2"
70
+ "typesPublisherContentHash": "c9fcf25c96a87e1cce4619e577412e0c27e81036031ba60e6c49e6459bcc1e2a",
71
+ "typeScriptVersion": "4.5"
72
72
  }