am-editor11212/docs/plugin/plugin-undo.md

788 B

@aomao/plugin-undo

Undo history plugin

Installation

$ yarn add @aomao/plugin-undo

Add to engine

import Engine, {EngineInterface} from'@aomao/engine';
import Undo from'@aomao/plugin-undo';

new Engine(...,{ plugins:[Undo] })

Optional

hot key

The default shortcut key is mod+z shift+mod+z

//hot key
hotkey?: string | Array<string>;
//Use configuration
new Engine(...,{
     config:{
         "undo":{
             //Modify shortcut keys
             hotkey: "shortcut key"
         }
     }
  })

Command

//Use command to execute the plug-in and pass in the required parameters
engine.command.execute('undo');
//Use command to execute query current status, return boolean | undefined
engine.command.queryState('undo');