2019-07-06 21:52:34 +08:00
|
|
|
export const downloadRootDir: string;
|
|
|
|
export const packageVersion: string;
|
|
|
|
export const currentVersion: string;
|
|
|
|
export const isFirstTime: boolean;
|
|
|
|
export const isRolledBack: boolean;
|
|
|
|
|
|
|
|
export interface ExpiredResult {
|
|
|
|
expired: true;
|
|
|
|
downloadUrl: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface UpTodateResult {
|
|
|
|
upToDate: true;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface UpdateAvailableResult {
|
|
|
|
update: true;
|
|
|
|
name: string; // version name
|
|
|
|
hash: string;
|
|
|
|
description: string;
|
|
|
|
metaInfo: string;
|
|
|
|
pdiffUrl: string;
|
2020-07-28 23:15:42 +08:00
|
|
|
diffUrl?: string;
|
|
|
|
};
|
2019-07-06 21:52:34 +08:00
|
|
|
|
2020-07-28 23:15:42 +08:00
|
|
|
export type CheckResult =
|
|
|
|
| ExpiredResult
|
|
|
|
| UpTodateResult
|
|
|
|
| UpdateAvailableResult;
|
2019-07-06 22:26:50 +08:00
|
|
|
|
|
|
|
export function checkUpdate(appkey: string): Promise<CheckResult>;
|
2019-07-06 21:52:34 +08:00
|
|
|
|
2020-07-28 23:15:42 +08:00
|
|
|
export function downloadUpdate(
|
|
|
|
options: UpdateAvailableResult,
|
|
|
|
): Promise<undefined | string>;
|
2019-07-06 21:52:34 +08:00
|
|
|
|
|
|
|
export function switchVersion(hash: string): void;
|
|
|
|
|
|
|
|
export function switchVersionLater(hash: string): void;
|
|
|
|
|
|
|
|
export function markSuccess(): void;
|
2020-07-28 23:15:42 +08:00
|
|
|
|
|
|
|
export function setCustomEndpoints(
|
|
|
|
mainEndpoint: string,
|
|
|
|
backupEndpoints?: string[],
|
|
|
|
): void;
|