@omnia/fx
Version:
Provide Omnia Fx typings and tooling for clientside Omnia development.
50 lines (49 loc) • 1.47 kB
TypeScript
/**
* Command class
* @class
* @param {{name:function, execute: function, undo: function,
* executeCallback: function, undoCallback: function}} actions - Command actions
* @param {Array} args - passing arguments on execute, undo
* @ignore
*/
declare class Command {
constructor(actions: any, args: any);
/**
* Execute action
* @param {Object.<string, Component>} compMap - Components injection
* @abstract
*/
execute(): void;
/**
* Undo action
* @param {Object.<string, Component>} compMap - Components injection
* @abstract
*/
undo(): void;
/**
* command for redo if undoData exists
* @returns {boolean} isRedo
*/
get isRedo(): number;
/**
* Set undoData action
* @param {Object} undoData - maked undo data
* @param {Object} cachedUndoDataForSilent - cached undo data
* @param {boolean} isSilent - is silent execution or not
* @returns {Object} cachedUndoDataForSilent
*/
setUndoData(undoData: any, cachedUndoDataForSilent: any, isSilent: any): any;
/**
* Attach execute callabck
* @param {function} callback - Callback after execution
* @returns {Command} this
*/
setExecuteCallback(callback: any): this;
/**
* Attach undo callback
* @param {function} callback - Callback after undo
* @returns {Command} this
*/
setUndoCallback(callback: any): this;
}
export default Command;