UNPKG

1.73 kBTypeScriptView Raw
1/// <reference types="node" />
2import { Observable } from 'rxjs';
3export * from './NodeProcess/types';
4export declare type IRunOptions = {
5 cwd?: string;
6 silent?: boolean;
7 env?: NodeJS.ProcessEnv;
8};
9export declare type IResult = {
10 ok: boolean;
11 code: number;
12 error?: Error;
13};
14export declare type IResultInfo = IResult & {
15 info: string[];
16 errors: string[];
17};
18export declare type ITask<T = any> = {
19 title: string;
20 task: () => Promise<T> | T;
21};
22export declare type ICommand = {
23 title: string;
24 cmd: string;
25};
26export declare type ICommandInfo = {
27 type: 'stdout' | 'stderr';
28 text: string;
29};
30export declare type ICommandPromise = Promise<IResultInfo> & IResultInfo & {
31 isComplete: boolean;
32 complete$: Observable<{}>;
33 output$: Observable<ICommandInfo>;
34 stdout$: Observable<string>;
35 stderr$: Observable<string>;
36 stdout: string[];
37 stderr: string[];
38 cwd: string;
39 kill(): void;
40};
41export declare type ILog = {
42 info: LogValue;
43 warn: LogValue;
44 error: LogValue;
45};
46export declare type LogValue = (...value: any) => void;
47export declare type ICommandListExecutionResponse = IResult & {
48 ok: boolean;
49 results: IListCommandResult[];
50 errors: ICommandErrors;
51 cwd: string;
52};
53export declare type IListCommandResult = {
54 ok: boolean;
55 index: number;
56 cmd: string;
57 data: IResultInfo;
58 stdout: string[];
59 stderr: string[];
60};
61export declare type ICommandErrors = ICommandError[] & {
62 log: (args: {
63 log?: ILog | null;
64 index?: number | number[];
65 header?: boolean;
66 }) => string;
67};
68export declare type ICommandError = {
69 index: number;
70 cmd: string;
71 errors: string[];
72};