@reliverse/relinka 1.3.7 → 1.3.8
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/README.md +2 -1
- package/bin/{relinka-impl → core-impl}/deprecated/components/levels/levels.d.ts +13 -13
- package/bin/{relinka-impl → core-impl}/deprecated/components/modes/basic.d.ts +19 -19
- package/bin/{relinka-impl → core-impl}/deprecated/components/modes/browser.d.ts +19 -19
- package/bin/{relinka-impl → core-impl}/deprecated/components/modes/shared.d.ts +2 -2
- package/bin/{relinka-impl → core-impl}/deprecated/components/relinka-deprecated/logger.d.ts +5 -5
- package/bin/{relinka-impl → core-impl}/deprecated/components/relinka-deprecated/mod.d.ts +20 -20
- package/bin/{relinka-impl → core-impl}/deprecated/components/relinka-deprecated/relinka.d.ts +140 -141
- package/bin/{relinka-impl → core-impl}/deprecated/components/relinka-deprecated/relinka.test.d.ts +1 -1
- package/bin/{relinka-impl → core-impl}/deprecated/components/reporters/basic.d.ts +11 -11
- package/bin/{relinka-impl → core-impl}/deprecated/components/reporters/browser.d.ts +10 -10
- package/bin/{relinka-impl → core-impl}/deprecated/components/reporters/fancy.d.ts +10 -10
- package/bin/{relinka-impl → core-impl}/deprecated/utils/box.d.ts +114 -114
- package/bin/{relinka-impl → core-impl}/deprecated/utils/deprecatedColors.d.ts +69 -69
- package/bin/{relinka-impl → core-impl}/deprecated/utils/error.d.ts +6 -6
- package/bin/{relinka-impl → core-impl}/deprecated/utils/format.d.ts +14 -14
- package/bin/{relinka-impl → core-impl}/deprecated/utils/log.d.ts +13 -13
- package/bin/{relinka-impl → core-impl}/deprecated/utils/stream.d.ts +14 -15
- package/bin/{relinka-impl → core-impl}/deprecated/utils/string.d.ts +50 -50
- package/bin/{relinka-impl → core-impl}/deprecated/utils/tree.d.ts +41 -41
- package/bin/{relinka-impl → core-impl}/impl-mod.d.ts +19 -19
- package/bin/{relinka-impl → core-impl}/impl-mod.js +4 -0
- package/bin/{relinka-types.d.ts → core-types.d.ts} +193 -194
- package/bin/main.d.ts +22 -22
- package/bin/main.js +18 -18
- package/package.json +3 -3
- /package/bin/{relinka-impl → core-impl}/deprecated/components/levels/levels.js +0 -0
- /package/bin/{relinka-impl → core-impl}/deprecated/components/modes/basic.js +0 -0
- /package/bin/{relinka-impl → core-impl}/deprecated/components/modes/browser.js +0 -0
- /package/bin/{relinka-impl → core-impl}/deprecated/components/modes/shared.js +0 -0
- /package/bin/{relinka-impl → core-impl}/deprecated/components/relinka-deprecated/logger.js +0 -0
- /package/bin/{relinka-impl → core-impl}/deprecated/components/relinka-deprecated/mod.js +0 -0
- /package/bin/{relinka-impl → core-impl}/deprecated/components/relinka-deprecated/relinka.js +0 -0
- /package/bin/{relinka-impl → core-impl}/deprecated/components/relinka-deprecated/relinka.test.js +0 -0
- /package/bin/{relinka-impl → core-impl}/deprecated/components/reporters/basic.js +0 -0
- /package/bin/{relinka-impl → core-impl}/deprecated/components/reporters/browser.js +0 -0
- /package/bin/{relinka-impl → core-impl}/deprecated/components/reporters/fancy.js +0 -0
- /package/bin/{relinka-impl → core-impl}/deprecated/utils/box.js +0 -0
- /package/bin/{relinka-impl → core-impl}/deprecated/utils/deprecatedColors.js +0 -0
- /package/bin/{relinka-impl → core-impl}/deprecated/utils/error.js +0 -0
- /package/bin/{relinka-impl → core-impl}/deprecated/utils/format.js +0 -0
- /package/bin/{relinka-impl → core-impl}/deprecated/utils/log.js +0 -0
- /package/bin/{relinka-impl → core-impl}/deprecated/utils/stream.js +0 -0
- /package/bin/{relinka-impl → core-impl}/deprecated/utils/string.js +0 -0
- /package/bin/{relinka-impl → core-impl}/deprecated/utils/tree.js +0 -0
- /package/bin/{relinka-types.js → core-types.js} +0 -0
|
@@ -1,114 +1,114 @@
|
|
|
1
|
-
export type BoxBorderStyle = {
|
|
2
|
-
/**
|
|
3
|
-
* Top left corner
|
|
4
|
-
* @example `┌`
|
|
5
|
-
* @example `╔`
|
|
6
|
-
* @example `╓`
|
|
7
|
-
*/
|
|
8
|
-
tl: string;
|
|
9
|
-
/**
|
|
10
|
-
* Top right corner
|
|
11
|
-
* @example `┐`
|
|
12
|
-
* @example `╗`
|
|
13
|
-
* @example `╖`
|
|
14
|
-
*/
|
|
15
|
-
tr: string;
|
|
16
|
-
/**
|
|
17
|
-
* Bottom left corner
|
|
18
|
-
* @example `└`
|
|
19
|
-
* @example `╚`
|
|
20
|
-
* @example `╙`
|
|
21
|
-
*/
|
|
22
|
-
bl: string;
|
|
23
|
-
/**
|
|
24
|
-
* Bottom right corner
|
|
25
|
-
* @example `┘`
|
|
26
|
-
* @example `╝`
|
|
27
|
-
* @example `╜`
|
|
28
|
-
*/
|
|
29
|
-
br: string;
|
|
30
|
-
/**
|
|
31
|
-
* Horizontal line
|
|
32
|
-
* @example `─`
|
|
33
|
-
* @example `═`
|
|
34
|
-
* @example `─`
|
|
35
|
-
*/
|
|
36
|
-
h: string;
|
|
37
|
-
/**
|
|
38
|
-
* Vertical line
|
|
39
|
-
* @example `│`
|
|
40
|
-
* @example `║`
|
|
41
|
-
* @example `║`
|
|
42
|
-
*/
|
|
43
|
-
v: string;
|
|
44
|
-
};
|
|
45
|
-
declare const boxStylePresets: Record<string, BoxBorderStyle>;
|
|
46
|
-
export type BoxStyle = {
|
|
47
|
-
/**
|
|
48
|
-
* The border color
|
|
49
|
-
* @default 'white'
|
|
50
|
-
*/
|
|
51
|
-
borderColor: "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white" | "gray" | "blackBright" | "redBright" | "greenBright" | "yellowBright" | "blueBright" | "magentaBright" | "cyanBright" | "whiteBright";
|
|
52
|
-
/**
|
|
53
|
-
* The border style
|
|
54
|
-
* @default 'solid'
|
|
55
|
-
* @example 'single-double-rounded'
|
|
56
|
-
* @example
|
|
57
|
-
* ```ts
|
|
58
|
-
* {
|
|
59
|
-
* tl: '┌',
|
|
60
|
-
* tr: '┐',
|
|
61
|
-
* bl: '└',
|
|
62
|
-
* br: '┘',
|
|
63
|
-
* h: '─',
|
|
64
|
-
* v: '│',
|
|
65
|
-
* }
|
|
66
|
-
* ```
|
|
67
|
-
*/
|
|
68
|
-
borderStyle: BoxBorderStyle | keyof typeof boxStylePresets;
|
|
69
|
-
/**
|
|
70
|
-
* The vertical alignment of the text
|
|
71
|
-
* @default 'center'
|
|
72
|
-
*/
|
|
73
|
-
valign: "top" | "center" | "bottom";
|
|
74
|
-
/**
|
|
75
|
-
* The padding of the box
|
|
76
|
-
* @default 2
|
|
77
|
-
*/
|
|
78
|
-
padding: number;
|
|
79
|
-
/**
|
|
80
|
-
* The left margin of the box
|
|
81
|
-
* @default 1
|
|
82
|
-
*/
|
|
83
|
-
marginLeft: number;
|
|
84
|
-
/**
|
|
85
|
-
* The top margin of the box
|
|
86
|
-
* @default 1
|
|
87
|
-
*/
|
|
88
|
-
marginTop: number;
|
|
89
|
-
/**
|
|
90
|
-
* The top margin of the box
|
|
91
|
-
* @default 1
|
|
92
|
-
*/
|
|
93
|
-
marginBottom: number;
|
|
94
|
-
};
|
|
95
|
-
/**
|
|
96
|
-
* The border options of the box
|
|
97
|
-
*/
|
|
98
|
-
export type BoxOpts = {
|
|
99
|
-
/**
|
|
100
|
-
* Title that will be displayed on top of the box
|
|
101
|
-
* @example 'Hello World'
|
|
102
|
-
* @example 'Hello {name}'
|
|
103
|
-
*/
|
|
104
|
-
title?: string;
|
|
105
|
-
style?: Partial<BoxStyle>;
|
|
106
|
-
};
|
|
107
|
-
/**
|
|
108
|
-
* Creates a styled box with text content, customizable via options.
|
|
109
|
-
* @param {string} text - The text to display in the box.
|
|
110
|
-
* @param {BoxOpts} [_opts={}] - Optional settings for the appearance and behavior of the box. See {@link BoxOpts}.
|
|
111
|
-
* @returns {string} The formatted box as a string, ready for printing or logging.
|
|
112
|
-
*/
|
|
113
|
-
export declare function box(text: string, _opts?: BoxOpts): string;
|
|
114
|
-
export {};
|
|
1
|
+
export type BoxBorderStyle = {
|
|
2
|
+
/**
|
|
3
|
+
* Top left corner
|
|
4
|
+
* @example `┌`
|
|
5
|
+
* @example `╔`
|
|
6
|
+
* @example `╓`
|
|
7
|
+
*/
|
|
8
|
+
tl: string;
|
|
9
|
+
/**
|
|
10
|
+
* Top right corner
|
|
11
|
+
* @example `┐`
|
|
12
|
+
* @example `╗`
|
|
13
|
+
* @example `╖`
|
|
14
|
+
*/
|
|
15
|
+
tr: string;
|
|
16
|
+
/**
|
|
17
|
+
* Bottom left corner
|
|
18
|
+
* @example `└`
|
|
19
|
+
* @example `╚`
|
|
20
|
+
* @example `╙`
|
|
21
|
+
*/
|
|
22
|
+
bl: string;
|
|
23
|
+
/**
|
|
24
|
+
* Bottom right corner
|
|
25
|
+
* @example `┘`
|
|
26
|
+
* @example `╝`
|
|
27
|
+
* @example `╜`
|
|
28
|
+
*/
|
|
29
|
+
br: string;
|
|
30
|
+
/**
|
|
31
|
+
* Horizontal line
|
|
32
|
+
* @example `─`
|
|
33
|
+
* @example `═`
|
|
34
|
+
* @example `─`
|
|
35
|
+
*/
|
|
36
|
+
h: string;
|
|
37
|
+
/**
|
|
38
|
+
* Vertical line
|
|
39
|
+
* @example `│`
|
|
40
|
+
* @example `║`
|
|
41
|
+
* @example `║`
|
|
42
|
+
*/
|
|
43
|
+
v: string;
|
|
44
|
+
};
|
|
45
|
+
declare const boxStylePresets: Record<string, BoxBorderStyle>;
|
|
46
|
+
export type BoxStyle = {
|
|
47
|
+
/**
|
|
48
|
+
* The border color
|
|
49
|
+
* @default 'white'
|
|
50
|
+
*/
|
|
51
|
+
borderColor: "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white" | "gray" | "blackBright" | "redBright" | "greenBright" | "yellowBright" | "blueBright" | "magentaBright" | "cyanBright" | "whiteBright";
|
|
52
|
+
/**
|
|
53
|
+
* The border style
|
|
54
|
+
* @default 'solid'
|
|
55
|
+
* @example 'single-double-rounded'
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* {
|
|
59
|
+
* tl: '┌',
|
|
60
|
+
* tr: '┐',
|
|
61
|
+
* bl: '└',
|
|
62
|
+
* br: '┘',
|
|
63
|
+
* h: '─',
|
|
64
|
+
* v: '│',
|
|
65
|
+
* }
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
borderStyle: BoxBorderStyle | keyof typeof boxStylePresets;
|
|
69
|
+
/**
|
|
70
|
+
* The vertical alignment of the text
|
|
71
|
+
* @default 'center'
|
|
72
|
+
*/
|
|
73
|
+
valign: "top" | "center" | "bottom";
|
|
74
|
+
/**
|
|
75
|
+
* The padding of the box
|
|
76
|
+
* @default 2
|
|
77
|
+
*/
|
|
78
|
+
padding: number;
|
|
79
|
+
/**
|
|
80
|
+
* The left margin of the box
|
|
81
|
+
* @default 1
|
|
82
|
+
*/
|
|
83
|
+
marginLeft: number;
|
|
84
|
+
/**
|
|
85
|
+
* The top margin of the box
|
|
86
|
+
* @default 1
|
|
87
|
+
*/
|
|
88
|
+
marginTop: number;
|
|
89
|
+
/**
|
|
90
|
+
* The top margin of the box
|
|
91
|
+
* @default 1
|
|
92
|
+
*/
|
|
93
|
+
marginBottom: number;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* The border options of the box
|
|
97
|
+
*/
|
|
98
|
+
export type BoxOpts = {
|
|
99
|
+
/**
|
|
100
|
+
* Title that will be displayed on top of the box
|
|
101
|
+
* @example 'Hello World'
|
|
102
|
+
* @example 'Hello {name}'
|
|
103
|
+
*/
|
|
104
|
+
title?: string;
|
|
105
|
+
style?: Partial<BoxStyle>;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Creates a styled box with text content, customizable via options.
|
|
109
|
+
* @param {string} text - The text to display in the box.
|
|
110
|
+
* @param {BoxOpts} [_opts={}] - Optional settings for the appearance and behavior of the box. See {@link BoxOpts}.
|
|
111
|
+
* @returns {string} The formatted box as a string, ready for printing or logging.
|
|
112
|
+
*/
|
|
113
|
+
export declare function box(text: string, _opts?: BoxOpts): string;
|
|
114
|
+
export {};
|
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Based on https://github.com/jorgebucaran/colorette
|
|
3
|
-
* Read LICENSE file for more information
|
|
4
|
-
* https://github.com/jorgebucaran/colorette/blob/20fc196d07d0f87c61e0256eadd7831c79b24108/index.js
|
|
5
|
-
*/
|
|
6
|
-
declare const colorDefs: {
|
|
7
|
-
reset: (string: string) => string;
|
|
8
|
-
bold: (string: string) => string;
|
|
9
|
-
dim: (string: string) => string;
|
|
10
|
-
italic: (string: string) => string;
|
|
11
|
-
underline: (string: string) => string;
|
|
12
|
-
inverse: (string: string) => string;
|
|
13
|
-
hidden: (string: string) => string;
|
|
14
|
-
strikethrough: (string: string) => string;
|
|
15
|
-
black: (string: string) => string;
|
|
16
|
-
red: (string: string) => string;
|
|
17
|
-
green: (string: string) => string;
|
|
18
|
-
yellow: (string: string) => string;
|
|
19
|
-
blue: (string: string) => string;
|
|
20
|
-
magenta: (string: string) => string;
|
|
21
|
-
cyan: (string: string) => string;
|
|
22
|
-
white: (string: string) => string;
|
|
23
|
-
gray: (string: string) => string;
|
|
24
|
-
bgBlack: (string: string) => string;
|
|
25
|
-
bgRed: (string: string) => string;
|
|
26
|
-
bgGreen: (string: string) => string;
|
|
27
|
-
bgYellow: (string: string) => string;
|
|
28
|
-
bgBlue: (string: string) => string;
|
|
29
|
-
bgMagenta: (string: string) => string;
|
|
30
|
-
bgCyan: (string: string) => string;
|
|
31
|
-
bgWhite: (string: string) => string;
|
|
32
|
-
blackBright: (string: string) => string;
|
|
33
|
-
redBright: (string: string) => string;
|
|
34
|
-
greenBright: (string: string) => string;
|
|
35
|
-
yellowBright: (string: string) => string;
|
|
36
|
-
blueBright: (string: string) => string;
|
|
37
|
-
magentaBright: (string: string) => string;
|
|
38
|
-
cyanBright: (string: string) => string;
|
|
39
|
-
whiteBright: (string: string) => string;
|
|
40
|
-
bgBlackBright: (string: string) => string;
|
|
41
|
-
bgRedBright: (string: string) => string;
|
|
42
|
-
bgGreenBright: (string: string) => string;
|
|
43
|
-
bgYellowBright: (string: string) => string;
|
|
44
|
-
bgBlueBright: (string: string) => string;
|
|
45
|
-
bgMagentaBright: (string: string) => string;
|
|
46
|
-
bgCyanBright: (string: string) => string;
|
|
47
|
-
bgWhiteBright: (string: string) => string;
|
|
48
|
-
};
|
|
49
|
-
export type ColorName = keyof typeof colorDefs;
|
|
50
|
-
export type ColorFunction = (text: string | number) => string;
|
|
51
|
-
/**
|
|
52
|
-
* An object containing functions for coloring text. Each function corresponds to a terminal color. See {@link ColorName} for available colors.
|
|
53
|
-
*/
|
|
54
|
-
export declare const colors: Record<
|
|
55
|
-
/**
|
|
56
|
-
* Gets a color function by name, with an option for a fallback color if the requested color is not found.
|
|
57
|
-
* @param {ColorName} color - The name of the color function to get. See {@link ColorName}.
|
|
58
|
-
* @param {ColorName} [fallback="reset"] - The name of the fallback color function if the requested color is not found. See {@link ColorName}.
|
|
59
|
-
* @returns {ColorFunction} The color function that corresponds to the requested color, or the fallback color function. See {@link ColorFunction}.
|
|
60
|
-
*/
|
|
61
|
-
export declare function getColor(color: ColorName, fallback?: ColorName): ColorFunction;
|
|
62
|
-
/**
|
|
63
|
-
* Applies a specified color to a given text string or number.
|
|
64
|
-
* @param {ColorName} color - The color to apply. See {@link ColorName}.
|
|
65
|
-
* @param {string | number} text - The text to color.
|
|
66
|
-
* @returns {string} The colored text.
|
|
67
|
-
*/
|
|
68
|
-
export declare function colorize(color: ColorName, text: string | number): string;
|
|
69
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* Based on https://github.com/jorgebucaran/colorette
|
|
3
|
+
* Read LICENSE file for more information
|
|
4
|
+
* https://github.com/jorgebucaran/colorette/blob/20fc196d07d0f87c61e0256eadd7831c79b24108/index.js
|
|
5
|
+
*/
|
|
6
|
+
declare const colorDefs: {
|
|
7
|
+
reset: (string: string) => string;
|
|
8
|
+
bold: (string: string) => string;
|
|
9
|
+
dim: (string: string) => string;
|
|
10
|
+
italic: (string: string) => string;
|
|
11
|
+
underline: (string: string) => string;
|
|
12
|
+
inverse: (string: string) => string;
|
|
13
|
+
hidden: (string: string) => string;
|
|
14
|
+
strikethrough: (string: string) => string;
|
|
15
|
+
black: (string: string) => string;
|
|
16
|
+
red: (string: string) => string;
|
|
17
|
+
green: (string: string) => string;
|
|
18
|
+
yellow: (string: string) => string;
|
|
19
|
+
blue: (string: string) => string;
|
|
20
|
+
magenta: (string: string) => string;
|
|
21
|
+
cyan: (string: string) => string;
|
|
22
|
+
white: (string: string) => string;
|
|
23
|
+
gray: (string: string) => string;
|
|
24
|
+
bgBlack: (string: string) => string;
|
|
25
|
+
bgRed: (string: string) => string;
|
|
26
|
+
bgGreen: (string: string) => string;
|
|
27
|
+
bgYellow: (string: string) => string;
|
|
28
|
+
bgBlue: (string: string) => string;
|
|
29
|
+
bgMagenta: (string: string) => string;
|
|
30
|
+
bgCyan: (string: string) => string;
|
|
31
|
+
bgWhite: (string: string) => string;
|
|
32
|
+
blackBright: (string: string) => string;
|
|
33
|
+
redBright: (string: string) => string;
|
|
34
|
+
greenBright: (string: string) => string;
|
|
35
|
+
yellowBright: (string: string) => string;
|
|
36
|
+
blueBright: (string: string) => string;
|
|
37
|
+
magentaBright: (string: string) => string;
|
|
38
|
+
cyanBright: (string: string) => string;
|
|
39
|
+
whiteBright: (string: string) => string;
|
|
40
|
+
bgBlackBright: (string: string) => string;
|
|
41
|
+
bgRedBright: (string: string) => string;
|
|
42
|
+
bgGreenBright: (string: string) => string;
|
|
43
|
+
bgYellowBright: (string: string) => string;
|
|
44
|
+
bgBlueBright: (string: string) => string;
|
|
45
|
+
bgMagentaBright: (string: string) => string;
|
|
46
|
+
bgCyanBright: (string: string) => string;
|
|
47
|
+
bgWhiteBright: (string: string) => string;
|
|
48
|
+
};
|
|
49
|
+
export type ColorName = keyof typeof colorDefs;
|
|
50
|
+
export type ColorFunction = (text: string | number) => string;
|
|
51
|
+
/**
|
|
52
|
+
* An object containing functions for coloring text. Each function corresponds to a terminal color. See {@link ColorName} for available colors.
|
|
53
|
+
*/
|
|
54
|
+
export declare const colors: Record<ColorName, ColorFunction>;
|
|
55
|
+
/**
|
|
56
|
+
* Gets a color function by name, with an option for a fallback color if the requested color is not found.
|
|
57
|
+
* @param {ColorName} color - The name of the color function to get. See {@link ColorName}.
|
|
58
|
+
* @param {ColorName} [fallback="reset"] - The name of the fallback color function if the requested color is not found. See {@link ColorName}.
|
|
59
|
+
* @returns {ColorFunction} The color function that corresponds to the requested color, or the fallback color function. See {@link ColorFunction}.
|
|
60
|
+
*/
|
|
61
|
+
export declare function getColor(color: ColorName, fallback?: ColorName): ColorFunction;
|
|
62
|
+
/**
|
|
63
|
+
* Applies a specified color to a given text string or number.
|
|
64
|
+
* @param {ColorName} color - The color to apply. See {@link ColorName}.
|
|
65
|
+
* @param {string | number} text - The text to color.
|
|
66
|
+
* @returns {string} The colored text.
|
|
67
|
+
*/
|
|
68
|
+
export declare function colorize(color: ColorName, text: string | number): string;
|
|
69
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parses a stack trace string and normalizes its paths by removing the current working directory and the "file://" protocol.
|
|
3
|
-
* @param {string} stack - The stack trace string.
|
|
4
|
-
* @returns {string[]} An array of stack trace lines with normalized paths.
|
|
5
|
-
*/
|
|
6
|
-
export declare function parseStack(stack: string): string[];
|
|
1
|
+
/**
|
|
2
|
+
* Parses a stack trace string and normalizes its paths by removing the current working directory and the "file://" protocol.
|
|
3
|
+
* @param {string} stack - The stack trace string.
|
|
4
|
+
* @returns {string[]} An array of stack trace lines with normalized paths.
|
|
5
|
+
*/
|
|
6
|
+
export declare function parseStack(stack: string): string[];
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Compiles a format string by replacing placeholders with appropriate position indices.
|
|
3
|
-
* Caches compiled formats for efficiency.
|
|
4
|
-
* @param {string} format - The format string containing the placeholders to replace.
|
|
5
|
-
* @returns {string} The compiled format string with placeholders replaced by positional indices.
|
|
6
|
-
*/
|
|
7
|
-
export declare function compileFormat(format: string): any;
|
|
8
|
-
/**
|
|
9
|
-
* Formats a string according to a custom format, using vsprintf for string formatting.
|
|
10
|
-
* @param {string} format - The custom format string.
|
|
11
|
-
* @param {any[]} argv - The arguments to format into the string.
|
|
12
|
-
* @returns {string} The formatted string.
|
|
13
|
-
*/
|
|
14
|
-
export declare function formatString(format: string, argv: any): string;
|
|
1
|
+
/**
|
|
2
|
+
* Compiles a format string by replacing placeholders with appropriate position indices.
|
|
3
|
+
* Caches compiled formats for efficiency.
|
|
4
|
+
* @param {string} format - The format string containing the placeholders to replace.
|
|
5
|
+
* @returns {string} The compiled format string with placeholders replaced by positional indices.
|
|
6
|
+
*/
|
|
7
|
+
export declare function compileFormat(format: string): any;
|
|
8
|
+
/**
|
|
9
|
+
* Formats a string according to a custom format, using vsprintf for string formatting.
|
|
10
|
+
* @param {string} format - The custom format string.
|
|
11
|
+
* @param {any[]} argv - The arguments to format into the string.
|
|
12
|
+
* @returns {string} The formatted string.
|
|
13
|
+
*/
|
|
14
|
+
export declare function formatString(format: string, argv: any): string;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks if the given argument is a simple JavaScript object.
|
|
3
|
-
* @param {any} obj - The object to test.
|
|
4
|
-
* @returns {boolean} `true` if the argument is a plain object, otherwise `false`.
|
|
5
|
-
*/
|
|
6
|
-
export declare function isPlainObject(obj: any): boolean;
|
|
7
|
-
/**
|
|
8
|
-
* Determines whether the given argument is a protocol object. A log object must be a simple object and
|
|
9
|
-
* must contain either a 'message' or 'args' field, but not a 'stack' field.
|
|
10
|
-
* @param {any} arg - The argument to check.
|
|
11
|
-
* @returns {boolean} `true` if the argument is a log object according to the specified criteria, otherwise `false`.
|
|
12
|
-
*/
|
|
13
|
-
export declare function isLogObj(arg: any): boolean;
|
|
1
|
+
/**
|
|
2
|
+
* Checks if the given argument is a simple JavaScript object.
|
|
3
|
+
* @param {any} obj - The object to test.
|
|
4
|
+
* @returns {boolean} `true` if the argument is a plain object, otherwise `false`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isPlainObject(obj: any): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Determines whether the given argument is a protocol object. A log object must be a simple object and
|
|
9
|
+
* must contain either a 'message' or 'args' field, but not a 'stack' field.
|
|
10
|
+
* @param {any} arg - The argument to check.
|
|
11
|
+
* @returns {boolean} `true` if the argument is a log object according to the specified criteria, otherwise `false`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isLogObj(arg: any): boolean;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export declare function writeStream(data: any, stream: NodeJS.WriteStream): any;
|
|
1
|
+
/**
|
|
2
|
+
* Writes data to a specified NodeJS writable stream. This function supports streams that have a custom
|
|
3
|
+
* `__write' method, and will fall back to the default `write' method if `__write' is not present.
|
|
4
|
+
*
|
|
5
|
+
* @param {any} data - The data to write to the stream. This can be a string, a buffer, or any data type
|
|
6
|
+
* supported by the stream's `write' or `__write' method.
|
|
7
|
+
* @param {NodeJS.WriteStream} stream - The writable stream to write the data to. This stream
|
|
8
|
+
* must implement the `write' method, and can optionally implement a custom `__write' method.
|
|
9
|
+
* @returns {boolean} `true` if the data has been completely processed by the write operation,
|
|
10
|
+
* indicating that further writes can be performed immediately. Returns `false` if the data is
|
|
11
|
+
* buffered by the stream, indicating that the `drain` event should be waited for before writing
|
|
12
|
+
* more data.
|
|
13
|
+
*/
|
|
14
|
+
export declare function writeStream(data: any, stream: NodeJS.WriteStream): any;
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Removes ANSI escape codes from a given string. This is particularly useful for
|
|
3
|
-
* processing text that contains formatting codes, such as colors or styles, so that the
|
|
4
|
-
* the raw text without any visual formatting.
|
|
5
|
-
*
|
|
6
|
-
* @param {string} text - The text string from which to strip the ANSI escape codes.
|
|
7
|
-
* @returns {string} The text without ANSI escape codes.
|
|
8
|
-
*/
|
|
9
|
-
export declare function stripAnsi(text: string): string;
|
|
10
|
-
/**
|
|
11
|
-
* Centers a string within a specified total width, padding it with spaces or another specified character.
|
|
12
|
-
* If the string is longer than the total width, it is returned as is.
|
|
13
|
-
*
|
|
14
|
-
* @param {string} str - The string to centre.
|
|
15
|
-
* @param {number} len - The total width in which to centre the string.
|
|
16
|
-
* @param {string} [space=" "] - The character to use for padding. Defaults to a space.
|
|
17
|
-
* @returns {string} The centred string.
|
|
18
|
-
*/
|
|
19
|
-
export declare function centerAlign(str: string, len: number, space?: string): string;
|
|
20
|
-
/**
|
|
21
|
-
* Right-justifies a string within a given total width, padding it with whitespace or another specified character.
|
|
22
|
-
* If the string is longer than the total width, it is returned as is.
|
|
23
|
-
*
|
|
24
|
-
* @param {string} str - The string to right-justify.
|
|
25
|
-
* @param {number} len - The total width to align the string.
|
|
26
|
-
* @param {string} [space=" "] - The character to use for padding. Defaults to a space.
|
|
27
|
-
* @returns {string} The right-justified string.
|
|
28
|
-
*/
|
|
29
|
-
export declare function rightAlign(str: string, len: number, space?: string): string;
|
|
30
|
-
/**
|
|
31
|
-
* Left-aligns a string within a given total width, padding it with whitespace or another specified character on the right.
|
|
32
|
-
* If the string is longer than the total width, it is returned as is.
|
|
33
|
-
*
|
|
34
|
-
* @param {string} str - The string to align left.
|
|
35
|
-
* @param {number} len - The total width to align the string.
|
|
36
|
-
* @param {string} [space=" "] - The character to use for padding. Defaults to a space.
|
|
37
|
-
* @returns {string} The left-justified string.
|
|
38
|
-
*/
|
|
39
|
-
export declare function leftAlign(str: string, len: number, space?: string): string;
|
|
40
|
-
/**
|
|
41
|
-
* Aligns a string (left, right, or centre) within a given total width, padding it with spaces or another specified character.
|
|
42
|
-
* If the string is longer than the total width, it is returned as is. This function acts as a wrapper for individual alignment functions.
|
|
43
|
-
*
|
|
44
|
-
* @param {"left" | "right" | "centre"} alignment - The desired alignment of the string.
|
|
45
|
-
* @param {string} str - The string to align.
|
|
46
|
-
* @param {number} len - The total width in which to align the string.
|
|
47
|
-
* @param {string} [space=" "] - The character to use for padding. Defaults to a space.
|
|
48
|
-
* @returns {string} The aligned string, according to the given alignment.
|
|
49
|
-
*/
|
|
50
|
-
export declare function align(alignment: "left" | "right" | "center", str: string, len: number, space?: string): string;
|
|
1
|
+
/**
|
|
2
|
+
* Removes ANSI escape codes from a given string. This is particularly useful for
|
|
3
|
+
* processing text that contains formatting codes, such as colors or styles, so that the
|
|
4
|
+
* the raw text without any visual formatting.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} text - The text string from which to strip the ANSI escape codes.
|
|
7
|
+
* @returns {string} The text without ANSI escape codes.
|
|
8
|
+
*/
|
|
9
|
+
export declare function stripAnsi(text: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Centers a string within a specified total width, padding it with spaces or another specified character.
|
|
12
|
+
* If the string is longer than the total width, it is returned as is.
|
|
13
|
+
*
|
|
14
|
+
* @param {string} str - The string to centre.
|
|
15
|
+
* @param {number} len - The total width in which to centre the string.
|
|
16
|
+
* @param {string} [space=" "] - The character to use for padding. Defaults to a space.
|
|
17
|
+
* @returns {string} The centred string.
|
|
18
|
+
*/
|
|
19
|
+
export declare function centerAlign(str: string, len: number, space?: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Right-justifies a string within a given total width, padding it with whitespace or another specified character.
|
|
22
|
+
* If the string is longer than the total width, it is returned as is.
|
|
23
|
+
*
|
|
24
|
+
* @param {string} str - The string to right-justify.
|
|
25
|
+
* @param {number} len - The total width to align the string.
|
|
26
|
+
* @param {string} [space=" "] - The character to use for padding. Defaults to a space.
|
|
27
|
+
* @returns {string} The right-justified string.
|
|
28
|
+
*/
|
|
29
|
+
export declare function rightAlign(str: string, len: number, space?: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Left-aligns a string within a given total width, padding it with whitespace or another specified character on the right.
|
|
32
|
+
* If the string is longer than the total width, it is returned as is.
|
|
33
|
+
*
|
|
34
|
+
* @param {string} str - The string to align left.
|
|
35
|
+
* @param {number} len - The total width to align the string.
|
|
36
|
+
* @param {string} [space=" "] - The character to use for padding. Defaults to a space.
|
|
37
|
+
* @returns {string} The left-justified string.
|
|
38
|
+
*/
|
|
39
|
+
export declare function leftAlign(str: string, len: number, space?: string): string;
|
|
40
|
+
/**
|
|
41
|
+
* Aligns a string (left, right, or centre) within a given total width, padding it with spaces or another specified character.
|
|
42
|
+
* If the string is longer than the total width, it is returned as is. This function acts as a wrapper for individual alignment functions.
|
|
43
|
+
*
|
|
44
|
+
* @param {"left" | "right" | "centre"} alignment - The desired alignment of the string.
|
|
45
|
+
* @param {string} str - The string to align.
|
|
46
|
+
* @param {number} len - The total width in which to align the string.
|
|
47
|
+
* @param {string} [space=" "] - The character to use for padding. Defaults to a space.
|
|
48
|
+
* @returns {string} The aligned string, according to the given alignment.
|
|
49
|
+
*/
|
|
50
|
+
export declare function align(alignment: "left" | "right" | "center", str: string, len: number, space?: string): string;
|