smartshell/dist/smartshell.wrap.d.ts

53 lines
1.7 KiB
TypeScript
Raw Permalink Normal View History

2017-03-10 19:14:40 +00:00
/// <reference types="node" />
import { ChildProcess } from 'child_process';
2017-03-11 12:46:08 +00:00
/**
* interface for ExecResult
*/
2017-03-10 19:14:40 +00:00
export interface IExecResult {
exitCode: number;
stdout: string;
}
2017-03-11 12:46:08 +00:00
/**
* interface for streaming ExecResult
*/
2017-03-10 19:14:40 +00:00
export interface IExecResultStreaming {
childProcess: ChildProcess;
finalPromise: Promise<IExecResult>;
}
/**
* executes a given command async
* @param commandStringArg
*/
2017-07-19 12:56:33 +00:00
export declare let exec: (commandStringArg: string, silentArg?: boolean, strictArg?: boolean) => Promise<IExecResult>;
2017-03-10 19:14:40 +00:00
/**
* executes a given command async and silent
* @param commandStringArg
*/
export declare let execSilent: (commandStringArg: string) => Promise<IExecResult>;
2017-07-19 12:56:33 +00:00
/**
* executes strict, meaning it rejects the promise if something happens
*/
export declare let execStrict: (commandStringArg: string) => Promise<IExecResult>;
2017-03-10 19:14:40 +00:00
/**
* executes a command and allws you to stream output
*/
2017-06-27 09:18:37 +00:00
export declare let execStreaming: (commandStringArg: string, silentArg?: boolean) => {
childProcess: ChildProcess;
finalPromise: Promise<IExecResult>;
};
export declare let execStreamingSilent: (commandStringArg: string) => {
2017-03-10 19:14:40 +00:00
childProcess: ChildProcess;
finalPromise: Promise<IExecResult>;
};
2017-06-22 16:17:45 +00:00
/**
* executes a command and returns promise that will be fullfilled once an putput line matches RegexArg
* @param commandStringArg
* @param regexArg
*/
2017-06-27 09:18:37 +00:00
export declare let execAndWaitForLine: (commandStringArg: string, regexArg: RegExp, silentArg?: boolean) => Promise<{}>;
export declare let execAndWaitForLineSilent: (commandStringArg: string, regexArg: RegExp) => void;
2017-03-11 12:46:08 +00:00
/**
* get a path
*/
export declare let which: (cmd: string) => Promise<string>;