index.d.ts 959 B

123456789101112131415161718192021222324252627282930313233
  1. /// <reference types="node" />
  2. import { StdioOptions } from "child_process";
  3. import { Logger } from "./common";
  4. interface IOptions {
  5. cwd?: string;
  6. async?: boolean;
  7. stdio?: StdioOptions;
  8. env?: NodeJS.ProcessEnv;
  9. timeout?: number;
  10. }
  11. interface ICliOptions {
  12. [key: string]: string;
  13. }
  14. interface ITaskContext {
  15. options?: ICliOptions;
  16. }
  17. interface ITaskFunction {
  18. (...args: any[]): any;
  19. help?: any;
  20. }
  21. export declare function run(command: string, options: IOptions & {
  22. async: true;
  23. }, logger?: Logger): Promise<string | null>;
  24. export declare function run(command: string, options?: IOptions & {
  25. async?: false | null;
  26. }, logger?: Logger): string | null;
  27. /**
  28. * @deprecated
  29. */
  30. export declare function option(thisObj: ITaskContext | null, name?: string): any;
  31. export declare function options(thisObj: ITaskContext | null): object;
  32. export declare function help(func: ITaskFunction, annotation?: string | any): void;
  33. export {};