UNPKG

1.59 kBTypeScriptView Raw
1import { UpdateInfo } from "builder-util-runtime";
2import { Logger, ResolvedUpdateFileInfo } from "./main";
3/** @private **/
4export declare class DownloadedUpdateHelper {
5 readonly cacheDir: string;
6 private _file;
7 private _packageFile;
8 private versionInfo;
9 private fileInfo;
10 constructor(cacheDir: string);
11 private _downloadedFileInfo;
12 get downloadedFileInfo(): CachedUpdateInfo | null;
13 get file(): string | null;
14 get packageFile(): string | null;
15 get cacheDirForPendingUpdate(): string;
16 validateDownloadedPath(updateFile: string, updateInfo: UpdateInfo, fileInfo: ResolvedUpdateFileInfo, logger: Logger): Promise<string | null>;
17 setDownloadedFile(downloadedFile: string, packageFile: string | null, versionInfo: UpdateInfo, fileInfo: ResolvedUpdateFileInfo, updateFileName: string, isSaveCache: boolean): Promise<void>;
18 clear(): Promise<void>;
19 private cleanCacheDirForPendingUpdate;
20 /**
21 * Returns "update-info.json" which is created in the update cache directory's "pending" subfolder after the first update is downloaded. If the update file does not exist then the cache is cleared and recreated. If the update file exists then its properties are validated.
22 * @param fileInfo
23 * @param logger
24 */
25 private getValidCachedUpdateFile;
26 private getUpdateInfoFile;
27}
28interface CachedUpdateInfo {
29 fileName: string;
30 sha512: string;
31 readonly isAdminRightsRequired: boolean;
32}
33export declare function createTempUpdateFile(name: string, cacheDir: string, log: Logger): Promise<string>;
34export {};