UNPKG

@nornagon/electron-winstore-auto-launch

Version:

Configure your Electron to start automatically when the user logs in Edit

65 lines (64 loc) 1.9 kB
export declare enum StartupTaskState { disabled = 0, disabledByUser = 1, enabled = 2 } export interface StartupTask { state: StartupTaskState; taskId: String; requestEnableAsync(callback: (error: Error, result: StartupTaskState) => void): void; disable(): void; } export declare class WindowsStoreAutoLaunch { /** * Returns the windows.applicationModel namespace for this model. If the app is not * running inside an appx container, this will fail. * * @static * @param {(reason: string) => void} [reject] * @returns * @memberof WindowsStoreAutoLaunch */ private static getAppModel; /** * Returns all startupTasks for this package. * * @static * @returns {Promise<Array<StartupTask>>} * @memberof WindowsStoreAutoLaunch */ static getStartupTasks(): Promise<Array<StartupTask>>; /** * Returns the first found startupTask. * * @static * @returns {(Promise<StartupTask | null>)} * @memberof WindowsStoreAutoLaunch */ static getStartupTask(): Promise<StartupTask | null>; /** * Returns a StartupTaskState if a StartupTask is found - or null if * we could not find one. * * @static * @returns {(Promise<StartupTaskState | null>)} * @memberof WindowsStoreAutoLaunch */ static getStatus(): Promise<StartupTaskState | null>; /** * Takes the first startup task and attempts to disable it. * * @static * @returns {(Promise<boolean | null>)} * @memberof WindowsStoreAutoLaunch */ static disable(): Promise<boolean | null>; /** * Takes the first startup task and attempts to enable it. * * @static * @returns {(Promise<StartupTaskState | null>)} * @memberof WindowsStoreAutoLaunch */ static enable(): Promise<StartupTaskState | null>; }