mirror of
https://github.com/wassname/talk.git
synced 2026-07-25 13:30:59 +08:00
18 lines
435 B
JavaScript
18 lines
435 B
JavaScript
/**
|
|
* An instance of API is passed to all the buttons to
|
|
* interact with RTE, which servers as a clean abstraction.
|
|
*/
|
|
export default class API {
|
|
constructor(container, onChange, canUndo, canRedo, undo, redo) {
|
|
this.container = container;
|
|
this.broadcastChange = onChange;
|
|
this.canUndo = canUndo;
|
|
this.canRedo = canRedo;
|
|
this.undo = undo;
|
|
this.redo = redo;
|
|
}
|
|
focus() {
|
|
this.container.focus();
|
|
}
|
|
}
|