Interface IObservableUndoableList<T>

An observable list that supports undo/redo.

interface IObservableUndoableList<T> {
    canRedo: boolean;
    canUndo: boolean;
    changed: ISignal<IObservableUndoableList<T>, IObservableList.IChangedArgs<T>>;
    isDisposed: boolean;
    length: number;
    type: "List";
    [iterator](): Iterator<T, any, undefined>;
    beginCompoundOperation(isUndoAble?): void;
    clear(): void;
    clearUndo(): void;
    dispose(): void;
    endCompoundOperation(): void;
    get(index): T;
    insert(index, value): void;
    insertAll(index, values): void;
    move(fromIndex, toIndex): void;
    push(value): number;
    pushAll(values): number;
    redo(): void;
    remove(index): undefined | T;
    removeRange(startIndex, endIndex): number;
    removeValue(value): number;
    set(index, value): void;
    undo(): void;
}

Type Parameters

  • T

Hierarchy (view full)

Implemented by

Properties

canRedo: boolean

Whether the object can redo changes.

canUndo: boolean

Whether the object can undo changes.

A signal emitted when the list has changed.

isDisposed: boolean

Test whether the object has been disposed.

Notes

This property is always safe to access.

length: number

The length of the list.

Notes

This is a read-only property.

type: "List"

The type of this object.

Methods

  • Begin a compound operation.

    Parameters

    • Optional isUndoAble: boolean

      Whether the operation is undoable. The default is false.

    Returns void

  • Dispose of the resources held by the object.

    Notes

    If the object's dispose method is called more than once, all calls made after the first will be a no-op.

    Undefined Behavior

    It is undefined behavior to use any functionality of the object after it has been disposed unless otherwise explicitly noted.

    Returns void