mirror of
https://github.com/codex-team/editor.js
synced 2024-06-17 13:15:20 +02:00
35 lines
596 B
TypeScript
35 lines
596 B
TypeScript
|
import Module from '../../__module';
|
||
|
import {Toolbar} from '../../../../types/api';
|
||
|
|
||
|
/**
|
||
|
* @class ToolbarAPI
|
||
|
* provides with methods working with Toolbar
|
||
|
*/
|
||
|
export default class ToolbarAPI extends Module {
|
||
|
/**
|
||
|
* Available methods
|
||
|
* @return {Toolbar}
|
||
|
*/
|
||
|
get methods(): Toolbar {
|
||
|
return {
|
||
|
close: () => this.close(),
|
||
|
open: () => this.open(),
|
||
|
};
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Open toolbar
|
||
|
*/
|
||
|
public open(): void {
|
||
|
this.Editor.Toolbar.open();
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Close toolbar and all included elements
|
||
|
*/
|
||
|
public close(): void {
|
||
|
this.Editor.Toolbar.close();
|
||
|
}
|
||
|
|
||
|
}
|