meo-skia-canvas
    Preparing search index...

    Interface App

    The process-wide window manager: the event loop every Window runs on, and the frame clock that drives their frame events.

    🧪 Not in the HTML Canvas standard.

    interface App {
        eventLoop: EventLoopMode;
        fps: number;
        running: boolean;
        windows: Window[];
        launch(): Promise<undefined>;
        quit(): void;
    }

    Hierarchy

    • EventEmitter<{ idle: [{ target: App; type: "idle" }] }>
      • App
    Index
    eventLoop: EventLoopMode

    Which loop drives the windows -- see EventLoopMode. It can only be set before the loop starts; assigning afterwards throws.

    fps: number

    Target frames per second for every window, defaulting to 60. Values below 1 are ignored.

    running: boolean

    Whether App.launch has been called. It stays true once the loop has started, including after the last window closes, since App.eventLoop can no longer be changed either way.

    windows: Window[]

    Every window that is currently open, in the order they opened.

    • Start the event loop, resolving once the last window has closed.

      Opening a window schedules this on the next tick, so calling it is only necessary to hold the promise -- calling it twice returns the same one.

      Returns Promise<undefined>

    • Close every window and end the event loop.

      Returns void