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