mirror of
https://github.com/codex-team/editor.js
synced 2024-05-07 00:46:45 +02:00
Add API shorthands types (#800)
This commit is contained in:
parent
b1b0e7b48b
commit
0b0fa35f8d
|
@ -3,10 +3,11 @@
|
|||
|
||||
### 2.14
|
||||
|
||||
- `Fix` *Config* — User config now has higher priority than internal settings
|
||||
- `New` — Ability to work with Block Actions and Inline Toolbar from the keyboard by Tab.
|
||||
- `Fix` — Fix error thrown by click on the empty editor after `blocks.clear()` method calling
|
||||
- `Fix` — Fix placeholder property appearance. Now you can assign it via `placeholder` property of EditorConfig.
|
||||
- `Fix` *Config* — User config now has higher priority than internal settings [#771](https://github.com/codex-team/editor.js/issues/771)
|
||||
- `New` — Ability to work with Block Actions and Inline Toolbar from the keyboard by Tab. [#705](https://github.com/codex-team/editor.js/issues/705)
|
||||
- `Fix` — Fix error thrown by click on the empty editor after `blocks.clear()` method calling [#761](https://github.com/codex-team/editor.js/issues/761)
|
||||
- `Fix` — Fix placeholder property appearance. Now you can assign it via `placeholder` property of EditorConfig. [#714](https://github.com/codex-team/editor.js/issues/714)
|
||||
- `Fix` — Add API shorthands to TS types [#788](https://github.com/codex-team/editor.js/issues/788)
|
||||
|
||||
### 2.13
|
||||
|
||||
|
|
43
types/index.d.ts
vendored
43
types/index.d.ts
vendored
|
@ -6,6 +6,7 @@
|
|||
|
||||
import {EditorConfig} from './configs';
|
||||
import {Blocks, Caret, Events, Listeners, Notifier, Sanitizer, Saver, Selection, Styles, Toolbar, InlineToolbar} from './api';
|
||||
import {OutputData} from "./data-formats/output-data";
|
||||
|
||||
/**
|
||||
* Interfaces used for development
|
||||
|
@ -74,6 +75,48 @@ declare class EditorJS {
|
|||
public inlineToolbar: InlineToolbar;
|
||||
constructor(configuration?: EditorConfig|string);
|
||||
|
||||
/**
|
||||
* API shorthands
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Saver.save
|
||||
*/
|
||||
save(): Promise<OutputData>;
|
||||
|
||||
/**
|
||||
* @see Blocks.clear
|
||||
*/
|
||||
clear(): void;
|
||||
|
||||
/**
|
||||
* @see Blocks.render
|
||||
*/
|
||||
render(data: OutputData): Promise<void>;
|
||||
|
||||
/**
|
||||
* @see Caret.focus
|
||||
*/
|
||||
focus(atEnd?: boolean): boolean;
|
||||
|
||||
/**
|
||||
* @see Events.on
|
||||
*/
|
||||
on(eventName: string, callback: (data?: any) => void): void;
|
||||
|
||||
/**
|
||||
* @see Events.off
|
||||
*/
|
||||
off(eventName: string, callback: (data?: any) => void): void;
|
||||
|
||||
/**
|
||||
* @see Events.emit
|
||||
*/
|
||||
emit(eventName: string, data: any): void;
|
||||
|
||||
/**
|
||||
* Destroy Editor instance and related DOM elements
|
||||
*/
|
||||
public destroy(): void;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue