@types/sanitize-html 1.23.0 → 1.27.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: Sun, 26 Apr 2020 16:35:43 GMT
11
+ * Last updated: Wed, 09 Sep 2020 21:51:54 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), [BehindTheMath](https://github.com/BehindTheMath), [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), and [Dariusz Syncerek](https://github.com/dsyncerek).
16
+ These definitions were written by [Rogier Schouten](https://github.com/rogierschouten), [Afshin Darian](https://github.com/afshin), [BehindTheMath](https://github.com/BehindTheMath), [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).
sanitize-html/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for sanitize-html 1.23.0
1
+ // Type definitions for sanitize-html 1.27
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>
@@ -11,8 +11,8 @@
11
11
  // GP <https://github.com/paambaati>
12
12
  // tomotetra <https://github.com/tomotetra>
13
13
  // Dariusz Syncerek <https://github.com/dsyncerek>
14
+ // Piotr Błażejewicz <https://github.com/peterblazejewicz>
14
15
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
15
- // TypeScript Version: 2.2
16
16
 
17
17
  import { ParserOptions } from "htmlparser2";
18
18
 
@@ -21,11 +21,9 @@ export = sanitize;
21
21
  declare function sanitize(dirty: string, options?: sanitize.IOptions): string;
22
22
 
23
23
  declare namespace sanitize {
24
- type Attributes = { [attr: string]: string };
25
-
26
-
27
- type Tag = { tagName: string; attribs: Attributes; text?: string; };
24
+ interface Attributes { [attr: string]: string; }
28
25
 
26
+ interface Tag { tagName: string; attribs: Attributes; text?: string; }
29
27
 
30
28
  type Transformer = (tagName: string, attribs: Attributes) => Tag;
31
29
 
@@ -33,15 +31,20 @@ declare namespace sanitize {
33
31
 
34
32
  type DisallowedTagsModes = 'discard' | 'escape' | 'recursiveEscape';
35
33
 
34
+ // tslint:disable-next-line:interface-name
36
35
  interface IDefaults {
37
36
  allowedAttributes: { [index: string]: AllowedAttribute[] };
38
37
  allowedSchemes: string[];
39
38
  allowedSchemesByTag: { [index: string]: string[] };
39
+ allowedSchemesAppliedToAttributes: string[];
40
40
  allowedTags: string[];
41
+ allowProtocolRelative: boolean;
42
+ disallowedTagsMode: string;
43
+ enforceHtmlBoundary: boolean;
41
44
  selfClosing: string[];
42
45
  }
43
46
 
44
-
47
+ // tslint:disable-next-line:interface-name
45
48
  interface IFrame {
46
49
  tag: string;
47
50
  attribs: { [index: string]: string };
@@ -49,11 +52,12 @@ declare namespace sanitize {
49
52
  tagPosition: number;
50
53
  }
51
54
 
52
-
55
+ // tslint:disable-next-line:interface-name
53
56
  interface IOptions {
54
57
  allowedAttributes?: { [index: string]: AllowedAttribute[] } | boolean;
55
- allowedStyles?: { [index: string]: { [index: string]: RegExp[] } };
56
- allowedClasses?: { [index: string]: string[] } | boolean;
58
+ allowedStyles?: { [index: string]: { [index: string]: RegExp[] } };
59
+ allowedClasses?: { [index: string]: string[] | boolean };
60
+ allowedIframeDomains?: string[];
57
61
  allowedIframeHostnames?: string[];
58
62
  allowIframeRelativeUrls?: boolean;
59
63
  allowedSchemes?: string[] | boolean;
@@ -61,18 +65,24 @@ declare namespace sanitize {
61
65
  allowedSchemesAppliedToAttributes?: string[];
62
66
  allowProtocolRelative?: boolean;
63
67
  allowedTags?: string[] | boolean;
64
- textFilter?: (text: string) => string;
68
+ allowVulnerableTags?: boolean;
69
+ textFilter?: (text: string, tagName: string) => string;
65
70
  exclusiveFilter?: (frame: IFrame) => boolean;
66
71
  nonTextTags?: string[];
67
72
  selfClosing?: string[];
68
73
  transformTags?: { [tagName: string]: string | Transformer };
69
74
  parser?: ParserOptions;
70
75
  disallowedTagsMode?: DisallowedTagsModes;
76
+ /**
77
+ * Setting this option to true will instruct sanitize-html to discard all characters outside of html tag boundaries
78
+ * -- before `<html>` and after `</html>` tags
79
+ * @see {@link https://github.com/apostrophecms/sanitize-html/#discarding-text-outside-of-htmlhtml-tags}
80
+ * @default true
81
+ */
82
+ enforceHtmlBoundary?: boolean;
71
83
  }
72
84
 
73
-
74
- var defaults: IDefaults;
75
-
85
+ let defaults: IDefaults;
76
86
 
77
87
  function simpleTransform(tagName: string, attribs: Attributes, merge?: boolean): Transformer;
78
88
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/sanitize-html",
3
- "version": "1.23.0",
3
+ "version": "1.27.0",
4
4
  "description": "TypeScript definitions for sanitize-html",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -58,6 +58,11 @@
58
58
  "name": "Dariusz Syncerek",
59
59
  "url": "https://github.com/dsyncerek",
60
60
  "githubUsername": "dsyncerek"
61
+ },
62
+ {
63
+ "name": "Piotr Błażejewicz",
64
+ "url": "https://github.com/peterblazejewicz",
65
+ "githubUsername": "peterblazejewicz"
61
66
  }
62
67
  ],
63
68
  "main": "",
@@ -71,6 +76,6 @@
71
76
  "dependencies": {
72
77
  "htmlparser2": "^4.1.0"
73
78
  },
74
- "typesPublisherContentHash": "f70452951cdc33d1b87939bda9e8da63e1d86a52eb5de5f2323c3bc6733f349f",
75
- "typeScriptVersion": "2.8"
79
+ "typesPublisherContentHash": "749522d3339b44d998e9c6b83457b05baaff423dee1c839409ad0fe9ed006ed7",
80
+ "typeScriptVersion": "3.1"
76
81
  }