balena-cli
Version:
The official balena Command Line Interface
79 lines (78 loc) • 3.41 kB
TypeScript
import type { InitializeEmitter, OperationState } from 'balena-device-init';
import type * as BalenaSdk from 'balena-sdk';
import type { Application, Pine } from 'balena-sdk';
export declare function getGroupDefaults(group: {
options: Array<{
name: string;
default: string | number;
}>;
}): {
[name: string]: string | number | undefined;
};
export declare function stateToString(state: OperationState): string;
export declare function sudo(command: string[], { stderr, msg, isCLIcmd, }?: {
stderr?: NodeJS.WritableStream;
msg?: string;
isCLIcmd?: boolean;
}): Promise<void>;
export declare function runCommand<T>(commandArgs: string[]): Promise<T>;
export declare function getManifest(image: string, deviceType: string): Promise<BalenaSdk.DeviceTypeJson.DeviceType>;
export declare const areDeviceTypesCompatible: (appDeviceTypeSlug: string, osDeviceTypeSlug: string) => Promise<boolean>;
export declare function osProgressHandler(step: InitializeEmitter): Promise<void>;
declare const appWithArchOptions: {
readonly $expand: {
readonly application_type: {
readonly $select: readonly ["name", "slug", "supports_multicontainer"];
};
readonly is_for__device_type: {
readonly $select: "slug";
readonly $expand: {
readonly is_of__cpu_architecture: {
readonly $select: "slug";
};
};
};
};
};
export interface AppWithArch extends NonNullable<Pine.OptionsToResponse<Application['Read'], typeof appWithArchOptions, string>> {
arch: string;
}
export declare function getAppWithArch(applicationName: string): Promise<AppWithArch>;
export declare const delay: typeof import("timers/promises").setTimeout;
export declare function retry<T>({ func, maxAttempts, label, initialDelayMs, backoffScaler, maxSingleDelayMs, }: {
func: () => T;
maxAttempts: number;
label: string;
initialDelayMs?: number;
backoffScaler?: number;
maxSingleDelayMs?: number;
}): Promise<T>;
export declare function isWindowsComExeShell(): boolean | undefined;
export declare function shellEscape(args: string[], detectShell?: boolean): string[];
export interface ProxyConfig {
host: string;
port: string;
username?: string;
password?: string;
proxyAuth?: string;
}
export declare function getProxyConfig(): ProxyConfig | undefined;
export declare const expandForAppName: {
readonly $expand: {
readonly belongs_to__application: {
readonly $select: readonly ["app_name", "slug"];
};
readonly is_of__device_type: {
readonly $select: "slug";
};
readonly is_running__release: {
readonly $select: "commit";
};
};
};
export declare function addSIGINTHandler(sigintHandler: () => void, once?: boolean): void;
export declare function awaitInterruptibleTask<T extends (...args: any[]) => Promise<any>>(task: T, ...theArgs: Parameters<T>): Promise<ReturnType<T>>;
export declare function pickAndRename<T extends Dictionary<any>>(obj: T, fields: string[]): Dictionary<any>;
export declare const defaultValues: <T, U>(obj: Record<string, T | U | undefined>, defaultValue: U) => Record<string, Exclude<T, undefined | null> | U>;
export declare const pick: <T extends object, U extends keyof T>(obj: T, keys: U[]) => Pick<T, U>;
export {};