From b4feae292d98f3c8a53bdbeac8494c2a2baf89b4 Mon Sep 17 00:00:00 2001 From: sunnylqm Date: Tue, 6 Oct 2020 23:40:51 +0800 Subject: [PATCH] Fix index.d.ts --- lib/index.d.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/index.d.ts b/lib/index.d.ts index 561e241..c78bfa2 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -5,15 +5,19 @@ export const isFirstTime: boolean; export const isRolledBack: boolean; export interface ExpiredResult { + upToDate?: false; expired: true; downloadUrl: string; } export interface UpTodateResult { + expired?: false; upToDate: true; } export interface UpdateAvailableResult { + expired?: false; + upToDate?: false; update: true; name: string; // version name hash: string; @@ -43,13 +47,13 @@ export function switchVersionLater(hash: string): void; export function markSuccess(): void; -export async function downloadAndInstallApk({ +export function downloadAndInstallApk({ url, onDownloadProgress, }: { url: string; onDownloadProgress?: (data: ProgressData) => void; -}): void; +}): Promise; /** * @param {string} main - The main api endpoint