UNPKG

2.98 kBTypeScriptView Raw
1/// <reference types="node" />
2import { ChildProcess, ExecFileOptions, SpawnOptions } from "child_process";
3import _debug from "debug";
4export { safeStringifyJson } from "builder-util-runtime";
5export { TmpDir } from "temp-file";
6export { log, debug } from "./log";
7export { Arch, getArchCliNames, toLinuxArchString, getArchSuffix, ArchType, archFromString, defaultArchFromString } from "./arch";
8export { AsyncTaskManager } from "./asyncTaskManager";
9export { DebugLogger } from "./DebugLogger";
10export { copyFile, exists } from "./fs";
11export { asArray } from "builder-util-runtime";
12export { deepAssign } from "./deepAssign";
13export { getPath7za, getPath7x } from "./7za";
14export declare const debug7z: _debug.Debugger;
15export declare function serializeToYaml(object: any, skipInvalid?: boolean, noRefs?: boolean): string;
16export declare function removePassword(input: string): string;
17export declare function exec(file: string, args?: Array<string> | null, options?: ExecFileOptions, isLogOutIfDebug?: boolean): Promise<string>;
18export interface ExtraSpawnOptions {
19 isPipeInput?: boolean;
20}
21export declare function doSpawn(command: string, args: Array<string>, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): ChildProcess;
22export declare function spawnAndWrite(command: string, args: Array<string>, data: string, options?: SpawnOptions): Promise<any>;
23export declare function spawn(command: string, args?: Array<string> | null, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise<any>;
24export declare class ExecError extends Error {
25 readonly exitCode: number;
26 alreadyLogged: boolean;
27 constructor(command: string, exitCode: number, out: string, errorOut: string, code?: string);
28}
29type Nullish = null | undefined;
30export declare function use<T, R>(value: T | Nullish, task: (value: T) => R): R | null;
31export declare function isEmptyOrSpaces(s: string | null | undefined): s is "" | null | undefined;
32export declare function isTokenCharValid(token: string): boolean;
33export declare function addValue<K, T>(map: Map<K, Array<T>>, key: K, value: T): void;
34export declare function replaceDefault(inList: Array<string> | null | undefined, defaultList: Array<string>): Array<string>;
35export declare function getPlatformIconFileName(value: string | null | undefined, isMac: boolean): string | null | undefined;
36export declare function isPullRequest(): boolean | "" | undefined;
37export declare function isEnvTrue(value: string | null | undefined): boolean;
38export declare class InvalidConfigurationError extends Error {
39 constructor(message: string, code?: string);
40}
41export declare function executeAppBuilder(args: Array<string>, childProcessConsumer?: (childProcess: ChildProcess) => void, extraOptions?: SpawnOptions, maxRetries?: number): Promise<string>;
42export declare function retry<T>(task: () => Promise<T>, retryCount: number, interval: number, backoff?: number, attempt?: number, shouldRetry?: (e: any) => boolean): Promise<T>;