tnp-core 18.0.43 → 18.0.44

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.
@@ -32,6 +32,9 @@ export declare class HelpersCore extends HelpersMessages {
32
32
  * @deprecated use UtilsOs.isRunningInLinuxGraphicEnvironment
33
33
  */
34
34
  isRunningInLinuxGraphicsCapableEnvironment(): boolean;
35
+ /**
36
+ * @deprecated use UtilsTerminal.clearConsole
37
+ */
35
38
  clearConsole(): void;
36
39
  /**
37
40
  * get electron browser ipc renderer
@@ -152,11 +155,10 @@ export declare class HelpersCore extends HelpersMessages {
152
155
  */
153
156
  unitlOutputContains(stdoutMsg: string | string[], stderMsg?: string | string[], timeout?: number, stdoutOutputContainsCallback?: () => any): any;
154
157
  };
155
- questionYesNo(message: string, callbackTrue?: () => any, callbackFalse?: () => any, defaultValue?: boolean,
156
158
  /**
157
- * in non interactive mode
159
+ * @deprecated use UtilsTerminal.confirm
158
160
  */
159
- mustAnswerQuestion?: boolean): Promise<any>;
161
+ questionYesNo(message: string, callbackTrue?: () => any, callbackFalse?: () => any, defaultValue?: boolean): Promise<any>;
160
162
  /**
161
163
  * Quick fix for object values
162
164
  * @deprecated
@@ -184,6 +184,27 @@ export declare namespace UtilsOs {
184
184
  const isRunningInWsl: () => boolean;
185
185
  const isRunningInDocker: () => boolean;
186
186
  const isRunningInLinuxGraphicsCapableEnvironment: () => boolean;
187
+ /**
188
+ * Check whether the current process is running in CLI mode.
189
+ */
190
+ const isRunningInCliMode: () => boolean;
191
+ /**
192
+ * Check whether the current process is running in mocha test.
193
+ */
194
+ const isRunningInMochaTest: () => boolean;
195
+ /**
196
+ * Checks if a given port is already in use (bound by another process).
197
+ *
198
+ * @param port - The port number to check.
199
+ * @param host - The hostname or IP address to bind to (default: '127.0.0.1').
200
+ * @returns Promise<boolean> - Resolves to `true` if the port is in use, otherwise `false`.
201
+ */
202
+ const isPortInUse: (port: number, options?: {
203
+ /**
204
+ * '127.0.0.1' etc..
205
+ */
206
+ checkForSpecificOnlyHost?: string;
207
+ }) => Promise<boolean>;
187
208
  }
188
209
  export declare namespace UtilsString {
189
210
  const kebabCaseNoSplitNumbers: (input: string) => string;
@@ -196,4 +217,100 @@ export declare namespace UtilsMigrations {
196
217
  const getFormattedTimestampFromClassName: (className: string) => string | undefined;
197
218
  const formatTimestamp: (timestamp: number) => string;
198
219
  const isValidTimestamp: (value: any) => boolean;
220
+ }
221
+ export declare namespace UtilsTerminal {
222
+ export const clearConsole: () => void;
223
+ export const multiselect: <T = string>(options: {
224
+ question: string;
225
+ /**
226
+ * If true, then only one choice can be selected
227
+ */
228
+ onlyOneChoice?: boolean;
229
+ choices: {
230
+ name: string;
231
+ value: T;
232
+ }[] | {
233
+ [choice: string]: {
234
+ name: string;
235
+ };
236
+ };
237
+ autocomplete?: boolean;
238
+ defaultSelected?: string[];
239
+ }) => Promise<T[]>;
240
+ type SelectActionChoice = {
241
+ [choice: string]: {
242
+ /**
243
+ * Title of the choice
244
+ */
245
+ name: string;
246
+ /**
247
+ * Action to execute
248
+ */
249
+ action?: () => any;
250
+ };
251
+ };
252
+ /**
253
+ * Similar to select but executes action if provided
254
+ * @returns selected and executed value
255
+ */
256
+ export const selectActionAndExecute: <CHOICE extends SelectActionChoice = SelectActionChoice>(choices: CHOICE, options?: {
257
+ question?: string;
258
+ autocomplete?: boolean;
259
+ defaultSelected?: string;
260
+ hint?: string;
261
+ executeActionOnDefault?: boolean;
262
+ }) => Promise<any>;
263
+ export const select: <T = string>(options: {
264
+ question: string;
265
+ choices: {
266
+ name: string;
267
+ value: T;
268
+ }[] | {
269
+ [choice: string]: {
270
+ name: string;
271
+ };
272
+ };
273
+ autocomplete?: boolean;
274
+ defaultSelected?: string;
275
+ hint?: string;
276
+ }) => Promise<T>;
277
+ export const pipeEnterToStdin: () => void;
278
+ export const input: ({ defaultValue, question, required, }: {
279
+ defaultValue?: string;
280
+ question: string;
281
+ required?: boolean;
282
+ validate?: (value: string) => boolean;
283
+ }) => Promise<string>;
284
+ export const confirm: (options?: {
285
+ /**
286
+ * default: Are you sure?
287
+ */
288
+ message?: string;
289
+ callbackTrue?: () => any;
290
+ callbackFalse?: () => any;
291
+ /**
292
+ * default: true
293
+ */
294
+ defaultValue?: boolean;
295
+ engine?: "inquirer-toggle" | "prompts" | "enquirer" | "@inquirer/prompts";
296
+ }) => Promise<any>;
297
+ export const pressAnyKeyToContinueAsync: (options?: {
298
+ message?: string;
299
+ }) => Promise<void>;
300
+ /**
301
+ * @deprecated use UtilsTerminal.pressAnyKeyToContinueAsync()
302
+ */
303
+ export const pressAnyKey: (options?: {
304
+ message?: string;
305
+ }) => any;
306
+ export const previewLongList: (list: string | string[], listName?: string) => Promise<void>;
307
+ /**
308
+ * Displays a long list in the console using a pager like `less`.
309
+ * Returns a Promise that resolves when the user exits the pager.
310
+ *
311
+ * @param {string} list - The long string content to display.
312
+ * @returns {Promise<void>} A Promise that resolves when the pager exits.
313
+ */
314
+ export const previewLongListGitLogLike: (list: string | string[]) => Promise<void>;
315
+ export {};
199
316
  }