///
import { SpawnSyncOptions } from 'child_process';
import Spinner from './spinner';
export interface ExecutionState {
spinner: Spinner;
verbose: boolean;
}
/**
* If the input path is a relative path, it resolves the path from
* current working directory.
*
* @returns an absolute path
*/
export declare function resolvePath(rootPath: string): string;
/**
* The function is designated to valid if a path from user input exists.
* Note: this function only displays messages in console.
* It does not log any info into file.
*
* @param filePath a relative path will be resolved relative to the current working directory
* @param errorMessage error message to display before exit
*/
export declare function exitIfNonExistPath(filePath: string, errorMessage: string): void;
export declare function exitIfPathExists(filePath: string, errorMessage: string): void;
export declare function exitIfAnyMissingPath(paths: string[], errorMessage: string): void;
interface ExecutionError {
status: number | null;
stderr: string;
stdout: string;
error?: Error;
}
/**
* Invoking a global command with child_process.spawnSync
*/
export declare function executeCmd(cmd: string, params?: readonly string[], options?: SpawnSyncOptions): Result;
interface SuccessResult {
state: 'success';
data?: D;
}
interface ErrorResult {
state: 'error';
error: E;
}
export type Result = SuccessResult | ErrorResult;
export declare function isSuccessResult(result: Result): result is SuccessResult;
export declare function isErrorResult(result: Result): result is ErrorResult;
export {};