mirror of
https://github.com/codex-team/editor.js
synced 2024-06-01 13:32:43 +02:00
b223d63c59
This reverts commit 78775703c9
.
44 lines
855 B
TypeScript
44 lines
855 B
TypeScript
import {API} 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;
|
|
|
|
/**
|
|
* Describe constructor parameters
|
|
*/
|
|
new (config: {api: API, config?: ToolConfig}): BaseTool;
|
|
|
|
/**
|
|
* Tool`s prepare method. Can be async
|
|
* @param data
|
|
*/
|
|
prepare?(data: {toolName: string, config: ToolConfig}): void | Promise<void>;
|
|
}
|