@types/sanitize-html 1.23.2 → 1.27.2
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 +0 -0
- sanitize-html/README.md +2 -2
- sanitize-html/index.d.ts +13 -15
- sanitize-html/package.json +3 -8
sanitize-html/LICENSE
CHANGED
|
File without changes
|
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:
|
|
11
|
+
* Last updated: Wed, 31 Mar 2021 10:01:11 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), [
|
|
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.
|
|
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>
|
|
@@ -13,7 +12,6 @@
|
|
|
13
12
|
// Dariusz Syncerek <https://github.com/dsyncerek>
|
|
14
13
|
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
|
15
14
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
16
|
-
// TypeScript Version: 2.2
|
|
17
15
|
|
|
18
16
|
import { ParserOptions } from "htmlparser2";
|
|
19
17
|
|
|
@@ -22,11 +20,9 @@ export = sanitize;
|
|
|
22
20
|
declare function sanitize(dirty: string, options?: sanitize.IOptions): string;
|
|
23
21
|
|
|
24
22
|
declare namespace sanitize {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
type Tag = { tagName: string; attribs: Attributes; text?: string; };
|
|
23
|
+
interface Attributes { [attr: string]: string; }
|
|
29
24
|
|
|
25
|
+
interface Tag { tagName: string; attribs: Attributes; text?: string; }
|
|
30
26
|
|
|
31
27
|
type Transformer = (tagName: string, attribs: Attributes) => Tag;
|
|
32
28
|
|
|
@@ -34,6 +30,7 @@ declare namespace sanitize {
|
|
|
34
30
|
|
|
35
31
|
type DisallowedTagsModes = 'discard' | 'escape' | 'recursiveEscape';
|
|
36
32
|
|
|
33
|
+
// tslint:disable-next-line:interface-name
|
|
37
34
|
interface IDefaults {
|
|
38
35
|
allowedAttributes: { [index: string]: AllowedAttribute[] };
|
|
39
36
|
allowedSchemes: string[];
|
|
@@ -41,11 +38,12 @@ declare namespace sanitize {
|
|
|
41
38
|
allowedSchemesAppliedToAttributes: string[];
|
|
42
39
|
allowedTags: string[];
|
|
43
40
|
allowProtocolRelative: boolean;
|
|
44
|
-
disallowedTagsMode:
|
|
41
|
+
disallowedTagsMode: DisallowedTagsModes;
|
|
45
42
|
enforceHtmlBoundary: boolean;
|
|
46
43
|
selfClosing: string[];
|
|
47
44
|
}
|
|
48
45
|
|
|
46
|
+
// tslint:disable-next-line:interface-name
|
|
49
47
|
interface IFrame {
|
|
50
48
|
tag: string;
|
|
51
49
|
attribs: { [index: string]: string };
|
|
@@ -53,11 +51,12 @@ declare namespace sanitize {
|
|
|
53
51
|
tagPosition: number;
|
|
54
52
|
}
|
|
55
53
|
|
|
56
|
-
|
|
54
|
+
// tslint:disable-next-line:interface-name
|
|
57
55
|
interface IOptions {
|
|
58
56
|
allowedAttributes?: { [index: string]: AllowedAttribute[] } | boolean;
|
|
59
|
-
allowedStyles?:
|
|
60
|
-
allowedClasses?: { [index: string]: string[]
|
|
57
|
+
allowedStyles?: { [index: string]: { [index: string]: RegExp[] } };
|
|
58
|
+
allowedClasses?: { [index: string]: string[] | boolean };
|
|
59
|
+
allowedIframeDomains?: string[];
|
|
61
60
|
allowedIframeHostnames?: string[];
|
|
62
61
|
allowIframeRelativeUrls?: boolean;
|
|
63
62
|
allowedSchemes?: string[] | boolean;
|
|
@@ -65,7 +64,8 @@ declare namespace sanitize {
|
|
|
65
64
|
allowedSchemesAppliedToAttributes?: string[];
|
|
66
65
|
allowProtocolRelative?: boolean;
|
|
67
66
|
allowedTags?: string[] | boolean;
|
|
68
|
-
|
|
67
|
+
allowVulnerableTags?: boolean;
|
|
68
|
+
textFilter?: (text: string, tagName: string) => string;
|
|
69
69
|
exclusiveFilter?: (frame: IFrame) => boolean;
|
|
70
70
|
nonTextTags?: string[];
|
|
71
71
|
selfClosing?: string[];
|
|
@@ -81,9 +81,7 @@ declare namespace sanitize {
|
|
|
81
81
|
enforceHtmlBoundary?: boolean;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
var defaults: IDefaults;
|
|
86
|
-
|
|
84
|
+
let defaults: IDefaults;
|
|
87
85
|
|
|
88
86
|
function simpleTransform(tagName: string, attribs: Attributes, merge?: boolean): Transformer;
|
|
89
87
|
}
|
sanitize-html/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/sanitize-html",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.27.2",
|
|
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",
|
|
@@ -76,6 +71,6 @@
|
|
|
76
71
|
"dependencies": {
|
|
77
72
|
"htmlparser2": "^4.1.0"
|
|
78
73
|
},
|
|
79
|
-
"typesPublisherContentHash": "
|
|
80
|
-
"typeScriptVersion": "3.
|
|
74
|
+
"typesPublisherContentHash": "8544398fe5acf8c000f1701cd4a8f6f6ad568229510f69fe5e4fc347613a95d3",
|
|
75
|
+
"typeScriptVersion": "3.5"
|
|
81
76
|
}
|