UNPKG

1.41 kBTypeScriptView Raw
1/// <reference types="node" />
2import { AllPublishOptions } from "builder-util-runtime";
3import { StdioOptions } from "child_process";
4import { AppAdapter } from "./AppAdapter";
5import { AppUpdater, DownloadExecutorTask } from "./AppUpdater";
6export declare abstract class BaseUpdater extends AppUpdater {
7 protected quitAndInstallCalled: boolean;
8 private quitHandlerAdded;
9 protected constructor(options?: AllPublishOptions | null, app?: AppAdapter);
10 quitAndInstall(isSilent?: boolean, isForceRunAfter?: boolean): void;
11 protected executeDownload(taskOptions: DownloadExecutorTask): Promise<Array<string>>;
12 protected abstract doInstall(options: InstallOptions): boolean;
13 install(isSilent?: boolean, isForceRunAfter?: boolean): boolean;
14 protected addQuitHandler(): void;
15 protected wrapSudo(): string;
16 protected spawnSyncLog(cmd: string, args?: string[], env?: {}): string;
17 /**
18 * This handles both node 8 and node 10 way of emitting error when spawning a process
19 * - node 8: Throws the error
20 * - node 10: Emit the error(Need to listen with on)
21 */
22 protected spawnLog(cmd: string, args?: string[], env?: any, stdio?: StdioOptions): Promise<boolean>;
23}
24export interface InstallOptions {
25 readonly installerPath: string;
26 readonly isSilent: boolean;
27 readonly isForceRunAfter: boolean;
28 readonly isAdminRightsRequired: boolean;
29}