2018-11-23 17:11:50 +01:00
|
|
|
/**
|
|
|
|
* For export type there should be one entry point,
|
|
|
|
* so we export all types from this file
|
|
|
|
* ------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
import {EditorConfig} from './configs';
|
2019-11-30 21:42:39 +01:00
|
|
|
import {
|
|
|
|
Blocks,
|
|
|
|
Caret,
|
|
|
|
Events,
|
|
|
|
InlineToolbar,
|
|
|
|
Listeners,
|
|
|
|
Notifier,
|
|
|
|
Sanitizer,
|
|
|
|
Saver,
|
|
|
|
Selection,
|
|
|
|
Styles,
|
|
|
|
Toolbar,
|
|
|
|
Tooltip,
|
|
|
|
} from './api';
|
|
|
|
import {OutputData} from './data-formats/output-data';
|
2018-11-23 17:11:50 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Interfaces used for development
|
|
|
|
*/
|
|
|
|
export {
|
2019-01-25 04:21:34 +01:00
|
|
|
BaseTool,
|
|
|
|
BaseToolConstructable,
|
2018-11-23 17:11:50 +01:00
|
|
|
InlineTool,
|
|
|
|
InlineToolConstructable,
|
|
|
|
BlockToolConstructable,
|
|
|
|
BlockTool,
|
|
|
|
BlockToolData,
|
2019-01-25 04:21:34 +01:00
|
|
|
Tool,
|
|
|
|
ToolConstructable,
|
2018-12-04 18:24:41 +01:00
|
|
|
ToolboxConfig,
|
2018-11-23 17:11:50 +01:00
|
|
|
ToolSettings,
|
|
|
|
ToolConfig,
|
2018-11-29 10:16:06 +01:00
|
|
|
PasteEvent,
|
|
|
|
PasteEventDetail,
|
|
|
|
PatternPasteEvent,
|
|
|
|
PatternPasteEventDetail,
|
|
|
|
HTMLPasteEvent,
|
|
|
|
HTMLPasteEventDetail,
|
|
|
|
FilePasteEvent,
|
|
|
|
FilePasteEventDetail,
|
2018-11-23 17:11:50 +01:00
|
|
|
} from './tools';
|
|
|
|
export {BlockTune, BlockTuneConstructable} from './block-tunes';
|
2019-11-30 21:42:39 +01:00
|
|
|
export {EditorConfig, SanitizerConfig, PasteConfig, LogLevels, ConversionConfig} from './configs';
|
2018-11-23 17:11:50 +01:00
|
|
|
export {OutputData} from './data-formats/output-data';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* We have a namespace API {@link ./api/index.d.ts} (APIMethods) but we can not use it as interface
|
|
|
|
* So we should create new interface for exporting API type
|
|
|
|
*/
|
|
|
|
export interface API {
|
|
|
|
blocks: Blocks;
|
|
|
|
caret: Caret;
|
|
|
|
events: Events;
|
|
|
|
listeners: Listeners;
|
|
|
|
notifier: Notifier;
|
|
|
|
sanitizer: Sanitizer;
|
|
|
|
saver: Saver;
|
|
|
|
selection: Selection;
|
|
|
|
styles: Styles;
|
|
|
|
toolbar: Toolbar;
|
2019-04-29 14:52:54 +02:00
|
|
|
inlineToolbar: InlineToolbar;
|
2019-11-30 21:42:39 +01:00
|
|
|
tooltip: Tooltip;
|
2018-11-23 17:11:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Main Editor class
|
|
|
|
*/
|
|
|
|
declare class EditorJS {
|
|
|
|
public static version: string;
|
|
|
|
|
|
|
|
public isReady: Promise<void>;
|
|
|
|
|
|
|
|
public blocks: Blocks;
|
|
|
|
public caret: Caret;
|
|
|
|
public events: Events;
|
|
|
|
public listeners: Listeners;
|
|
|
|
public sanitizer: Sanitizer;
|
|
|
|
public saver: Saver;
|
|
|
|
public selection: Selection;
|
|
|
|
public styles: Styles;
|
|
|
|
public toolbar: Toolbar;
|
2019-04-29 14:52:54 +02:00
|
|
|
public inlineToolbar: InlineToolbar;
|
2018-11-23 17:11:50 +01:00
|
|
|
constructor(configuration?: EditorConfig|string);
|
|
|
|
|
2019-06-12 19:38:16 +02:00
|
|
|
/**
|
|
|
|
* API shorthands
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @see Saver.save
|
|
|
|
*/
|
2019-11-30 21:42:39 +01:00
|
|
|
public save(): Promise<OutputData>;
|
2019-06-12 19:38:16 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @see Blocks.clear
|
|
|
|
*/
|
2019-11-30 21:42:39 +01:00
|
|
|
public clear(): void;
|
2019-06-12 19:38:16 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @see Blocks.render
|
|
|
|
*/
|
2019-11-30 21:42:39 +01:00
|
|
|
public render(data: OutputData): Promise<void>;
|
2019-06-12 19:38:16 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @see Caret.focus
|
|
|
|
*/
|
2019-11-30 21:42:39 +01:00
|
|
|
public focus(atEnd?: boolean): boolean;
|
2019-06-12 19:38:16 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @see Events.on
|
|
|
|
*/
|
2019-11-30 21:42:39 +01:00
|
|
|
public on(eventName: string, callback: (data?: any) => void): void;
|
2019-06-12 19:38:16 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @see Events.off
|
|
|
|
*/
|
2019-11-30 21:42:39 +01:00
|
|
|
public off(eventName: string, callback: (data?: any) => void): void;
|
2019-06-12 19:38:16 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @see Events.emit
|
|
|
|
*/
|
2019-11-30 21:42:39 +01:00
|
|
|
public emit(eventName: string, data: any): void;
|
2019-06-12 19:38:16 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroy Editor instance and related DOM elements
|
|
|
|
*/
|
2018-11-23 17:11:50 +01:00
|
|
|
public destroy(): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
export as namespace EditorJS;
|
|
|
|
export default EditorJS;
|