editor.js/src/types-internal/html-janitor.d.ts
Tomoyuki Hata a67e699991
Fix SanitizerConfig type definition (#1456)
* Fix SanitizerConfig type definition

* Update docs/CHANGELOG.md

Co-authored-by: Peter Savchenko <specc.dev@gmail.com>

* Fix CHANGELOG

* Add JSDoc to TagConfig

* yarn lint:fix

Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
Co-authored-by: George Berezhnoy <gohabereg@users.noreply.github.com>
2021-03-02 16:34:23 +03:00

29 lines
600 B
TypeScript

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