[]
        
(Showing Draft Content)

UndoCommandSupport

Document Solutions Image Viewer - v8.0.0 / UndoCommandSupport

Interface: UndoCommandSupport

Interface for undo commands.

Example

// The UndoCommandSupport interface implementation example.
function CustomUndoCommand() { }
CustomUndoCommand.prototype = {
    name: "CustomUndoCommand",
    execute: function(viewer) {
        return new Promise((resolve)=>{
            // Put your action code here
            resolve();
        })
    },
    undo: function(viewer) {
        return new Promise((resolve)=>{
            // Put your undo action here
            resolve();
        })
    }
};

Implemented by

Table of contents

Properties

Methods

Properties

name

Optional name: string

Optional. The unique name of the command. Used by the undo.skipCommands option setting.

Methods

execute

execute(viewer): Promise<void>

Action implementation.

Parameters

Name Type
viewer GcImageViewer

Returns

Promise<void>


undo

undo(viewer): Promise<void>

Undo action implementation.

Parameters

Name Type
viewer GcImageViewer

Returns

Promise<void>