@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.
- package/CHANGELOG.md +47 -0
- package/LICENSE.md +18 -391
- package/README.md +578 -0
- package/dist/index.browser.d.ts +4 -3
- package/dist/index.browser.js +12 -1
- package/dist/index.server.d.ts +19 -74
- package/dist/index.server.js +535 -5
- package/dist/interactive/index.d.ts +28 -0
- package/dist/interactive/index.js +2 -0
- package/dist/object-tree.d.ts +17 -0
- package/dist/object-tree.js +89 -0
- package/dist/packem_shared/AbstractJsonReporter-intFdT_A.js +204 -0
- package/dist/packem_shared/InteractiveManager-CZ85hGNW.js +172 -0
- package/dist/packem_shared/InteractiveStreamHook-DiSubbJ1.js +21 -0
- package/dist/packem_shared/JsonReporter-BqWsVkHP.js +60 -0
- package/dist/packem_shared/JsonReporter-DcM2LBX9.js +28 -0
- package/dist/packem_shared/PrettyReporter-BFWaYP_J.js +222 -0
- package/dist/packem_shared/PrettyReporter-CuLLKr6-.js +169 -0
- package/dist/packem_shared/{abstract-json-reporter-wUti0B3k.d.ts → abstract-json-reporter-DiyVyU0j.d.ts} +3 -3
- package/dist/packem_shared/{abstract-pretty-reporter-MOYolfGR.d.ts → abstract-pretty-reporter-BbOWXMCs.d.ts} +1 -1
- package/dist/packem_shared/abstract-pretty-reporter-DMPDCslJ.js +50 -0
- package/dist/packem_shared/constants-DfDr4MHC.js +119 -0
- package/dist/packem_shared/format-label-Btft2KGP.js +1194 -0
- package/dist/packem_shared/get-longest-label-C9PWeyKq.js +9 -0
- package/dist/packem_shared/index-BomQ3E6J.js +650 -0
- package/dist/packem_shared/index-DqKWykfa.js +1146 -0
- package/dist/packem_shared/interactive-stream-hook-DG4BtN12.js +141 -0
- package/dist/packem_shared/{pail.browser-Bs2ng_Qj.d.ts → pail.browser-By9KjOH7.d.ts} +8 -3
- package/dist/packem_shared/pail.browser-CPDOE_d1.js +1427 -0
- package/dist/packem_shared/{types-RidvA4RN.d.ts → types-D3ycu8-x.d.ts} +2 -29
- package/dist/packem_shared/write-console-log-based-on-level-DBmRYXpj.js +14 -0
- package/dist/packem_shared/write-stream-BG8fhcs3.js +6 -0
- package/dist/processor/caller/caller-processor.d.ts +2 -1
- package/dist/processor/caller/caller-processor.js +59 -1
- package/dist/processor/message-formatter-processor.d.ts +2 -1
- package/dist/processor/message-formatter-processor.js +67 -1
- package/dist/processor/opentelemetry-processor.d.ts +19 -0
- package/dist/processor/opentelemetry-processor.js +52 -0
- package/dist/processor/redact-processor.d.ts +2 -1
- package/dist/processor/redact-processor.js +30 -1
- package/dist/progress-bar.d.ts +76 -0
- package/dist/progress-bar.js +404 -0
- package/dist/reporter/file/json-file-reporter.d.ts +3 -2
- package/dist/reporter/file/json-file-reporter.js +136 -4
- package/dist/reporter/http/abstract-http-reporter.d.ts +102 -0
- package/dist/reporter/http/abstract-http-reporter.js +435 -0
- package/dist/reporter/http/http-reporter.d.ts +13 -0
- package/dist/reporter/http/http-reporter.edge-light.d.ts +168 -0
- package/dist/reporter/http/http-reporter.edge-light.js +651 -0
- package/dist/reporter/http/http-reporter.js +13 -0
- package/dist/reporter/json/index.browser.d.ts +3 -2
- package/dist/reporter/json/index.browser.js +2 -1
- package/dist/reporter/json/index.d.ts +3 -2
- package/dist/reporter/json/index.js +2 -1
- package/dist/reporter/pretty/index.browser.d.ts +3 -2
- package/dist/reporter/pretty/index.browser.js +1 -1
- package/dist/reporter/pretty/index.d.ts +3 -2
- package/dist/reporter/pretty/index.js +1 -1
- package/dist/reporter/simple/simple-reporter.server.d.ts +3 -2
- package/dist/reporter/simple/simple-reporter.server.js +186 -8
- package/dist/spinner.d.ts +154 -0
- package/dist/spinner.js +2150 -0
- package/package.json +69 -3
- package/dist/packem_shared/AbstractJsonReporter-UftN6CIL.js +0 -1
- package/dist/packem_shared/JsonReporter-DTBtHNaD.js +0 -2
- package/dist/packem_shared/JsonReporter-Dl4m0xZe.js +0 -1
- package/dist/packem_shared/PrettyReporter-APmxUrnh.js +0 -12
- package/dist/packem_shared/PrettyReporter-CGKSTI7X.js +0 -5
- package/dist/packem_shared/abstract-pretty-reporter-CUtSm20r.js +0 -1
- package/dist/packem_shared/constants-DKfCaSUR.js +0 -1
- package/dist/packem_shared/format-label-DqvZRRR6.js +0 -33
- package/dist/packem_shared/get-longest-label-B0NrI-o2.js +0 -1
- package/dist/packem_shared/getBarChar-mKDZW32R.js +0 -1
- package/dist/packem_shared/index-D9hWq9ka.js +0 -1
- package/dist/packem_shared/pail.browser-BmHoDvEA.js +0 -19
- package/dist/packem_shared/write-console-log-based-on-level-BP95fgQZ.js +0 -1
- 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-
|
|
2
|
-
import {
|
|
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
|
-
|
|
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 {
|
|
4
|
-
import {
|
|
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
|
-
|
|
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 {
|
|
3
|
-
import {
|
|
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
|
-
|
|
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
|
-
|
|
3
|
+
const __cjs_require = __cjs_createRequire(import.meta.url);
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
const __cjs_getProcess = typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" ? globalThis.process : process;
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 };
|