1. API
  2. newApp

API

Variables

Variable Description
on Subcribes to an event on the app object.
removeAllListeners Unsubscribes all listeners from the event name.

on

Subcribes to an event on the app object.

Signature:

        on: <E extends "quit" | "will-finish-launching" | "ready" | "window-all-closed" | "before-quit" | "will-quit" | "open-url" | "activate" | "did-become-active" | "continue-activity" | "will-continue-activity" | "continue-activity-error" | "activity-was-continued" | "update-activity-state" | "new-window-for-tab" | "browser-window-blur" | "browser-window-focus" | "browser-window-created" | "web-contents-created" | "gpu-info-update" | "gpu-process-crashed" | "renderer-process-crashed" | "render-process-gone" | "child-process-gone" | "accessibility-support-changed" | "session-created" | "second-instance" | "desktop-capturer-get-sources">(eventName: E, callback: NamespaceEvents<{
    "will-finish-launching": () => void;
    ready: (launchInfo: Record<string, unknown>) => void;
    "window-all-closed": () => void;
    "before-quit": () => void;
    "will-quit": () => void;
    quit: () => void;
    "open-url": (url: string) => void;
    activate: (hasVisibleWindows: boolean) => void;
    "did-become-active": () => void;
    "continue-activity": (type: string, userInfo: unknown, details: ContinueActivityDetails) => void;
    "will-continue-activity": () => void;
    "continue-activity-error": (type: string, error: string) => void;
    "activity-was-continued": (type: string, userInfo: unknown) => void;
    "update-activity-state": (type: string, userInfo: unknown) => void;
    "new-window-for-tab": () => void;
    "browser-window-blur": (window: Ref) => void;
    "browser-window-focus": (window: Ref) => void;
    "browser-window-created": (window: Ref) => void;
    "web-contents-created": (webContents: Ref) => void;
    "gpu-info-update": () => void;
    "gpu-process-crashed": (killed: boolean) => void;
    "renderer-process-crashed": (webContents: Ref, killed: boolean) => void;
    "render-process-gone": (webContents: Ref, details: RenderProcessGoneDetails) => void;
    "child-process-gone": (details: Details) => void;
    "accessibility-support-changed": (accessibilitySupportEnabled: boolean) => void;
    "session-created": (session: Ref) => void;
    "second-instance": (argv: string[], workingDirectory: string, additionalData: unknown) => void;
    "desktop-capturer-get-sources": () => void;
}>[E], { ref, preventDefault }?: {
    ref?: import("@todesktop/client-util").InstanceRefObject;
    preventDefault?: boolean;
}) => Promise<() => Promise<void>>

      

removeAllListeners

Unsubscribes all listeners from the event name.

Signature:

        removeAllListeners: <E extends "quit" | "will-finish-launching" | "ready" | "window-all-closed" | "before-quit" | "will-quit" | "open-url" | "activate" | "did-become-active" | "continue-activity" | "will-continue-activity" | "continue-activity-error" | "activity-was-continued" | "update-activity-state" | "new-window-for-tab" | "browser-window-blur" | "browser-window-focus" | "browser-window-created" | "web-contents-created" | "gpu-info-update" | "gpu-process-crashed" | "renderer-process-crashed" | "render-process-gone" | "child-process-gone" | "accessibility-support-changed" | "session-created" | "second-instance" | "desktop-capturer-get-sources">(eventName: E, { ref, }?: {
    ref?: import("@todesktop/client-util").InstanceRefObject;
}) => Promise<void>

      

Type Aliases

AppEvents

Signature:

        export declare type AppEvents = NamespaceEvents<{
    "will-finish-launching": () => void;
    ready: (launchInfo: Record<string, unknown>) => void;
    "window-all-closed": () => void;
    "before-quit": () => void;
    "will-quit": () => void;
    quit: () => void;
    "open-url": (url: string) => void;
    activate: (hasVisibleWindows: boolean) => void;
    "did-become-active": () => void;
    "continue-activity": (type: string, userInfo: unknown, details: ContinueActivityDetails) => void;
    "will-continue-activity": () => void;
    "continue-activity-error": (type: string, error: string) => void;
    "activity-was-continued": (type: string, userInfo: unknown) => void;
    "update-activity-state": (type: string, userInfo: unknown) => void;
    "new-window-for-tab": () => void;
    "browser-window-blur": (window: Ref) => void;
    "browser-window-focus": (window: Ref) => void;
    "browser-window-created": (window: Ref) => void;
    "web-contents-created": (webContents: Ref) => void;
    "gpu-info-update": () => void;
    "gpu-process-crashed": (killed: boolean) => void;
    "renderer-process-crashed": (webContents: Ref, killed: boolean) => void;
    "render-process-gone": (webContents: Ref, details: RenderProcessGoneDetails) => void;
    "child-process-gone": (details: Details) => void;
    "accessibility-support-changed": (accessibilitySupportEnabled: boolean) => void;
    "session-created": (session: Ref) => void;
    "second-instance": (argv: string[], workingDirectory: string, additionalData: unknown) => void;
    "desktop-capturer-get-sources": () => void;
}>;

      
Type Alias Description
AppEvents