BaseUpdater.d.ts 1.1 KB

123456789101112131415161718192021
  1. import { UpdateInfo, AllPublishOptions, DownloadOptions } from "builder-util-runtime";
  2. import { AppUpdater } from "./AppUpdater";
  3. import { ResolvedUpdateFileInfo } from "./main";
  4. export declare abstract class BaseUpdater extends AppUpdater {
  5. protected quitAndInstallCalled: boolean;
  6. private quitHandlerAdded;
  7. protected constructor(options?: AllPublishOptions | null, app?: any);
  8. quitAndInstall(isSilent?: boolean, isForceRunAfter?: boolean): Promise<void>;
  9. protected executeDownload(taskOptions: DownloadExecutorTask): Promise<Array<string>>;
  10. protected abstract doInstall(installerPath: string, isSilent: boolean, isRunAfter: boolean): boolean;
  11. protected install(isSilent: boolean, isRunAfter: boolean): Promise<boolean>;
  12. protected addQuitHandler(): void;
  13. }
  14. export interface DownloadExecutorTask {
  15. readonly fileExtension: string;
  16. readonly downloadOptions: DownloadOptions;
  17. readonly fileInfo: ResolvedUpdateFileInfo;
  18. readonly updateInfo: UpdateInfo;
  19. readonly task: (destinationFile: string, packageFile: string | null, removeTempDirIfAny: () => Promise<any>) => Promise<any>;
  20. }