@commercelayer/cli-ux 1.0.1

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.
@@ -0,0 +1,469 @@
1
+ import { Options as Options$1, SingleBar } from 'cli-progress';
2
+ import { Interfaces, Errors } from '@oclif/core';
3
+
4
+ declare const _default$2: {
5
+ arc: {
6
+ frames: string[];
7
+ interval: number;
8
+ };
9
+ arrow: {
10
+ frames: string[];
11
+ interval: number;
12
+ };
13
+ arrow2: {
14
+ frames: string[];
15
+ interval: number;
16
+ };
17
+ arrow3: {
18
+ frames: string[];
19
+ interval: number;
20
+ };
21
+ balloon: {
22
+ frames: string[];
23
+ interval: number;
24
+ };
25
+ balloon2: {
26
+ frames: string[];
27
+ interval: number;
28
+ };
29
+ bounce: {
30
+ frames: string[];
31
+ interval: number;
32
+ };
33
+ bouncingBall: {
34
+ frames: string[];
35
+ interval: number;
36
+ };
37
+ bouncingBar: {
38
+ frames: string[];
39
+ interval: number;
40
+ };
41
+ boxBounce: {
42
+ frames: string[];
43
+ interval: number;
44
+ };
45
+ boxBounce2: {
46
+ frames: string[];
47
+ interval: number;
48
+ };
49
+ circle: {
50
+ frames: string[];
51
+ interval: number;
52
+ };
53
+ circleHalves: {
54
+ frames: string[];
55
+ interval: number;
56
+ };
57
+ circleQuarters: {
58
+ frames: string[];
59
+ interval: number;
60
+ };
61
+ clock: {
62
+ frames: string[];
63
+ interval: number;
64
+ };
65
+ dots: {
66
+ frames: string[];
67
+ interval: number;
68
+ };
69
+ dots2: {
70
+ frames: string[];
71
+ interval: number;
72
+ };
73
+ dots3: {
74
+ frames: string[];
75
+ interval: number;
76
+ };
77
+ dots4: {
78
+ frames: string[];
79
+ interval: number;
80
+ };
81
+ dots5: {
82
+ frames: string[];
83
+ interval: number;
84
+ };
85
+ dots6: {
86
+ frames: string[];
87
+ interval: number;
88
+ };
89
+ dots7: {
90
+ frames: string[];
91
+ interval: number;
92
+ };
93
+ dots8: {
94
+ frames: string[];
95
+ interval: number;
96
+ };
97
+ dots9: {
98
+ frames: string[];
99
+ interval: number;
100
+ };
101
+ dots10: {
102
+ frames: string[];
103
+ interval: number;
104
+ };
105
+ dots11: {
106
+ frames: string[];
107
+ interval: number;
108
+ };
109
+ earth: {
110
+ frames: string[];
111
+ interval: number;
112
+ };
113
+ flip: {
114
+ frames: string[];
115
+ interval: number;
116
+ };
117
+ growHorizontal: {
118
+ frames: string[];
119
+ interval: number;
120
+ };
121
+ growVertical: {
122
+ frames: string[];
123
+ interval: number;
124
+ };
125
+ hamburger: {
126
+ frames: string[];
127
+ interval: number;
128
+ };
129
+ hearts: {
130
+ frames: string[];
131
+ interval: number;
132
+ };
133
+ hexagon: {
134
+ frames: string[];
135
+ interval: number;
136
+ };
137
+ line: {
138
+ frames: string[];
139
+ interval: number;
140
+ };
141
+ line2: {
142
+ frames: string[];
143
+ interval: number;
144
+ };
145
+ monkey: {
146
+ frames: string[];
147
+ interval: number;
148
+ };
149
+ moon: {
150
+ frames: string[];
151
+ interval: number;
152
+ };
153
+ noise: {
154
+ frames: string[];
155
+ interval: number;
156
+ };
157
+ pipe: {
158
+ frames: string[];
159
+ interval: number;
160
+ };
161
+ pong: {
162
+ frames: string[];
163
+ interval: number;
164
+ };
165
+ runner: {
166
+ frames: string[];
167
+ interval: number;
168
+ };
169
+ simpleDots: {
170
+ frames: string[];
171
+ interval: number;
172
+ };
173
+ simpleDotsScrolling: {
174
+ frames: string[];
175
+ interval: number;
176
+ };
177
+ smiley: {
178
+ frames: string[];
179
+ interval: number;
180
+ };
181
+ squareCorners: {
182
+ frames: string[];
183
+ interval: number;
184
+ };
185
+ squish: {
186
+ frames: string[];
187
+ interval: number;
188
+ };
189
+ star: {
190
+ frames: string[];
191
+ interval: number;
192
+ };
193
+ star2: {
194
+ frames: string[];
195
+ interval: number;
196
+ };
197
+ toggle: {
198
+ frames: string[];
199
+ interval: number;
200
+ };
201
+ toggle2: {
202
+ frames: string[];
203
+ interval: number;
204
+ };
205
+ toggle3: {
206
+ frames: string[];
207
+ interval: number;
208
+ };
209
+ toggle4: {
210
+ frames: string[];
211
+ interval: number;
212
+ };
213
+ toggle5: {
214
+ frames: string[];
215
+ interval: number;
216
+ };
217
+ toggle6: {
218
+ frames: string[];
219
+ interval: number;
220
+ };
221
+ toggle7: {
222
+ frames: string[];
223
+ interval: number;
224
+ };
225
+ toggle8: {
226
+ frames: string[];
227
+ interval: number;
228
+ };
229
+ toggle9: {
230
+ frames: string[];
231
+ interval: number;
232
+ };
233
+ toggle10: {
234
+ frames: string[];
235
+ interval: number;
236
+ };
237
+ toggle11: {
238
+ frames: string[];
239
+ interval: number;
240
+ };
241
+ toggle12: {
242
+ frames: string[];
243
+ interval: number;
244
+ };
245
+ toggle13: {
246
+ frames: string[];
247
+ interval: number;
248
+ };
249
+ triangle: {
250
+ frames: string[];
251
+ interval: number;
252
+ };
253
+ };
254
+
255
+ type Options = {
256
+ stdout?: boolean;
257
+ style?: keyof typeof _default$2;
258
+ };
259
+
260
+ interface ITask {
261
+ action: string;
262
+ active: boolean;
263
+ status: string | undefined;
264
+ }
265
+ type ActionType = 'debug' | 'simple' | 'spinner';
266
+ declare class ActionBase {
267
+ std: 'stderr' | 'stdout';
268
+ protected stdmocks?: Array<['stderr' | 'stdout', string[]]>;
269
+ type: ActionType;
270
+ private stdmockOrigs;
271
+ protected get output(): string | undefined;
272
+ protected set output(output: string | undefined);
273
+ get running(): boolean;
274
+ get status(): string | undefined;
275
+ set status(status: string | undefined);
276
+ get task(): ITask | undefined;
277
+ set task(task: ITask | undefined);
278
+ pause(fn: () => any, icon?: string): Promise<any>;
279
+ pauseAsync<T>(fn: () => Promise<T>, icon?: string): Promise<T>;
280
+ start(action: string, status?: string, opts?: Options): void;
281
+ stop(msg?: string): void;
282
+ protected _flushStdout(): void;
283
+ protected _pause(_?: string): void;
284
+ protected _resume(): void;
285
+ protected _start(_opts: Options): void;
286
+ protected _stdout(toggle: boolean): void;
287
+ protected _stop(_: string): void;
288
+ protected _updateStatus(_: string | undefined, __?: string): void;
289
+ protected _write(std: 'stderr' | 'stdout', s: string | string[]): void;
290
+ private get globals();
291
+ }
292
+
293
+ type Levels = 'debug' | 'error' | 'fatal' | 'info' | 'trace' | 'warn';
294
+ declare class Config {
295
+ action: ActionBase;
296
+ errorsHandled: boolean;
297
+ outputLevel: Levels;
298
+ showStackTrace: boolean;
299
+ get context(): any;
300
+ set context(v: unknown);
301
+ get debug(): boolean;
302
+ set debug(v: boolean);
303
+ }
304
+ declare const config: Config;
305
+
306
+ interface IPromptOptions {
307
+ default?: string;
308
+ prompt?: string;
309
+ /**
310
+ * Requires user input if true, otherwise allows empty input
311
+ */
312
+ required?: boolean;
313
+ timeout?: number;
314
+ type?: 'hide' | 'mask' | 'normal' | 'single';
315
+ }
316
+ /**
317
+ * prompt for input
318
+ * @param name - prompt text
319
+ * @param options - @see IPromptOptions
320
+ * @returns Promise<string>
321
+ */
322
+ declare function prompt$1(name: string, options?: IPromptOptions): Promise<string>;
323
+ /**
324
+ * confirmation prompt (yes/no)
325
+ * @param message - confirmation text
326
+ * @returns Promise<boolean>
327
+ */
328
+ declare function confirm$1(message: string): Promise<boolean>;
329
+ /**
330
+ * "press anykey to continue"
331
+ * @param message - optional message to display to user
332
+ * @returns Promise<string>
333
+ */
334
+ declare function anykey$1(message?: string): Promise<string>;
335
+
336
+ declare function progress$1(options?: Options$1): SingleBar;
337
+
338
+ declare function table$1<T extends Record<string, unknown>>(data: T[], columns: table$1.Columns<T>, options?: table$1.Options): void;
339
+ declare namespace table$1 {
340
+ export const Flags: {
341
+ columns: Interfaces.OptionFlag<string | undefined>;
342
+ csv: Interfaces.BooleanFlag<boolean>;
343
+ extended: Interfaces.BooleanFlag<boolean>;
344
+ filter: Interfaces.OptionFlag<string | undefined>;
345
+ 'no-header': Interfaces.BooleanFlag<boolean>;
346
+ 'no-truncate': Interfaces.BooleanFlag<boolean>;
347
+ output: Interfaces.OptionFlag<string | undefined>;
348
+ sort: Interfaces.OptionFlag<string | undefined>;
349
+ };
350
+ type IFlags = typeof Flags;
351
+ type ExcludeFlags<T, Z> = Pick<T, Exclude<keyof T, Z>>;
352
+ type IncludeFlags<T, K extends keyof T> = Pick<T, K>;
353
+ export function flags(): IFlags;
354
+ export function flags<Z extends keyof IFlags = keyof IFlags>(opts: {
355
+ except: Z | Z[];
356
+ }): ExcludeFlags<IFlags, Z>;
357
+ export function flags<K extends keyof IFlags = keyof IFlags>(opts: {
358
+ only: K | K[];
359
+ }): IncludeFlags<IFlags, K>;
360
+ export interface Column<T extends Record<string, unknown>> {
361
+ extended: boolean;
362
+ get(row: T): any;
363
+ header: string;
364
+ minWidth: number;
365
+ }
366
+ export type Columns<T extends Record<string, unknown>> = Record<string, Partial<Column<T>>>;
367
+ export interface Options {
368
+ [key: string]: any;
369
+ columns?: string;
370
+ extended?: boolean;
371
+ filter?: string;
372
+ 'no-header'?: boolean;
373
+ 'no-truncate'?: boolean;
374
+ output?: string;
375
+ printLine?(s: any): any;
376
+ sort?: string;
377
+ }
378
+ export { };
379
+ }
380
+
381
+ declare namespace table$2 {
382
+ export { table$1 as table };
383
+ }
384
+
385
+ declare class Tree {
386
+ nodes: Record<string, Tree>;
387
+ display(logger?: any): void;
388
+ insert(child: string, value?: Tree): this;
389
+ search(key: string): Tree | undefined;
390
+ }
391
+ declare function tree$1(): Tree;
392
+
393
+ declare const _default$1: (ms?: number) => Promise<void>;
394
+
395
+ declare class ExitError extends Error {
396
+ code: 'EEXIT';
397
+ error?: Error;
398
+ ux: {
399
+ exit: number;
400
+ };
401
+ constructor(status: number, error?: Error);
402
+ }
403
+
404
+ declare const STANDARD_CHALK: readonly ["white", "black", "blue", "yellow", "green", "red", "magenta", "cyan", "gray", "blackBright", "redBright", "greenBright", "yellowBright", "blueBright", "magentaBright", "cyanBright", "whiteBright", "bgBlack", "bgRed", "bgGreen", "bgYellow", "bgBlue", "bgMagenta", "bgCyan", "bgWhite", "bgGray", "bgBlackBright", "bgRedBright", "bgGreenBright", "bgYellowBright", "bgBlueBright", "bgMagentaBright", "bgCyanBright", "bgWhiteBright", "bold", "underline", "dim", "italic", "strikethrough"];
405
+ type StandardChalk = (typeof STANDARD_CHALK)[number];
406
+ /**
407
+ * Add color to text.
408
+ * @param color color to use. Can be hex code (e.g. `#ff0000`), rgb (e.g. `rgb(255, 255, 255)`) or a chalk color (e.g. `red`)
409
+ * @param text string to colorize
410
+ * @returns colorized string
411
+ */
412
+ declare function colorize(color: string | StandardChalk | undefined, text: string): string;
413
+
414
+ declare const _default: {
415
+ stderr: (msg: string) => void;
416
+ stdout: (msg: string) => void;
417
+ };
418
+
419
+ declare class ux {
420
+ static config: Config;
421
+ static get action(): ActionBase;
422
+ static annotation(text: string, annotation: string): void;
423
+ /**
424
+ * "press anykey to continue"
425
+ */
426
+ static get anykey(): typeof anykey$1;
427
+ static get confirm(): typeof confirm$1;
428
+ static debug(format: string, ...args: string[]): void;
429
+ static done(): Promise<void>;
430
+ static flush(ms?: number): Promise<void>;
431
+ static info(format: string, ...args: string[]): void;
432
+ static log(format?: string, ...args: string[]): void;
433
+ static logToStderr(format?: string, ...args: string[]): void;
434
+ static get progress(): typeof progress$1;
435
+ static get prompt(): typeof prompt$1;
436
+ static styledHeader(header: string): void;
437
+ static styledJSON(obj: unknown): void;
438
+ static styledObject(obj: any, keys?: string[]): void;
439
+ static get table(): typeof table$1;
440
+ static trace(format: string, ...args: string[]): void;
441
+ static get tree(): typeof tree$1;
442
+ static url(text: string, uri: string, params?: {}): void;
443
+ static get wait(): typeof _default$1;
444
+ }
445
+ declare const action: ActionBase;
446
+ declare const annotation: typeof ux.annotation;
447
+ declare const anykey: typeof anykey$1;
448
+ declare const confirm: typeof confirm$1;
449
+ declare const debug: typeof ux.debug;
450
+ declare const done: typeof ux.done;
451
+ declare const flush: typeof ux.flush;
452
+ declare const info: typeof ux.info;
453
+ declare const log: typeof ux.log;
454
+ declare const logToStderr: typeof ux.logToStderr;
455
+ declare const progress: typeof progress$1;
456
+ declare const prompt: typeof prompt$1;
457
+ declare const styledHeader: typeof ux.styledHeader;
458
+ declare const styledJSON: typeof ux.styledJSON;
459
+ declare const styledObject: typeof ux.styledObject;
460
+ declare const table: typeof table$1;
461
+ declare const trace: typeof ux.trace;
462
+ declare const tree: typeof tree$1;
463
+ declare const url: typeof ux.url;
464
+ declare const wait: (ms?: number) => Promise<void>;
465
+ declare const error: typeof Errors.error;
466
+ declare const exit: typeof Errors.exit;
467
+ declare const warn: typeof Errors.warn;
468
+
469
+ export { ActionBase, Config, ExitError, type IPromptOptions, table$2 as Table, action, annotation, anykey, colorize, config, confirm, debug, done, error, exit, flush, info, log, logToStderr, progress, prompt, styledHeader, styledJSON, styledObject, table, trace, tree, url, ux, wait, warn, _default as write };