@visulima/pail 3.0.3 → 3.2.0

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.
Files changed (77) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/LICENSE.md +18 -391
  3. package/README.md +578 -0
  4. package/dist/index.browser.d.ts +4 -3
  5. package/dist/index.browser.js +12 -1
  6. package/dist/index.server.d.ts +19 -74
  7. package/dist/index.server.js +535 -5
  8. package/dist/interactive/index.d.ts +28 -0
  9. package/dist/interactive/index.js +2 -0
  10. package/dist/object-tree.d.ts +17 -0
  11. package/dist/object-tree.js +89 -0
  12. package/dist/packem_shared/AbstractJsonReporter-intFdT_A.js +204 -0
  13. package/dist/packem_shared/InteractiveManager-CZ85hGNW.js +172 -0
  14. package/dist/packem_shared/InteractiveStreamHook-DiSubbJ1.js +21 -0
  15. package/dist/packem_shared/JsonReporter-BqWsVkHP.js +60 -0
  16. package/dist/packem_shared/JsonReporter-DcM2LBX9.js +28 -0
  17. package/dist/packem_shared/PrettyReporter-BFWaYP_J.js +222 -0
  18. package/dist/packem_shared/PrettyReporter-CuLLKr6-.js +169 -0
  19. package/dist/packem_shared/{abstract-json-reporter-wUti0B3k.d.ts → abstract-json-reporter-DiyVyU0j.d.ts} +3 -3
  20. package/dist/packem_shared/{abstract-pretty-reporter-MOYolfGR.d.ts → abstract-pretty-reporter-BbOWXMCs.d.ts} +1 -1
  21. package/dist/packem_shared/abstract-pretty-reporter-DMPDCslJ.js +50 -0
  22. package/dist/packem_shared/constants-DfDr4MHC.js +119 -0
  23. package/dist/packem_shared/format-label-Btft2KGP.js +1194 -0
  24. package/dist/packem_shared/get-longest-label-C9PWeyKq.js +9 -0
  25. package/dist/packem_shared/index-BomQ3E6J.js +650 -0
  26. package/dist/packem_shared/index-DqKWykfa.js +1146 -0
  27. package/dist/packem_shared/interactive-stream-hook-DG4BtN12.js +141 -0
  28. package/dist/packem_shared/{pail.browser-Bs2ng_Qj.d.ts → pail.browser-By9KjOH7.d.ts} +8 -3
  29. package/dist/packem_shared/pail.browser-CPDOE_d1.js +1427 -0
  30. package/dist/packem_shared/{types-RidvA4RN.d.ts → types-D3ycu8-x.d.ts} +2 -29
  31. package/dist/packem_shared/write-console-log-based-on-level-DBmRYXpj.js +14 -0
  32. package/dist/packem_shared/write-stream-BG8fhcs3.js +6 -0
  33. package/dist/processor/caller/caller-processor.d.ts +2 -1
  34. package/dist/processor/caller/caller-processor.js +59 -1
  35. package/dist/processor/message-formatter-processor.d.ts +2 -1
  36. package/dist/processor/message-formatter-processor.js +67 -1
  37. package/dist/processor/opentelemetry-processor.d.ts +19 -0
  38. package/dist/processor/opentelemetry-processor.js +52 -0
  39. package/dist/processor/redact-processor.d.ts +2 -1
  40. package/dist/processor/redact-processor.js +30 -1
  41. package/dist/progress-bar.d.ts +76 -0
  42. package/dist/progress-bar.js +404 -0
  43. package/dist/reporter/file/json-file-reporter.d.ts +3 -2
  44. package/dist/reporter/file/json-file-reporter.js +136 -4
  45. package/dist/reporter/http/abstract-http-reporter.d.ts +102 -0
  46. package/dist/reporter/http/abstract-http-reporter.js +435 -0
  47. package/dist/reporter/http/http-reporter.d.ts +13 -0
  48. package/dist/reporter/http/http-reporter.edge-light.d.ts +168 -0
  49. package/dist/reporter/http/http-reporter.edge-light.js +651 -0
  50. package/dist/reporter/http/http-reporter.js +13 -0
  51. package/dist/reporter/json/index.browser.d.ts +3 -2
  52. package/dist/reporter/json/index.browser.js +2 -1
  53. package/dist/reporter/json/index.d.ts +3 -2
  54. package/dist/reporter/json/index.js +2 -1
  55. package/dist/reporter/pretty/index.browser.d.ts +3 -2
  56. package/dist/reporter/pretty/index.browser.js +1 -1
  57. package/dist/reporter/pretty/index.d.ts +3 -2
  58. package/dist/reporter/pretty/index.js +1 -1
  59. package/dist/reporter/simple/simple-reporter.server.d.ts +3 -2
  60. package/dist/reporter/simple/simple-reporter.server.js +186 -8
  61. package/dist/spinner.d.ts +154 -0
  62. package/dist/spinner.js +2150 -0
  63. package/package.json +69 -3
  64. package/dist/packem_shared/AbstractJsonReporter-UftN6CIL.js +0 -1
  65. package/dist/packem_shared/JsonReporter-DTBtHNaD.js +0 -2
  66. package/dist/packem_shared/JsonReporter-Dl4m0xZe.js +0 -1
  67. package/dist/packem_shared/PrettyReporter-APmxUrnh.js +0 -12
  68. package/dist/packem_shared/PrettyReporter-CGKSTI7X.js +0 -5
  69. package/dist/packem_shared/abstract-pretty-reporter-CUtSm20r.js +0 -1
  70. package/dist/packem_shared/constants-DKfCaSUR.js +0 -1
  71. package/dist/packem_shared/format-label-DqvZRRR6.js +0 -33
  72. package/dist/packem_shared/get-longest-label-B0NrI-o2.js +0 -1
  73. package/dist/packem_shared/getBarChar-mKDZW32R.js +0 -1
  74. package/dist/packem_shared/index-D9hWq9ka.js +0 -1
  75. package/dist/packem_shared/pail.browser-BmHoDvEA.js +0 -19
  76. package/dist/packem_shared/write-console-log-based-on-level-BP95fgQZ.js +0 -1
  77. package/dist/packem_shared/write-stream-CD8XFv1L.js +0 -1
