|
@@ -1,22 +1,22 @@
|
|
// Type definitions for sanitize-html 1.12.0
|
|
// Type definitions for sanitize-html 1.12.0
|
|
// Project: https://github.com/punkave/sanitize-html
|
|
// Project: https://github.com/punkave/sanitize-html
|
|
|
|
+// Definitions by: Rogier Schouten <https://github.com/rogierschouten>, Afshin Darian <https://github.com/afshin>
|
|
|
|
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
+
|
|
|
|
+
|
|
declare function sanitize(dirty: string, options?: sanitize.IOptions): string;
|
|
declare function sanitize(dirty: string, options?: sanitize.IOptions): string;
|
|
|
|
|
|
|
|
|
|
declare namespace sanitize {
|
|
declare namespace sanitize {
|
|
- export
|
|
|
|
type Attributes = { [attr: string]: string };
|
|
type Attributes = { [attr: string]: string };
|
|
|
|
|
|
|
|
|
|
- export
|
|
|
|
type Tag = { tagName: string; attributes: Attributes; };
|
|
type Tag = { tagName: string; attributes: Attributes; };
|
|
|
|
|
|
|
|
|
|
- export
|
|
|
|
type Transformer = (tagName: string, attributes: Attributes) => Tag;
|
|
type Transformer = (tagName: string, attributes: Attributes) => Tag;
|
|
|
|
|
|
|
|
|
|
- export
|
|
|
|
interface IDefaults {
|
|
interface IDefaults {
|
|
allowedAttributes: { [index: string]: string[] };
|
|
allowedAttributes: { [index: string]: string[] };
|
|
allowedSchemes: string[];
|
|
allowedSchemes: string[];
|
|
@@ -26,7 +26,6 @@ declare namespace sanitize {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- export
|
|
|
|
interface IFrame {
|
|
interface IFrame {
|
|
tag: string;
|
|
tag: string;
|
|
attributes: { [index: string]: string };
|
|
attributes: { [index: string]: string };
|
|
@@ -35,7 +34,6 @@ declare namespace sanitize {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- export
|
|
|
|
interface IOptions {
|
|
interface IOptions {
|
|
allowedAttributes?: { [index: string]: string[] };
|
|
allowedAttributes?: { [index: string]: string[] };
|
|
allowedClasses?: { [index: string]: string[] };
|
|
allowedClasses?: { [index: string]: string[] };
|
|
@@ -47,15 +45,13 @@ declare namespace sanitize {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- export
|
|
|
|
var defaults: IDefaults;
|
|
var defaults: IDefaults;
|
|
|
|
|
|
|
|
|
|
- export
|
|
|
|
function simpleTransform(tagName: string, attributes: Attributes, merge?: boolean): Transformer;
|
|
function simpleTransform(tagName: string, attributes: Attributes, merge?: boolean): Transformer;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
declare module 'sanitize-html' {
|
|
declare module 'sanitize-html' {
|
|
export = sanitize;
|
|
export = sanitize;
|
|
-}
|
|
|
|
|
|
+}
|