A class that tracks image widgets.

interface IImageTracker {
    currentChanged: ISignal<IImageTracker, null | IDocumentWidget<ImageViewer, DocumentRegistry.IModel>>;
    currentWidget: null | IDocumentWidget<ImageViewer, DocumentRegistry.IModel>;
    isDisposed: boolean;
    restored: Promise<void>;
    size: number;
    widgetAdded: ISignal<IImageTracker, IDocumentWidget<ImageViewer, DocumentRegistry.IModel>>;
    widgetUpdated: ISignal<IImageTracker, IDocumentWidget<ImageViewer, DocumentRegistry.IModel>>;
    dispose(): void;
    filter(fn): IDocumentWidget<ImageViewer, DocumentRegistry.IModel>[];
    find(fn): undefined | IDocumentWidget<ImageViewer, DocumentRegistry.IModel>;
    forEach(fn): void;
    has(obj): boolean;
    inject(obj): void;

Hierarchy (view full)


A signal emitted when the current instance changes.


If the last instance being tracked is disposed, null will be emitted.

The current widget is the most recently focused or added widget.


It is the most recently focused widget, or the most recently added widget if no widget has taken focus.

isDisposed: boolean

Test whether the object has been disposed.


This property is always safe to access.

restored: Promise<void>

A promise that is resolved when the widget tracker has been restored from a serialized state.


Most client code will not need to use this, since they can wait for the whole application to restore. However, if an extension wants to perform actions during the application restoration, but after the restoration of another widget tracker, they can use this promise.

size: number

The number of instances held by the tracker.

A signal emitted when a widget is added.

A signal emitted when a widget is updated.


  • Dispose of the resources held by the object.


    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

  • Check if this tracker has the specified instance.


    • obj: Widget

      The object whose existence is being checked.

    Returns boolean