mirror of
https://github.com/codex-team/editor.js
synced 2024-06-29 02:40:23 +02:00
34 lines
652 B
TypeScript
34 lines
652 B
TypeScript
|
import Module from '../../__module';
|
||
|
import { InlineToolbar } from '../../../../types/api/inline-toolbar';
|
||
|
|
||
|
/**
|
||
|
* @class InlineToolbarAPI
|
||
|
* Provides methods for working with the Inline Toolbar
|
||
|
*/
|
||
|
export default class InlineToolbarAPI extends Module {
|
||
|
/**
|
||
|
* Available methods
|
||
|
* @return {InlineToolbar}
|
||
|
*/
|
||
|
get methods(): InlineToolbar {
|
||
|
return {
|
||
|
close: () => this.close(),
|
||
|
open: () => this.open(),
|
||
|
};
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Open Inline Toolbar
|
||
|
*/
|
||
|
public open(): void {
|
||
|
this.Editor.InlineToolbar.open();
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Close Inline Toolbar
|
||
|
*/
|
||
|
public close(): void {
|
||
|
this.Editor.InlineToolbar.close();
|
||
|
}
|
||
|
}
|