editor.js/types/tools/tool.d.ts
George Berezhnoy 4c0d806a12
[Refactor] ESLint fixed (#1100)
Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
2020-04-18 21:55:19 +03:00

39 lines
775 B
TypeScript

import {API, BlockToolData, ToolSettings} from '../index';
import {ToolConfig} from './tool-config';
import {SanitizerConfig} from '../configs';
/**
* Abstract interface of all Tools
*/
export interface BaseTool {
/**
* Tool`s render method
* For inline Tools returns inline toolbar button
* For block Tools returns tool`s wrapper
*/
render(): HTMLElement;
}
export interface BaseToolConstructable {
/**
* Define Tool type as Inline
*/
isInline?: boolean;
/**
* Tool`s sanitizer configuration
*/
sanitize?: SanitizerConfig;
/**
* Title of Inline Tool
*/
title?: string;
/**
* Tool`s prepare method. Can be async
* @param data
*/
prepare?(data: {toolName: string, config: ToolConfig}): void | Promise<void>;
}