Skip to content

Commit

Permalink
Merge pull request #57 from stephenlautier/feature/typings
Browse files Browse the repository at this point in the history
feat(typings): added TypeScript typings
  • Loading branch information
timdp authored Mar 27, 2017
2 parents 6b4f764 + 039d570 commit db27cc5
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Execute a command cross-platform.
*
* @param {string} cmd command to execute e.g. `"npm"`
* @param {any[]} [args] command argument e.g. `["install", "-g", "git"]`
* @param {Partial<crossSpawnPromise.CrossSpawnOptions>} [options] additional options.
* @returns {Promise<Uint8Array>} a promise result with `stdout`
*/
declare function crossSpawnPromise(cmd: string, args?: any[], options?: Partial<crossSpawnPromise.CrossSpawnOptions>): Promise<Uint8Array>;

declare namespace crossSpawnPromise {

interface CrossSpawnOptions {
encoding: string;
stdio: string;
}

interface CrossSpawnError {
exitStatus: number;
message: string;
stack: string;
stderr: Uint8Array;
stdout: Uint8Array | null;
}

}

export = crossSpawnPromise;

0 comments on commit db27cc5

Please sign in to comment.