mirror of
https://github.com/codex-team/editor.js
synced 2024-06-10 01:42:29 +02:00
4c0d806a12
Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
35 lines
625 B
TypeScript
35 lines
625 B
TypeScript
import Module from '../../__module';
|
|
import { Toolbar } from '../../../../types/api';
|
|
|
|
/**
|
|
* @class ToolbarAPI
|
|
* Provides methods for working with the Toolbar
|
|
*/
|
|
export default class ToolbarAPI extends Module {
|
|
/**
|
|
* Available methods
|
|
*
|
|
* @returns {Toolbar}
|
|
*/
|
|
public get methods(): Toolbar {
|
|
return {
|
|
close: (): void => this.close(),
|
|
open: (): void => this.open(),
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Open toolbar
|
|
*/
|
|
public open(): void {
|
|
this.Editor.Toolbar.open();
|
|
}
|
|
|
|
/**
|
|
* Close toolbar and all included elements
|
|
*/
|
|
public close(): void {
|
|
this.Editor.Toolbar.close();
|
|
}
|
|
}
|