UNPKG

2.44 kBTypeScriptView Raw
1import { CancellationToken, PackageFileInfo, ProgressInfo, UpdateFileInfo, UpdateInfo } from "builder-util-runtime";
2import { EventEmitter } from "events";
3import { URL } from "url";
4import { AppUpdater } from "./AppUpdater";
5import { LoginCallback } from "./electronHttpExecutor";
6export { BaseUpdater } from "./BaseUpdater";
7export { AppUpdater, NoOpLogger } from "./AppUpdater";
8export { CancellationToken, PackageFileInfo, ProgressInfo, UpdateFileInfo, UpdateInfo };
9export { Provider } from "./providers/Provider";
10export { AppImageUpdater } from "./AppImageUpdater";
11export { DebUpdater } from "./DebUpdater";
12export { RpmUpdater } from "./RpmUpdater";
13export { MacUpdater } from "./MacUpdater";
14export { NsisUpdater } from "./NsisUpdater";
15export declare const autoUpdater: AppUpdater;
16export interface ResolvedUpdateFileInfo {
17 readonly url: URL;
18 readonly info: UpdateFileInfo;
19 packageInfo?: PackageFileInfo;
20}
21export interface UpdateCheckResult {
22 readonly updateInfo: UpdateInfo;
23 readonly downloadPromise?: Promise<Array<string>> | null;
24 readonly cancellationToken?: CancellationToken;
25 /** @deprecated */
26 readonly versionInfo: UpdateInfo;
27}
28export type UpdaterEvents = "login" | "checking-for-update" | "update-available" | "update-not-available" | "update-cancelled" | "download-progress" | "update-downloaded" | "error";
29export declare const DOWNLOAD_PROGRESS = "download-progress";
30export declare const UPDATE_DOWNLOADED = "update-downloaded";
31export type LoginHandler = (authInfo: any, callback: LoginCallback) => void;
32export declare class UpdaterSignal {
33 private emitter;
34 constructor(emitter: EventEmitter);
35 /**
36 * Emitted when an authenticating proxy is [asking for user credentials](https://github.com/electron/electron/blob/master/docs/api/client-request.md#event-login).
37 */
38 login(handler: LoginHandler): void;
39 progress(handler: (info: ProgressInfo) => void): void;
40 updateDownloaded(handler: (info: UpdateDownloadedEvent) => void): void;
41 updateCancelled(handler: (info: UpdateInfo) => void): void;
42}
43export interface UpdateDownloadedEvent extends UpdateInfo {
44 downloadedFile: string;
45}
46export interface Logger {
47 info(message?: any): void;
48 warn(message?: any): void;
49 error(message?: any): void;
50 debug?(message: string): void;
51}
52export type verifyUpdateCodeSignature = (publisherName: string[], path: string) => Promise<string | null>;
53
\No newline at end of file