@types/sanitize-html 2.3.0 → 2.6.0

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: Thu, 15 Apr 2021 16:31:20 GMT
11
+ * Last updated: Sat, 04 Dec 2021 13:31:03 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), [Will Gibson](https://github.com/WillGibson), [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), [tomotetra](https://github.com/tomotetra), [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,9 +1,8 @@
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>
5
5
  // Rinze de Laat <https://github.com/biermeester>
6
- // Will Gibson <https://github.com/WillGibson>
7
6
  // A penguin <https://github.com/sirMerr>
8
7
  // Johan Davidsson <https://github.com/johandavidson>
9
8
  // Jianrong Yu <https://github.com/YuJianrong>
@@ -11,6 +10,8 @@
11
10
  // tomotetra <https://github.com/tomotetra>
12
11
  // Dariusz Syncerek <https://github.com/dsyncerek>
13
12
  // Piotr Błażejewicz <https://github.com/peterblazejewicz>
13
+ // Pirasis Leelatanon <https://github.com/1pete>
14
+ // Alex Rantos <https://github.com/alex-rantos>
14
15
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
15
16
 
16
17
  import { ParserOptions } from "htmlparser2";
@@ -22,11 +23,11 @@ declare function sanitize(dirty: string, options?: sanitize.IOptions): string;
22
23
  declare namespace sanitize {
23
24
  interface Attributes { [attr: string]: string; }
24
25
 
25
- interface Tag { tagName: string; attribs: Attributes; text?: string; }
26
+ interface Tag { tagName: string; attribs: Attributes; text?: string | undefined; }
26
27
 
27
28
  type Transformer = (tagName: string, attribs: Attributes) => Tag;
28
29
 
29
- type AllowedAttribute = string | { name: string; multiple?: boolean; values: string[] };
30
+ type AllowedAttribute = string | { name: string; multiple?: boolean | undefined; values: string[] };
30
31
 
31
32
  type DisallowedTagsModes = 'discard' | 'escape' | 'recursiveEscape';
32
33
 
@@ -53,36 +54,39 @@ declare namespace sanitize {
53
54
 
54
55
  // tslint:disable-next-line:interface-name
55
56
  interface IOptions {
56
- allowedAttributes?: Record<string, AllowedAttribute[]> | false;
57
- allowedStyles?: { [index: string]: { [index: string]: RegExp[] } };
58
- allowedClasses?: { [index: string]: string[] | boolean };
59
- allowedIframeDomains?: string[];
60
- allowedIframeHostnames?: string[];
61
- allowIframeRelativeUrls?: boolean;
62
- allowedSchemes?: string[] | boolean;
63
- allowedSchemesByTag?: { [index: string]: string[] } | boolean;
64
- allowedSchemesAppliedToAttributes?: string[];
65
- allowProtocolRelative?: boolean;
66
- allowedTags?: string[] | false;
67
- allowVulnerableTags?: boolean;
68
- textFilter?: (text: string, tagName: string) => string;
69
- exclusiveFilter?: (frame: IFrame) => boolean;
70
- nestingLimit?: number;
71
- nonTextTags?: string[];
72
- selfClosing?: string[];
73
- transformTags?: { [tagName: string]: string | Transformer };
74
- parser?: ParserOptions;
75
- disallowedTagsMode?: DisallowedTagsModes;
57
+ allowedAttributes?: Record<string, AllowedAttribute[]> | false | undefined;
58
+ allowedStyles?: { [index: string]: { [index: string]: RegExp[] } } | undefined;
59
+ allowedClasses?: { [index: string]: boolean | Array<string | RegExp> } | undefined;
60
+ allowedIframeDomains?: string[] | undefined;
61
+ allowedIframeHostnames?: string[] | undefined;
62
+ allowIframeRelativeUrls?: boolean | undefined;
63
+ allowedSchemes?: string[] | boolean | undefined;
64
+ allowedSchemesByTag?: { [index: string]: string[] } | boolean | undefined;
65
+ allowedSchemesAppliedToAttributes?: string[] | undefined;
66
+ allowedScriptDomains?: string[] | undefined;
67
+ allowedScriptHostnames?: string[] | undefined;
68
+ allowProtocolRelative?: boolean | undefined;
69
+ allowedTags?: string[] | false | undefined;
70
+ allowVulnerableTags?: boolean | undefined;
71
+ textFilter?: ((text: string, tagName: string) => string) | undefined;
72
+ exclusiveFilter?: ((frame: IFrame) => boolean) | undefined;
73
+ nestingLimit?: number | undefined;
74
+ nonTextTags?: string[] | undefined;
75
+ selfClosing?: string[] | undefined;
76
+ transformTags?: { [tagName: string]: string | Transformer } | undefined;
77
+ parser?: ParserOptions | undefined;
78
+ disallowedTagsMode?: DisallowedTagsModes | undefined;
76
79
  /**
77
80
  * Setting this option to true will instruct sanitize-html to discard all characters outside of html tag boundaries
78
81
  * -- before `<html>` and after `</html>` tags
79
82
  * @see {@link https://github.com/apostrophecms/sanitize-html/#discarding-text-outside-of-htmlhtml-tags}
80
83
  * @default true
81
84
  */
82
- enforceHtmlBoundary?: boolean;
85
+ enforceHtmlBoundary?: boolean | undefined;
83
86
  }
84
87
 
85
88
  const defaults: IDefaults;
89
+ const options: IOptions;
86
90
 
87
91
  function simpleTransform(tagName: string, attribs: Attributes, merge?: boolean): Transformer;
88
92
  }
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@types/sanitize-html",
3
- "version": "2.3.0",
3
+ "version": "2.6.0",
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
  {
@@ -19,11 +20,6 @@
19
20
  "url": "https://github.com/biermeester",
20
21
  "githubUsername": "biermeester"
21
22
  },
22
- {
23
- "name": "Will Gibson",
24
- "url": "https://github.com/WillGibson",
25
- "githubUsername": "WillGibson"
26
- },
27
23
  {
28
24
  "name": "A penguin",
29
25
  "url": "https://github.com/sirMerr",
@@ -58,6 +54,16 @@
58
54
  "name": "Piotr Błażejewicz",
59
55
  "url": "https://github.com/peterblazejewicz",
60
56
  "githubUsername": "peterblazejewicz"
57
+ },
58
+ {
59
+ "name": "Pirasis Leelatanon",
60
+ "url": "https://github.com/1pete",
61
+ "githubUsername": "1pete"
62
+ },
63
+ {
64
+ "name": "Alex Rantos",
65
+ "url": "https://github.com/alex-rantos",
66
+ "githubUsername": "alex-rantos"
61
67
  }
62
68
  ],
63
69
  "main": "",
@@ -71,6 +77,6 @@
71
77
  "dependencies": {
72
78
  "htmlparser2": "^6.0.0"
73
79
  },
74
- "typesPublisherContentHash": "7a4a137f1bc4314f73b1aa41a8330094ad0ff3f35b20eac2bbf83f320454a32b",
75
- "typeScriptVersion": "3.5"
80
+ "typesPublisherContentHash": "cc449ec545e1c43bde6cf10a258ae09e1e9c2dfefea2a094ae6a28d3b6bd6ae6",
81
+ "typeScriptVersion": "3.8"
76
82
  }