2018-11-23 17:11:50 +01:00
|
|
|
import {ToolConstructable, ToolSettings} from '../tools';
|
2019-11-30 21:42:39 +01:00
|
|
|
import {LogLevels, OutputData} from '../index';
|
2018-11-23 17:11:50 +01:00
|
|
|
import {SanitizerConfig} from './sanitizer-config';
|
|
|
|
|
|
|
|
export interface EditorConfig {
|
|
|
|
/**
|
|
|
|
* Element where Editor will be append
|
2019-04-29 14:52:54 +02:00
|
|
|
* @deprecated property will be removed in next major release, use holder instead
|
2018-11-23 17:11:50 +01:00
|
|
|
*/
|
2019-04-29 14:52:54 +02:00
|
|
|
holderId?: string | HTMLElement;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Element where Editor will be append
|
|
|
|
*/
|
|
|
|
holder?: string | HTMLElement;
|
2018-11-23 17:11:50 +01:00
|
|
|
|
2019-01-12 01:44:43 +01:00
|
|
|
/**
|
|
|
|
* If true, set caret at the first Block after Editor is ready
|
|
|
|
*/
|
|
|
|
autofocus?: boolean;
|
|
|
|
|
2018-11-23 17:11:50 +01:00
|
|
|
/**
|
|
|
|
* This Tool will be used as default
|
|
|
|
* Name should be equal to one of Tool`s keys of passed tools
|
|
|
|
* If not specified, Paragraph Tool will be used
|
|
|
|
*/
|
|
|
|
initialBlock?: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* First Block placeholder
|
|
|
|
*/
|
2019-06-12 19:38:16 +02:00
|
|
|
placeholder?: string|false;
|
2018-11-23 17:11:50 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Define default sanitizer configuration
|
|
|
|
* @see {@link sanitizer}
|
|
|
|
*/
|
|
|
|
sanitizer?: SanitizerConfig;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* If true, toolbar won't be shown
|
|
|
|
*/
|
|
|
|
hideToolbar?: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Map of Tools to use
|
|
|
|
*/
|
|
|
|
tools?: {[toolName: string]: ToolConstructable|ToolSettings};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Data to render on Editor start
|
|
|
|
*/
|
|
|
|
data?: OutputData;
|
|
|
|
|
2019-04-29 14:52:54 +02:00
|
|
|
/**
|
|
|
|
* Height of Editor's bottom area that allows to set focus on the last Block
|
|
|
|
*/
|
|
|
|
minHeight?: number;
|
|
|
|
|
2019-11-30 21:42:39 +01:00
|
|
|
/**
|
|
|
|
* Editors log level (how many logs you want to see)
|
|
|
|
*/
|
|
|
|
logLevel?: LogLevels;
|
|
|
|
|
2018-11-23 17:11:50 +01:00
|
|
|
/**
|
|
|
|
* Fires when Editor is ready to work
|
|
|
|
*/
|
|
|
|
onReady?(): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fires when something changed in DOM
|
|
|
|
*/
|
|
|
|
onChange?(): void;
|
|
|
|
}
|