editor.js/types/tools/tool-settings.d.ts
George Berezhnoy c93ed2501b
Add tools` titles for Toolbox (#540)
* Add tools` titles for Toolbox

* Bump version

* Use isEmpty method to check object emptiness

* Improve isEmpty method

* Override toolbox settings from editor config
2018-12-04 20:24:41 +03:00

55 lines
990 B
TypeScript

import {ToolConfig} from './tool-config';
import {ToolConstructable} from './tool';
/**
* Tool's Toolbox settings
*/
export interface ToolboxConfig {
/**
* Tool title for Toolbox
*/
title?: string;
/**
* HTML string with an icon for Toolbox
*/
icon?: string;
}
/**
* Object passed to the Tool's constructor by {@link EditorConfig#tools}
*/
export interface ToolSettings {
/**
* Tool's class
*/
class: ToolConstructable;
/**
* User configuration object that will be passed to the Tool's constructor
*/
config?: ToolConfig;
/**
* Is user available to add line brakes in Tool (for example by Shift+Enter)
*/
enableLineBreaks?: boolean;
/**
* Is need to show Inline Toolbar.
* Can accept array of Tools for InlineToolbar or boolean.
*/
inlineToolbar?: boolean | string[];
/**
* Define shortcut that will render Tool
*/
shortcut?: string;
/**
* Tool's Toolbox settings
*/
toolbox?: ToolboxConfig;
}