2018-11-23 17:11:50 +01:00
|
|
|
/**
|
|
|
|
* Declaration for external JS module
|
|
|
|
* After that we can use it at the TS modules
|
|
|
|
*/
|
|
|
|
declare module 'html-janitor' {
|
2021-03-02 14:34:23 +01:00
|
|
|
/**
|
|
|
|
* Sanitizer config of each HTML element
|
|
|
|
* @see {@link https://github.com/guardian/html-janitor#options}
|
|
|
|
*/
|
|
|
|
type TagConfig = boolean | { [attr: string]: boolean | string };
|
|
|
|
|
2018-11-23 17:11:50 +01:00
|
|
|
interface Config {
|
|
|
|
tags: {
|
2021-03-02 14:34:23 +01:00
|
|
|
[key: string]: TagConfig | ((el: Element) => TagConfig)
|
2018-11-23 17:11:50 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export class HTMLJanitor {
|
|
|
|
constructor(config: Config);
|
|
|
|
|
|
|
|
public clean(taintString: string): string;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Default export
|
|
|
|
*/
|
|
|
|
export default HTMLJanitor;
|
|
|
|
}
|