Interface for the history service (reference "mapnavigation.History").

interface History {
    canRedo: boolean;
    canUndo: boolean;
    emit<Name extends "update">(
        eventName: Name,
        ...value: Params<{ update: void }[Name]>,
    ): void;
    on<Name extends "update">(
        eventName: Name,
        callback: EventCallback<{ update: void }[Name]>,
    ): EventHandle;
    on(eventName: "*", callback: EventCallback<void>): EventHandle;
    on(
        eventName: string | string[],
        callback: EventCallback<unknown>,
    ): EventHandle;
    redo(): void;
    undo(): void;
}

Hierarchy (View Summary)

Properties

Methods

Properties

canRedo: boolean

True if redo() can be called at least once

canUndo: boolean

True if undo() can be called at least once.

Methods

  • Emits an event. All associated event listeners registered for the given event name will be invoked asynchronously.

    Type Parameters

    • Name extends "update"

    Parameters

    • eventName: Name

      The name of the event.

    • ...value: Params<{ update: void }[Name]>

      The event value. Passed to all event listeners. Note: no value can be passed if the event type is void.

    Returns void

  • Register event listener for specific events.

    Type Parameters

    • Name extends "update"

    Parameters

    • eventName: Name

      name of the event

    • callback: EventCallback<{ update: void }[Name]>

      the event handler callback will be invoked when the event has been emitted

    Returns EventHandle

    a handle to unregister from the event

  • Register event listener for any event.

    Parameters

    • eventName: "*"

      must be "*" for this overload

    • callback: EventCallback<void>

      the event handler callback will be invoked when any event has been emitted

    Returns EventHandle

    a handle to unregister from the events

  • Register event listener for the events listed in eventName. Comma separated event names are possible, for example "eventA,eventB".

    Parameters

    • eventName: string | string[]

      the event name or list of names

    • callback: EventCallback<unknown>

      the event handler callback

    Returns EventHandle

    a handle to unregister from the event(s)

  • Advances to the next state, or does nothing if there is no such state.

    Returns void

  • Moves back to the last state, or does nothing if there is no such state.

    Returns void