@types/sanitize-html 2.3.1 → 2.6.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/README.md CHANGED
@@ -8,9 +8,9 @@ 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, 20 Apr 2021 13:01:22 GMT
11
+ * Last updated: Thu, 23 Dec 2021 23:35:47 GMT
12
12
  * Dependencies: [@types/htmlparser2](https://npmjs.com/package/@types/htmlparser2)
13
13
  * Global values: none
14
14
 
15
15
  # Credits
16
- These definitions were written by [Rogier Schouten](https://github.com/rogierschouten), [Afshin Darian](https://github.com/afshin), [Rinze de Laat](https://github.com/biermeester), [A penguin](https://github.com/sirMerr), [Johan Davidsson](https://github.com/johandavidson), [Jianrong Yu](https://github.com/YuJianrong), [GP](https://github.com/paambaati), [tomotetra](https://github.com/tomotetra), [Dariusz Syncerek](https://github.com/dsyncerek), and [Piotr Błażejewicz](https://github.com/peterblazejewicz).
16
+ These definitions were written by [Rogier Schouten](https://github.com/rogierschouten), [Afshin Darian](https://github.com/afshin), [Rinze de Laat](https://github.com/biermeester), [A penguin](https://github.com/sirMerr), [Johan Davidsson](https://github.com/johandavidson), [Jianrong Yu](https://github.com/YuJianrong), [GP](https://github.com/paambaati), [Dariusz Syncerek](https://github.com/dsyncerek), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Pirasis Leelatanon](https://github.com/1pete), and [Alex Rantos](https://github.com/alex-rantos).
sanitize-html/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for sanitize-html 2.3
1
+ // Type definitions for sanitize-html 2.6
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>
@@ -7,9 +7,10 @@
7
7
  // Johan Davidsson <https://github.com/johandavidson>
8
8
  // Jianrong Yu <https://github.com/YuJianrong>
9
9
  // GP <https://github.com/paambaati>
10
- // tomotetra <https://github.com/tomotetra>
11
10
  // Dariusz Syncerek <https://github.com/dsyncerek>
12
11
  // Piotr Błażejewicz <https://github.com/peterblazejewicz>
12
+ // Pirasis Leelatanon <https://github.com/1pete>
13
+ // Alex Rantos <https://github.com/alex-rantos>
13
14
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
14
15
 
15
16
  import { ParserOptions } from "htmlparser2";
@@ -21,11 +22,11 @@ declare function sanitize(dirty: string, options?: sanitize.IOptions): string;
21
22
  declare namespace sanitize {
22
23
  interface Attributes { [attr: string]: string; }
23
24
 
24
- interface Tag { tagName: string; attribs: Attributes; text?: string; }
25
+ interface Tag { tagName: string; attribs: Attributes; text?: string | undefined; }
25
26
 
26
27
  type Transformer = (tagName: string, attribs: Attributes) => Tag;
27
28
 
28
- type AllowedAttribute = string | { name: string; multiple?: boolean; values: string[] };
29
+ type AllowedAttribute = string | { name: string; multiple?: boolean | undefined; values: string[] };
29
30
 
30
31
  type DisallowedTagsModes = 'discard' | 'escape' | 'recursiveEscape';
31
32
 
@@ -52,36 +53,39 @@ declare namespace sanitize {
52
53
 
53
54
  // tslint:disable-next-line:interface-name
54
55
  interface IOptions {
55
- allowedAttributes?: Record<string, AllowedAttribute[]> | false;
56
- allowedStyles?: { [index: string]: { [index: string]: RegExp[] } };
57
- allowedClasses?: { [index: string]: string[] | boolean };
58
- allowedIframeDomains?: string[];
59
- allowedIframeHostnames?: string[];
60
- allowIframeRelativeUrls?: boolean;
61
- allowedSchemes?: string[] | boolean;
62
- allowedSchemesByTag?: { [index: string]: string[] } | boolean;
63
- allowedSchemesAppliedToAttributes?: string[];
64
- allowProtocolRelative?: boolean;
65
- allowedTags?: string[] | false;
66
- allowVulnerableTags?: boolean;
67
- textFilter?: (text: string, tagName: string) => string;
68
- exclusiveFilter?: (frame: IFrame) => boolean;
69
- nestingLimit?: number;
70
- nonTextTags?: string[];
71
- selfClosing?: string[];
72
- transformTags?: { [tagName: string]: string | Transformer };
73
- parser?: ParserOptions;
74
- disallowedTagsMode?: DisallowedTagsModes;
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;
75
78
  /**
76
79
  * Setting this option to true will instruct sanitize-html to discard all characters outside of html tag boundaries
77
80
  * -- before `<html>` and after `</html>` tags
78
81
  * @see {@link https://github.com/apostrophecms/sanitize-html/#discarding-text-outside-of-htmlhtml-tags}
79
82
  * @default true
80
83
  */
81
- enforceHtmlBoundary?: boolean;
84
+ enforceHtmlBoundary?: boolean | undefined;
82
85
  }
83
86
 
84
87
  const defaults: IDefaults;
88
+ const options: IOptions;
85
89
 
86
90
  function simpleTransform(tagName: string, attribs: Attributes, merge?: boolean): Transformer;
87
91
  }
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@types/sanitize-html",
3
- "version": "2.3.1",
3
+ "version": "2.6.1",
4
4
  "description": "TypeScript definitions for sanitize-html",
5
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sanitize-html",
5
6
  "license": "MIT",
6
7
  "contributors": [
7
8
  {
@@ -39,11 +40,6 @@
39
40
  "url": "https://github.com/paambaati",
40
41
  "githubUsername": "paambaati"
41
42
  },
42
- {
43
- "name": "tomotetra",
44
- "url": "https://github.com/tomotetra",
45
- "githubUsername": "tomotetra"
46
- },
47
43
  {
48
44
  "name": "Dariusz Syncerek",
49
45
  "url": "https://github.com/dsyncerek",
@@ -53,6 +49,16 @@
53
49
  "name": "Piotr Błażejewicz",
54
50
  "url": "https://github.com/peterblazejewicz",
55
51
  "githubUsername": "peterblazejewicz"
52
+ },
53
+ {
54
+ "name": "Pirasis Leelatanon",
55
+ "url": "https://github.com/1pete",
56
+ "githubUsername": "1pete"
57
+ },
58
+ {
59
+ "name": "Alex Rantos",
60
+ "url": "https://github.com/alex-rantos",
61
+ "githubUsername": "alex-rantos"
56
62
  }
57
63
  ],
58
64
  "main": "",
@@ -66,6 +72,6 @@
66
72
  "dependencies": {
67
73
  "htmlparser2": "^6.0.0"
68
74
  },
69
- "typesPublisherContentHash": "5524b3d63581f9f781c3ded53efce19a1c19c308e32a6ba0bb5dbf5222575e8b",
70
- "typeScriptVersion": "3.5"
75
+ "typesPublisherContentHash": "3b8bf74aa165c97f60d056be11a69393e28a6a6cb30f399fb6b60926ef61580f",
76
+ "typeScriptVersion": "3.8"
71
77
  }