tnp-core 18.0.45 → 18.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -90,7 +90,21 @@ export declare namespace Utils {
90
90
  export {};
91
91
  }
92
92
  export declare namespace UtilsProcess {
93
- interface ProcessStartOptions {
93
+ interface ResolvePromiseMsg {
94
+ /**
95
+ * until this string is in output of stdout
96
+ */
97
+ stdout?: string | string[];
98
+ /**
99
+ * until this string is in output of stderr
100
+ */
101
+ stderr?: string | string[];
102
+ /**
103
+ * by default only resolve when exit code is 0
104
+ */
105
+ resolveAfterAnyExitCode?: boolean;
106
+ }
107
+ export interface ProcessStartOptions {
94
108
  /**
95
109
  * by default is process.cwd();
96
110
  */
@@ -103,20 +117,7 @@ export declare namespace UtilsProcess {
103
117
  * Modify output line by line
104
118
  */
105
119
  outputLineReplace?: (outputLineStderOrStdout: string) => string;
106
- resolvePromiseMsg?: {
107
- /**
108
- * until this string is in output of stdout
109
- */
110
- stdout?: string | string[];
111
- /**
112
- * until this string is in output of stderr
113
- */
114
- stderr?: string | string[];
115
- /**
116
- * by default only resolve when exit code is 0
117
- */
118
- resolveAfterAnyExitCode?: boolean;
119
- };
120
+ resolvePromiseMsg?: ResolvePromiseMsg;
120
121
  /**
121
122
  * Prefix messages output from child_process
122
123
  */
@@ -141,18 +142,28 @@ export declare namespace UtilsProcess {
141
142
  * TODO IMPLEMENT
142
143
  * start async node process
143
144
  */
144
- function startAsync(command: string, options?: ProcessStartOptions): Promise<void>;
145
145
  /**
146
- * TODO IMPLEMENT
146
+ * This let you start child process and resolve promise when some
147
+ * condition is met. It is useful for example when you want to start
148
+ * process and wait until some output is in stdout or stderr.
147
149
  */
148
- function startSync(command: string, options?: ProcessStartOptions): void;
149
- const getGitBashPath: () => any;
150
+ export const startAsyncChildProcessCommandUntil: (command: string, options: {
151
+ /**
152
+ * tels when to resolve promise
153
+ */
154
+ untilOptions: ResolvePromiseMsg;
155
+ displayOutputInParentProcess?: boolean;
156
+ resolveAfterAnyExitCode?: boolean;
157
+ cwd?: string;
158
+ }) => Promise<void>;
159
+ export const getGitBashPath: () => any;
150
160
  /**
151
161
  * TODO IMPLEMENT
152
162
  * start async node process
153
163
  */
154
- const startInNewTerminalWindow: (command: string, options?: Pick<ProcessStartOptions, "cwd" | "hideOutput">) => any;
155
- const getBashOrShellName: () => "browser" | "cmd" | "powershell" | "gitbash" | "cygwin" | "unknown" | "bash" | "zsh" | "fish" | "sh";
164
+ export const startInNewTerminalWindow: (command: string, options?: Pick<ProcessStartOptions, "cwd" | "hideOutput">) => any;
165
+ export const getBashOrShellName: () => "browser" | "cmd" | "powershell" | "gitbash" | "cygwin" | "unknown" | "bash" | "zsh" | "fish" | "sh";
166
+ export {};
156
167
  }
157
168
  export declare namespace UtilsOs {
158
169
  /**