mirror of
https://github.com/codex-team/editor.js
synced 2024-06-17 13:15:20 +02:00
34 lines
657 B
TypeScript
34 lines
657 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.tryToShow();
|
|
}
|
|
|
|
/**
|
|
* Close Inline Toolbar
|
|
*/
|
|
public close(): void {
|
|
this.Editor.InlineToolbar.close();
|
|
}
|
|
}
|