import { AboutPanelOptionsOptions } from "@todesktop/client-electron-types"; /** * @public */ export interface LaunchSettings { /** * When `true`, the app will launch automatically on user login. */ willLaunchAtStartup: boolean; } /** * @public */ export interface FocusOptions { /** * * Make the receiver the active app even if another app is currently active. * * @platform darwin */ steal: boolean; } /** * Options for getLoginItemSettings. * @public */ export interface LoginItemSettingsOptions { /** * Can be one of mainAppService, agentService, daemonService, or loginItemService. * Defaults to mainAppService. Only available on macOS 13 and up. * @platform darwin */ type?: "mainAppService" | "agentService" | "daemonService" | "loginItemService"; /** * The name of the service. Required if type is non-default. * Only available on macOS 13 and up. * @platform darwin */ serviceName?: string; /** * The executable path to compare against. Defaults to process.execPath. * @platform win32 */ path?: string; /** * The command-line arguments to compare against. Defaults to an empty array. * @platform win32 */ args?: string[]; } /** * @see https://www.electronjs.org/docs/api/desktop-capturer#desktopcapturergetsourcesoptions * @public */ export declare type DesktopCapturerOptions = { /** * */ types: string[]; thumbnailSize?: { width: number; height: number; }; fetchWindowIcons?: boolean; }; /** * @see https://www.electronjs.org/docs/api/structures/desktop-capturer-source * @public */ export declare type CaptureSource = { appIcon: null | string; display_id: string; id: string; name: string; thumbnail: string; }; /** * An interface for manipulating and querying app-wide preferences. * * @public */ /** * The current version of this app. * @public */ export declare const getVersion: () => string; /** * Create a new window. * The created window will automatically load the configured app URL. * @public */ export declare function createNewWindow(): Promise; /** * Set the about panel options. * * @param options - Desired about panel options. * @public */ export declare function setAboutPanelOptions(options: AboutPanelOptionsOptions): Promise; /** * Get the app's current launch settings. Seee {@link LaunchSettings}. * @public */ export declare function getLaunchSettings(): Promise; /** * Sets the app's launch settings. See {@link LaunchSettings}. * * @param settings - Desired launch settings for this app. * @public */ export declare function setLaunchSettings(settings: LaunchSettings): Promise; /** * @returns A list of URL patterns that this app is currently handling. * @public */ export declare function getInternalURLs(): Promise; /** * Update what URLs are routed to this app. URLs that are not listed will be routed to the default browser. * This will over-ride any previously set internal URLs. * * * @param urlRegex - A regular expression string representing URLs for this app to handle. Example: '.*(google\.com).*'. * @public */ export declare function setInternalURLs(urlRegex: string): Promise; /** * Hide all windows associated with the current app. * @public */ export declare function hide(): Promise; /** * Show all windows associated with the current app. * @public */ export declare function show(): Promise; /** * Show all windows associated with the current app and set focus on the * last opened window. * @public */ export declare function focus(options?: FocusOptions): Promise; /** * Sets a numeric badge on the app icon in the user's task bar/dock. * * @param count - An integer specifying the badge to set. A value of `0` will * remove the badge. * @public */ export declare function setBadgeCount(count: number): Promise; /** * @returns The current number set as the app's badge. * @public */ export declare function getBadgeCount(): Promise; /** * Get the capture sources available on the user's machine. * @public */ export declare function getCaptureSources(options: DesktopCapturerOptions): Promise; /** * Try to close all windows and quit the app. * * This method guarantees that all `beforeunload` and `unload` event handlers are * correctly executed. It is possible that a window cancels the quitting by * returning `false` in the `beforeunload` event handler. * @public */ export declare function quit(): Promise; /** * @public */ export declare const on: (event: "*" | "openProtocolURL", callback: (eventName: string, event: { url: string; originalUrl: string; preventDefault: () => void; }) => Promise<() => Promise>) => Promise<() => Promise>; /** * Executes a given function just once for the entire application. * * @param id - Unique identifier for the target function to be executed. * @param callback - Target function to be executed. * @returns The value that the target function returns. * @public */ export declare function once(id: string, callback: (reset: () => void) => T): Promise; /** * Returns login item settings for the current app. * * @param options - Options for getting login item settings. * @returns Login item settings for the app. * @public */ export declare function getLoginItemSettings(options?: LoginItemSettingsOptions): Promise; /** * Returns an array of ProcessMetric objects that correspond to memory and CPU usage * statistics of all the processes associated with the app. * * @returns Array of ProcessMetric objects with memory and CPU usage statistics. * @public */ export declare function getAppMetrics(): Promise;