mirror of
https://github.com/codex-team/editor.js
synced 2024-05-17 22:06:49 +02:00
a67e699991
* 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>
29 lines
600 B
TypeScript
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;
|
|
}
|