index.d.ts 579 B

1234567891011121314151617181920212223242526
  1. import { SpawnOptions } from 'child_process';
  2. import { Writable } from 'stream';
  3. declare namespace RunScript {
  4. export interface Options extends SpawnOptions {
  5. stdout?: Writable;
  6. stderr?: Writable;
  7. }
  8. export interface ExtraOptions {
  9. timeout?: number;
  10. }
  11. export interface Stdio {
  12. stdout: Buffer | null;
  13. stderr: Buffer | null;
  14. }
  15. export interface StdError extends Error {
  16. stdio: Stdio;
  17. }
  18. }
  19. declare function RunScript(cmd: string, opts?: RunScript.Options, extraOpts?: RunScript.ExtraOptions): Promise<RunScript.Stdio>;
  20. export = RunScript;