@@ -1,7 +1,8 @@
1
- import { A as AbstractPrettyReporter, P as PrettyStyleOptions } from '../../packem_shared/abstract-pretty-reporter-MOYolfGR.js';
2
- import { h as ReadonlyMeta } from '../../packem_shared/types-RidvA4RN.js';
1
+ import { A as AbstractPrettyReporter, P as PrettyStyleOptions } from '../../packem_shared/abstract-pretty-reporter-BbOWXMCs.js';
2
+ import { e as ReadonlyMeta } from '../../packem_shared/types-D3ycu8-x.js';
3
3
  import 'type-fest';
4
4
  import '@visulima/colorize';
5
+ import '../../interactive/index.js';
5
6
 
6
7
  declare class PrettyReporter<T extends string = string, L extends string = string> extends AbstractPrettyReporter<T, L> {
7
8
  #private;
@@ -1 +1 @@
1
- import{default as t}from"../../packem_shared/PrettyReporter-CGKSTI7X.js";export{t as PrettyReporter};
1
+ export { default as PrettyReporter } from '../../packem_shared/PrettyReporter-CuLLKr6-.js';
@@ -1,7 +1,8 @@
1
1
  import { O as Options$1, a as Options } from '../../packem_shared/index.d-BR1GjZri.js';
2
2
  import { LiteralUnion } from 'type-fest';
3
- import { i as InteractiveStreamReporter, I as InteractiveManager, h as ReadonlyMeta, E as ExtendedRfc5424LogLevels } from '../../packem_shared/types-RidvA4RN.js';
4
- import { P as PrettyStyleOptions, A as AbstractPrettyReporter } from '../../packem_shared/abstract-pretty-reporter-MOYolfGR.js';
3
+ import { InteractiveManager } from '../../interactive/index.js';
4
+ import { I as InteractiveStreamReporter, e as ReadonlyMeta, E as ExtendedRfc5424LogLevels } from '../../packem_shared/types-D3ycu8-x.js';
5
+ import { P as PrettyStyleOptions, A as AbstractPrettyReporter } from '../../packem_shared/abstract-pretty-reporter-BbOWXMCs.js';
5
6
  import '@visulima/colorize';
6
7
 
7
8
  type PrettyReporterOptions = PrettyStyleOptions & {
@@ -1 +1 @@
1
- import{PrettyReporter as t}from"../../packem_shared/PrettyReporter-APmxUrnh.js";export{t as PrettyReporter};
1
+ export { PrettyReporter } from '../../packem_shared/PrettyReporter-BFWaYP_J.js';
@@ -1,6 +1,7 @@
1
1
  import { O as Options$1, a as Options } from '../../packem_shared/index.d-BR1GjZri.js';
2
- import { i as InteractiveStreamReporter, I as InteractiveManager, h as ReadonlyMeta } from '../../packem_shared/types-RidvA4RN.js';
3
- import { P as PrettyStyleOptions, A as AbstractPrettyReporter } from '../../packem_shared/abstract-pretty-reporter-MOYolfGR.js';
2
+ import { InteractiveManager } from '../../interactive/index.js';
3
+ import { I as InteractiveStreamReporter, e as ReadonlyMeta } from '../../packem_shared/types-D3ycu8-x.js';
4
+ import { P as PrettyStyleOptions, A as AbstractPrettyReporter } from '../../packem_shared/abstract-pretty-reporter-BbOWXMCs.js';
4
5
  import 'type-fest';
5
6
  import '@visulima/colorize';
6
7
 
@@ -1,11 +1,189 @@
1
- var q=Object.defineProperty;var x=(a,e)=>q(a,"name",{value:e,configurable:!0});import{createRequire as F}from"node:module";import G,{red as T,greenBright as z,cyan as H,green as W,grey as o,bold as R,white as J,bgGrey as K,underline as I}from"@visulima/colorize";import{u as N,O as Q,o as d,n as U,a as k,i as X,B as Z,G as _}from"../../packem_shared/format-label-DqvZRRR6.js";import{E as ee}from"../../packem_shared/constants-DKfCaSUR.js";import{A as te,s as re}from"../../packem_shared/abstract-pretty-reporter-CUtSm20r.js";import{s as se}from"../../packem_shared/get-longest-label-B0NrI-o2.js";import{n as ie}from"../../packem_shared/write-stream-CD8XFv1L.js";const pe=F(import.meta.url),V=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:Y,stderr:D}=V;var oe=Object.defineProperty,A=x((a,e)=>oe(a,"name",{value:e,configurable:!0}),"b");const j=A(a=>!/[\\/]pail[\\/]dist/.test(a),"pailFileFilter");class me extends te{static{x(this,"SimpleReporter")}static{A(this,"SimpleReporter")}#t;#r;#s;#o=!1;#i;#e;constructor(e={}){const{error:n,inspect:p,...i}=e;super({uppercase:{label:!0,...i.uppercase},...i}),this.#i={...N,indent:void 0,...p},this.#e={...n,color:{fileLine:W,hint:H,marker:T,message:T,method:z,title:T}},this.#t=Y,this.#r=D}setStdout(e){this.#t=e}setStderr(e){this.#r=e}setInteractiveManager(e){this.#s=e}setIsInteractive(e){this.#o=e}log(e){const n=this.formatMessage(e),p=e.type.level,i=["error","trace","warn"].includes(p)?"stderr":"stdout",h=i==="stderr"?this.#r:this.#t;this.#o&&this.#s!==void 0&&h.isTTY?this.#s.update(i,n.split(`
2
- `),0):ie(`${n}
3
- `,h)}formatMessage(e){const{columns:n}=Q();let p=n;typeof this.styles.messageLength=="number"&&(p=this.styles.messageLength);const{badge:i,context:h,date:c,error:S,file:u,groups:m,label:g,message:f,prefix:y,repeated:v,scope:$,suffix:b,traceError:w,type:B}=e,{color:E}=this.loggerTypes[B.name],M=E?G[E]:J,l=m.map(()=>" ").join(""),t=[];if(m.length>0&&t.push(`${l+o(`[${m.at(-1)}]`)} `),c&&t.push(`${o(this.styles.dateFormatter(typeof c=="string"?new Date(c):c))} `),i)t.push(R(M(i)));else{const r=re(this.loggerTypes);r.length>0&&t.push(o(" ".repeat(r.length)))}const L=se(this.loggerTypes),C=d(L);if(g){const r=d(g),s=Math.max(0,C-r);t.push(`${R(M(U(g,this.styles)))} `," ".repeat(s))}else t.push(" ".repeat(C+1));v&&t.push(`${K.white(`[${v}x]`)} `),Array.isArray($)&&$.length>0&&t.push(`${o(`[${$.join(" > ")}]`)} `),y&&t.push(`${o(`[${this.styles.underline.prefix?I(y):y}]`)} `);const O=d(t.join(""));if(f!==ee){const r=typeof f=="string"?f:k(f,this.#i);t.push(l+X(r,{trim:!1,width:p-3,wrapMode:Z.STRICT_WIDTH}))}if(h){let r=!1;t.push(...h.map(s=>{if(s instanceof Error)return r=!0,`
1
+ import { createRequire as __cjs_createRequire } from "node:module";
4
2
 
5
- ${_(s,{...this.#e,filterStacktrace:j,prefix:l})}`;if(typeof s=="object")return` ${k(s,this.#i)}`;const P=(r?`
3
+ const __cjs_require = __cjs_createRequire(import.meta.url);
6
4
 
7
- `:" ")+s;return r=!1,P}))}if(S&&t.push(_(S,{...this.#e,filterStacktrace:j,prefix:l})),w&&t.push(`
5
+ const __cjs_getProcess = typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" ? globalThis.process : process;
8
6
 
9
- ${_(w,{...this.#e,filterStacktrace:j,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:l})}`),b&&t.push(` ${l}${o(this.styles.underline.suffix?I(b):b)}`),u){const r=u.name+(u.line?`:${u.line}`:""),s=Math.max(0,O-d("Caller: "));t.push(`
10
- `,o("Caller: ")," ".repeat(s),r,`
11
- `)}return t.join("")}}export{me as SimpleReporter};
7
+ const {
8
+ stdout,
9
+ stderr
10
+ } = __cjs_getProcess;
11
+ import colorize, { red, greenBright, cyan, green, grey, bold, white, bgGrey, underline } from '@visulima/colorize';
12
+ import { d as defaultInspectorConfig, f as formatLabel, i as inspect, r as renderError } from '../../packem_shared/format-label-Btft2KGP.js';
13
+ import { t as terminalSize, g as getStringWidth, w as wordWrap, W as WrapMode } from '../../packem_shared/index-DqKWykfa.js';
14
+ import { E as EMPTY_SYMBOL } from '../../packem_shared/constants-DfDr4MHC.js';
15
+ import { A as AbstractPrettyReporter, g as getLongestBadge } from '../../packem_shared/abstract-pretty-reporter-DMPDCslJ.js';
16
+ import { g as getLongestLabel } from '../../packem_shared/get-longest-label-C9PWeyKq.js';
17
+ import { w as writeStream } from '../../packem_shared/write-stream-BG8fhcs3.js';
18
+
19
+ const pailFileFilter = (line) => !/[\\/]pail[\\/]dist/.test(line);
20
+ class SimpleReporter extends AbstractPrettyReporter {
21
+ #stdout;
22
+ #stderr;
23
+ #interactiveManager;
24
+ #interactive = false;
25
+ #inspectOptions;
26
+ #errorOptions;
27
+ constructor(options = {}) {
28
+ const { error: errorOptions, inspect: inspectOptions, ...rest } = options;
29
+ super({
30
+ uppercase: {
31
+ label: true,
32
+ ...rest.uppercase
33
+ },
34
+ ...rest
35
+ });
36
+ this.#inspectOptions = { ...defaultInspectorConfig, indent: void 0, ...inspectOptions };
37
+ this.#errorOptions = {
38
+ ...errorOptions,
39
+ color: {
40
+ fileLine: green,
41
+ hint: cyan,
42
+ marker: red,
43
+ message: red,
44
+ method: greenBright,
45
+ title: red
46
+ }
47
+ };
48
+ this.#stdout = stdout;
49
+ this.#stderr = stderr;
50
+ }
51
+ setStdout(stdout_) {
52
+ this.#stdout = stdout_;
53
+ }
54
+ setStderr(stderr_) {
55
+ this.#stderr = stderr_;
56
+ }
57
+ setInteractiveManager(manager) {
58
+ this.#interactiveManager = manager;
59
+ }
60
+ setIsInteractive(interactive) {
61
+ this.#interactive = interactive;
62
+ }
63
+ log(meta) {
64
+ const message = this.formatMessage(meta);
65
+ const logLevel = meta.type.level;
66
+ const streamType = ["error", "trace", "warn"].includes(logLevel) ? "stderr" : "stdout";
67
+ const stream = streamType === "stderr" ? this.#stderr : this.#stdout;
68
+ if (this.#interactive && this.#interactiveManager !== void 0 && stream.isTTY) {
69
+ this.#interactiveManager.update(streamType, message.split("\n"), 0);
70
+ } else {
71
+ writeStream(`${message}
72
+ `, stream);
73
+ }
74
+ }
75
+ // eslint-disable-next-line sonarjs/cognitive-complexity
76
+ formatMessage(data) {
77
+ const { columns } = terminalSize();
78
+ let size = columns;
79
+ if (typeof this.styles.messageLength === "number") {
80
+ size = this.styles.messageLength;
81
+ }
82
+ const { badge, context, date, error, file, groups, label, message, prefix, repeated, scope, suffix, traceError, type } = data;
83
+ const { color } = this.loggerTypes[type.name];
84
+ const colorized = color ? colorize[color] : white;
85
+ const groupSpaces = groups.map(() => " ").join("");
86
+ const items = [];
87
+ if (groups.length > 0) {
88
+ items.push(`${groupSpaces + grey(`[${groups.at(-1)}]`)} `);
89
+ }
90
+ if (date) {
91
+ items.push(`${grey(this.styles.dateFormatter(typeof date === "string" ? new Date(date) : date))} `);
92
+ }
93
+ if (badge) {
94
+ items.push(bold(colorized(badge)));
95
+ } else {
96
+ const longestBadge = getLongestBadge(this.loggerTypes);
97
+ if (longestBadge.length > 0) {
98
+ items.push(grey(" ".repeat(longestBadge.length)));
99
+ }
100
+ }
101
+ const longestLabel = getLongestLabel(this.loggerTypes);
102
+ const longestWidth = getStringWidth(longestLabel);
103
+ if (label) {
104
+ const labelWidth = getStringWidth(label);
105
+ const pad = Math.max(0, longestWidth - labelWidth);
106
+ items.push(`${bold(colorized(formatLabel(label, this.styles)))} `, " ".repeat(pad));
107
+ } else {
108
+ items.push(" ".repeat(longestWidth + 1));
109
+ }
110
+ if (repeated) {
111
+ items.push(`${bgGrey.white(`[${repeated}x]`)} `);
112
+ }
113
+ if (Array.isArray(scope) && scope.length > 0) {
114
+ items.push(`${grey(`[${scope.join(" > ")}]`)} `);
115
+ }
116
+ if (prefix) {
117
+ items.push(`${grey(`[${this.styles.underline.prefix ? underline(prefix) : prefix}]`)} `);
118
+ }
119
+ const titleSize = getStringWidth(items.join(""));
120
+ if (message !== EMPTY_SYMBOL) {
121
+ const formattedMessage = typeof message === "string" ? message : inspect(message, this.#inspectOptions);
122
+ items.push(
123
+ groupSpaces + wordWrap(formattedMessage, {
124
+ trim: false,
125
+ width: size - 3,
126
+ wrapMode: WrapMode.STRICT_WIDTH
127
+ })
128
+ );
129
+ }
130
+ if (context) {
131
+ let hasError = false;
132
+ items.push(
133
+ ...context.map((value) => {
134
+ if (value instanceof Error) {
135
+ hasError = true;
136
+ return `
137
+
138
+ ${renderError(value, {
139
+ ...this.#errorOptions,
140
+ filterStacktrace: pailFileFilter,
141
+ prefix: groupSpaces
142
+ })}`;
143
+ }
144
+ if (typeof value === "object") {
145
+ return ` ${inspect(value, this.#inspectOptions)}`;
146
+ }
147
+ const newValue = (hasError ? "\n\n" : " ") + value;
148
+ hasError = false;
149
+ return newValue;
150
+ })
151
+ );
152
+ }
153
+ if (error) {
154
+ items.push(
155
+ renderError(error, {
156
+ ...this.#errorOptions,
157
+ filterStacktrace: pailFileFilter,
158
+ prefix: groupSpaces
159
+ })
160
+ );
161
+ }
162
+ if (traceError) {
163
+ items.push(
164
+ `
165
+
166
+ ${renderError(traceError, {
167
+ ...this.#errorOptions,
168
+ filterStacktrace: pailFileFilter,
169
+ hideErrorCauseCodeView: true,
170
+ hideErrorCodeView: true,
171
+ hideErrorErrorsCodeView: true,
172
+ hideMessage: true,
173
+ prefix: groupSpaces
174
+ })}`
175
+ );
176
+ }
177
+ if (suffix) {
178
+ items.push(` ${groupSpaces}${grey(this.styles.underline.suffix ? underline(suffix) : suffix)}`);
179
+ }
180
+ if (file) {
181
+ const fileMessage = file.name + (file.line ? `:${file.line}` : "");
182
+ const callerPad = Math.max(0, titleSize - getStringWidth("Caller: "));
183
+ items.push("\n", grey("Caller: "), " ".repeat(callerPad), fileMessage, "\n");
184
+ }
185
+ return items.join("");
186
+ }
187
+ }
188
+
189
+ export { SimpleReporter };
@@ -0,0 +1,154 @@
1
+ import { InteractiveManager } from './interactive/index.js';
2
+
3
+ // TODO: Load the spinner names from the JSON file.
4
+ type SpinnerName =
5
+ | 'dots'
6
+ | 'dots2'
7
+ | 'dots3'
8
+ | 'dots4'
9
+ | 'dots5'
10
+ | 'dots6'
11
+ | 'dots7'
12
+ | 'dots8'
13
+ | 'dots9'
14
+ | 'dots10'
15
+ | 'dots11'
16
+ | 'dots12'
17
+ | 'dots13'
18
+ | 'dots14'
19
+ | 'dots8Bit'
20
+ | 'dotsCircle'
21
+ | 'sand'
22
+ | 'line'
23
+ | 'line2'
24
+ | 'rollingLine'
25
+ | 'pipe'
26
+ | 'simpleDots'
27
+ | 'simpleDotsScrolling'
28
+ | 'star'
29
+ | 'star2'
30
+ | 'flip'
31
+ | 'hamburger'
32
+ | 'growVertical'
33
+ | 'growHorizontal'
34
+ | 'balloon'
35
+ | 'balloon2'
36
+ | 'noise'
37
+ | 'bounce'
38
+ | 'boxBounce'
39
+ | 'boxBounce2'
40
+ | 'binary'
41
+ | 'triangle'
42
+ | 'arc'
43
+ | 'circle'
44
+ | 'squareCorners'
45
+ | 'circleQuarters'
46
+ | 'circleHalves'
47
+ | 'squish'
48
+ | 'toggle'
49
+ | 'toggle2'
50
+ | 'toggle3'
51
+ | 'toggle4'
52
+ | 'toggle5'
53
+ | 'toggle6'
54
+ | 'toggle7'
55
+ | 'toggle8'
56
+ | 'toggle9'
57
+ | 'toggle10'
58
+ | 'toggle11'
59
+ | 'toggle12'
60
+ | 'toggle13'
61
+ | 'arrow'
62
+ | 'arrow2'
63
+ | 'arrow3'
64
+ | 'bouncingBar'
65
+ | 'bouncingBall'
66
+ | 'smiley'
67
+ | 'monkey'
68
+ | 'hearts'
69
+ | 'clock'
70
+ | 'earth'
71
+ | 'material'
72
+ | 'moon'
73
+ | 'runner'
74
+ | 'pong'
75
+ | 'shark'
76
+ | 'dqpb'
77
+ | 'weather'
78
+ | 'christmas'
79
+ | 'grenade'
80
+ | 'point'
81
+ | 'layer'
82
+ | 'betaWave'
83
+ | 'fingerDance'
84
+ | 'fistBump'
85
+ | 'soccerHeader'
86
+ | 'mindblown'
87
+ | 'speaker'
88
+ | 'orangePulse'
89
+ | 'bluePulse'
90
+ | 'orangeBluePulse'
91
+ | 'timeTravel'
92
+ | 'aesthetic'
93
+ | 'dwarfFortress';
94
+
95
+ interface SpinnerStyle {
96
+ bgColor?: string;
97
+ bgHex?: `#${string}`;
98
+ bgRgb?: [number, number, number];
99
+ bold?: boolean;
100
+ color?: string;
101
+ dim?: boolean;
102
+ hex?: `#${string}`;
103
+ inverse?: boolean;
104
+ italic?: boolean;
105
+ overline?: boolean;
106
+ rgb?: [number, number, number];
107
+ strikethrough?: boolean;
108
+ underline?: boolean;
109
+ }
110
+ interface SpinnerIcons {
111
+ error?: string;
112
+ info?: string;
113
+ success?: string;
114
+ warning?: string;
115
+ }
116
+ interface SpinnerOptions {
117
+ icons?: SpinnerIcons;
118
+ name?: SpinnerName;
119
+ prefixText?: string;
120
+ style?: SpinnerStyle;
121
+ verbose?: boolean;
122
+ }
123
+ interface SpinnerStartOptions {
124
+ prefixText?: string;
125
+ }
126
+ declare class Spinner {
127
+ #private;
128
+ constructor(options?: SpinnerOptions, interactiveManager?: InteractiveManager);
129
+ get elapsedTime(): number;
130
+ get getText(): string;
131
+ set text(value: string);
132
+ get getPrefixText(): string;
133
+ set prefixText(value: string);
134
+ get isRunning(): boolean;
135
+ start(text?: string, options?: SpinnerStartOptions): this;
136
+ succeed(text?: string): void;
137
+ failed(text?: string): void;
138
+ warn(text?: string): void;
139
+ info(text?: string): void;
140
+ pause(): void;
141
+ resume(): void;
142
+ }
143
+ declare class MultiSpinner {
144
+ #private;
145
+ constructor(options?: SpinnerOptions, interactiveManager?: InteractiveManager);
146
+ create(text?: string, options?: SpinnerOptions): Spinner;
147
+ remove(spinner: Spinner): boolean;
148
+ stop(): void;
149
+ clear(): void;
150
+ }
151
+ type SpinnerType<T extends string = string, L extends string = string> = Record<T, L> & Spinner;
152
+
153
+ export { MultiSpinner, Spinner };
154
+ export type { SpinnerIcons, SpinnerOptions, SpinnerStartOptions, SpinnerStyle, SpinnerType };