diff --git a/types/tools/block-tool.d.ts b/types/tools/block-tool.d.ts index ddf47896..740a7a22 100644 --- a/types/tools/block-tool.d.ts +++ b/types/tools/block-tool.d.ts @@ -13,9 +13,15 @@ import { MenuConfig } from './menu-config'; */ export interface BlockTool extends BaseTool { /** - * Sanitizer rules description + * Sanitizer rules description. + * + * @example Flat config (tag-level rules applied to all output) + * { b: true, a: { href: true } } + * + * @example Per-field config + * { text: { br: true, b: true }, caption: { b: true, i: true } } */ - sanitize?: SanitizerConfig; + sanitize?: SanitizerConfig | Record; /** * Process Tool's element in DOM and return raw data diff --git a/types/tools/tool.d.ts b/types/tools/tool.d.ts index 17aa0f2d..2605911e 100644 --- a/types/tools/tool.d.ts +++ b/types/tools/tool.d.ts @@ -37,9 +37,12 @@ export interface BaseToolConstructable { isInline?: boolean; /** - * Tool`s sanitizer configuration + * Tool`s sanitizer configuration. + * + * For Block Tools, can be a Record mapping data field names to their SanitizerConfig. + * For Inline Tools, should be a flat SanitizerConfig with tag names as keys. */ - sanitize?: SanitizerConfig; + sanitize?: SanitizerConfig | Record; /** * Title of Inline Tool.