UNPKG

2.09 kBTypeScriptView Raw
1import { ElectronDownloadCacheMode, ElectronGenericArtifactDetails, ElectronPlatformArtifactDetailsWithDefaults } from './types';
2export declare function mkdtemp(parentDirectory?: string): Promise<string>;
3export declare enum TempDirCleanUpMode {
4 CLEAN = 0,
5 ORPHAN = 1
6}
7export declare function withTempDirectoryIn<T>(parentDirectory: string | undefined, fn: (directory: string) => Promise<T>, cleanUp: TempDirCleanUpMode): Promise<T>;
8export declare function withTempDirectory<T>(fn: (directory: string) => Promise<T>, cleanUp: TempDirCleanUpMode): Promise<T>;
9export declare function normalizeVersion(version: string): string;
10/**
11 * Runs the `uname` command and returns the trimmed output.
12 */
13export declare function uname(): string;
14/**
15 * Generates an architecture name that would be used in an Electron or Node.js
16 * download file name.
17 */
18export declare function getNodeArch(arch: string): string;
19/**
20 * Generates an architecture name that would be used in an Electron or Node.js
21 * download file name from the `process` module information.
22 *
23 * @category Utility
24 */
25export declare function getHostArch(): string;
26export declare function ensureIsTruthyString<T, K extends keyof T>(obj: T, key: K): void;
27export declare function isOfficialLinuxIA32Download(platform: string, arch: string, version: string, mirrorOptions?: object): boolean;
28/**
29 * Find the value of a environment variable which may or may not have the
30 * prefix, in a case-insensitive manner.
31 */
32export declare function getEnv(prefix?: string): (name: string) => string | undefined;
33export declare function setEnv(key: string, value: string | undefined): void;
34export declare function effectiveCacheMode(artifactDetails: ElectronPlatformArtifactDetailsWithDefaults | ElectronGenericArtifactDetails): ElectronDownloadCacheMode;
35export declare function shouldTryReadCache(cacheMode: ElectronDownloadCacheMode): boolean;
36export declare function shouldWriteCache(cacheMode: ElectronDownloadCacheMode): boolean;
37export declare function doesCallerOwnTemporaryOutput(cacheMode: ElectronDownloadCacheMode): boolean;