@reliverse/relinka 1.3.7 → 1.4.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/README.md +197 -70
- package/bin/{relinka-impl/deprecated → deprecated}/components/levels/levels.d.ts +13 -13
- package/bin/{relinka-impl/deprecated → deprecated}/components/modes/basic.d.ts +19 -19
- package/bin/{relinka-impl/deprecated → deprecated}/components/modes/browser.d.ts +19 -19
- package/bin/deprecated/components/modes/shared.d.ts +2 -0
- package/bin/deprecated/components/modes/shared.js +1 -0
- package/bin/{relinka-impl/deprecated → deprecated}/components/relinka-deprecated/logger.d.ts +5 -5
- package/bin/{relinka-impl/deprecated → deprecated}/components/relinka-deprecated/mod.d.ts +20 -20
- package/bin/{relinka-impl/deprecated → deprecated}/components/relinka-deprecated/relinka.d.ts +140 -141
- package/bin/{relinka-impl/deprecated → deprecated}/components/reporters/basic.d.ts +11 -11
- package/bin/{relinka-impl/deprecated → deprecated}/components/reporters/browser.d.ts +10 -10
- package/bin/{relinka-impl/deprecated → deprecated}/components/reporters/fancy.d.ts +10 -10
- package/bin/{relinka-impl/deprecated → deprecated}/components/reporters/fancy.js +1 -3
- package/bin/deprecated/impl-old.js +0 -0
- package/bin/{relinka-types.d.ts → deprecated/types.d.ts} +161 -194
- package/bin/deprecated/types.js +0 -0
- package/bin/{relinka-impl/deprecated → deprecated}/utils/box.d.ts +114 -114
- package/bin/{relinka-impl/deprecated → deprecated}/utils/deprecatedColors.d.ts +69 -69
- package/bin/{relinka-impl/deprecated → deprecated}/utils/error.d.ts +6 -6
- package/bin/{relinka-impl/deprecated → deprecated}/utils/format.d.ts +14 -14
- package/bin/{relinka-impl/deprecated → deprecated}/utils/log.d.ts +13 -13
- package/bin/{relinka-impl/deprecated → deprecated}/utils/stream.d.ts +14 -15
- package/bin/{relinka-impl/deprecated → deprecated}/utils/string.d.ts +50 -50
- package/bin/{relinka-impl/deprecated → deprecated}/utils/tree.d.ts +41 -41
- package/bin/impl.d.ts +149 -0
- package/bin/impl.js +606 -0
- package/bin/main.d.ts +24 -22
- package/bin/main.js +24 -21
- package/bin/types.d.ts +0 -0
- package/bin/types.js +0 -0
- package/package.json +43 -8
- package/bin/relinka-impl/deprecated/components/modes/shared.d.ts +0 -2
- package/bin/relinka-impl/deprecated/components/modes/shared.js +0 -4
- package/bin/relinka-impl/deprecated/components/relinka-deprecated/relinka.test.d.ts +0 -1
- package/bin/relinka-impl/deprecated/components/relinka-deprecated/relinka.test.js +0 -57
- package/bin/relinka-impl/impl-mod.d.ts +0 -19
- package/bin/relinka-impl/impl-mod.js +0 -317
- /package/bin/{relinka-impl/deprecated → deprecated}/components/levels/levels.js +0 -0
- /package/bin/{relinka-impl/deprecated → deprecated}/components/modes/basic.js +0 -0
- /package/bin/{relinka-impl/deprecated → deprecated}/components/modes/browser.js +0 -0
- /package/bin/{relinka-impl/deprecated → deprecated}/components/relinka-deprecated/logger.js +0 -0
- /package/bin/{relinka-impl/deprecated → deprecated}/components/relinka-deprecated/mod.js +0 -0
- /package/bin/{relinka-impl/deprecated → deprecated}/components/relinka-deprecated/relinka.js +0 -0
- /package/bin/{relinka-impl/deprecated → deprecated}/components/reporters/basic.js +0 -0
- /package/bin/{relinka-impl/deprecated → deprecated}/components/reporters/browser.js +0 -0
- /package/bin/{relinka-types.js → deprecated/impl-old.d.ts} +0 -0
- /package/bin/{relinka-impl/deprecated → deprecated}/utils/box.js +0 -0
- /package/bin/{relinka-impl/deprecated → deprecated}/utils/deprecatedColors.js +0 -0
- /package/bin/{relinka-impl/deprecated → deprecated}/utils/error.js +0 -0
- /package/bin/{relinka-impl/deprecated → deprecated}/utils/format.js +0 -0
- /package/bin/{relinka-impl/deprecated → deprecated}/utils/log.js +0 -0
- /package/bin/{relinka-impl/deprecated → deprecated}/utils/stream.js +0 -0
- /package/bin/{relinka-impl/deprecated → deprecated}/utils/string.js +0 -0
- /package/bin/{relinka-impl/deprecated → deprecated}/utils/tree.js +0 -0
|
@@ -1,194 +1,161 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
*
|
|
67
|
-
*/
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
*
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
*
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
*
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
*
|
|
86
|
-
*/
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
*
|
|
141
|
-
*/
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
*
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
*
|
|
155
|
-
* @
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
*/
|
|
163
|
-
level: LogLevelDeprecated;
|
|
164
|
-
/**
|
|
165
|
-
* The type of log message, overridden if required. See {@link LogTypeDeprecated}.
|
|
166
|
-
*/
|
|
167
|
-
type: LogTypeDeprecated;
|
|
168
|
-
/**
|
|
169
|
-
* A string tag to categorize or identify the log message, overridden if necessary.
|
|
170
|
-
*/
|
|
171
|
-
tag: string;
|
|
172
|
-
/**
|
|
173
|
-
* Additional arguments to be logged with the message, overridden if necessary.
|
|
174
|
-
*/
|
|
175
|
-
args: any[];
|
|
176
|
-
/**
|
|
177
|
-
* The date and time the log message was created, overridden if necessary.
|
|
178
|
-
*/
|
|
179
|
-
date: Date;
|
|
180
|
-
/**
|
|
181
|
-
* Allows additional custom properties to be set on the log object.
|
|
182
|
-
*/
|
|
183
|
-
[key: string]: unknown;
|
|
184
|
-
} & InputLogObject;
|
|
185
|
-
export type RelinkaReporterDeprecated = {
|
|
186
|
-
/**
|
|
187
|
-
* Defines how a log message is processed and displayed by this reporter.
|
|
188
|
-
* @param logObj The LogObject containing the log information to process. See {@link LogObject}.
|
|
189
|
-
* @param ctx An object containing context information such as options. See {@link RelinkaOptionsDeprecated}.
|
|
190
|
-
*/
|
|
191
|
-
log: (logObj: LogObject, ctx: {
|
|
192
|
-
options: RelinkaOptionsDeprecated;
|
|
193
|
-
}) => void;
|
|
194
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Defines the level of logs as specific numbers or special number types.
|
|
3
|
+
*
|
|
4
|
+
* @type {0 | 1 | 2 | 3 | 4 | 5 | (number & {})} LogLevelDeprecated - Represents the log level.
|
|
5
|
+
* @default 0 - Represents the default log level.
|
|
6
|
+
*/
|
|
7
|
+
export type LogLevelDeprecated = 0 | 1 | 2 | 3 | 4 | 5 | (number & {});
|
|
8
|
+
/**
|
|
9
|
+
* Lists the types of log messages supported by the system.
|
|
10
|
+
*
|
|
11
|
+
* @type {"silent" | "fatal" | "error" | "warn" | "log" | "info" | "success" | "fail" | "ready" | "start" | "box" | "debug" | "trace" | "verbose"} LogTypeDeprecated - Represents the specific type of log message.
|
|
12
|
+
*/
|
|
13
|
+
export type LogTypeDeprecated = "silent" | "fatal" | "error" | "warn" | "log" | "info" | "success" | "fail" | "ready" | "start" | "box" | "debug" | "trace" | "verbose";
|
|
14
|
+
export type RelinkaOptionsDeprecated = {
|
|
15
|
+
/**
|
|
16
|
+
* An array of RelinkaReporterDeprecated instances used to handle and output log messages.
|
|
17
|
+
*/
|
|
18
|
+
reporters: RelinkaReporterDeprecated[];
|
|
19
|
+
/**
|
|
20
|
+
* A record mapping LogTypeDeprecated to InputLogObject, defining the log configuration for each log type.
|
|
21
|
+
* See {@link LogTypeDeprecated} and {@link InputLogObject}.
|
|
22
|
+
*/
|
|
23
|
+
types: Record<LogTypeDeprecated, InputLogObject>;
|
|
24
|
+
/**
|
|
25
|
+
* The minimum log level to output. See {@link LogLevelDeprecated}.
|
|
26
|
+
*/
|
|
27
|
+
level: LogLevelDeprecated;
|
|
28
|
+
/**
|
|
29
|
+
* Default properties applied to all log messages unless overridden. See {@link InputLogObject}.
|
|
30
|
+
*/
|
|
31
|
+
defaults: InputLogObject;
|
|
32
|
+
/**
|
|
33
|
+
* The maximum number of times a log message can be repeated within a given timeframe.
|
|
34
|
+
*/
|
|
35
|
+
throttle: number;
|
|
36
|
+
/**
|
|
37
|
+
* The minimum time in milliseconds that must elapse before a throttled log message can be logged again.
|
|
38
|
+
*/
|
|
39
|
+
throttleMin: number;
|
|
40
|
+
/**
|
|
41
|
+
* The Node.js writable stream for standard output. See {@link NodeJS.WriteStream}.
|
|
42
|
+
* @optional
|
|
43
|
+
*/
|
|
44
|
+
stdout?: NodeJS.WriteStream;
|
|
45
|
+
/**
|
|
46
|
+
* The Node.js writeable stream for standard error output. See {@link NodeJS.WriteStream}.
|
|
47
|
+
* @optional
|
|
48
|
+
*/
|
|
49
|
+
stderr?: NodeJS.WriteStream;
|
|
50
|
+
/**
|
|
51
|
+
* A function that allows you to mock log messages for testing purposes.
|
|
52
|
+
* @optional
|
|
53
|
+
*/
|
|
54
|
+
mockFn?: (type: LogTypeDeprecated, defaults: InputLogObject) => (...args: any) => void;
|
|
55
|
+
/**
|
|
56
|
+
* Configuration options for formatting log messages. See {@link FormatOptions}.
|
|
57
|
+
*/
|
|
58
|
+
formatOptions: FormatOptions;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* @see https://nodejs.org/api/util.html#util_util_inspect_object_showhidden_depth_colors
|
|
62
|
+
*/
|
|
63
|
+
export type FormatOptions = {
|
|
64
|
+
/**
|
|
65
|
+
* The maximum number of columns to output, affects formatting.
|
|
66
|
+
* @optional
|
|
67
|
+
*/
|
|
68
|
+
columns?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Whether to include timestamp information in log messages.
|
|
71
|
+
* @optional
|
|
72
|
+
*/
|
|
73
|
+
date?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Whether to use colors in the output.
|
|
76
|
+
* @optional
|
|
77
|
+
*/
|
|
78
|
+
colors?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Specifies whether or not the output should be compact. Accepts a boolean or numeric level of compactness.
|
|
81
|
+
* @optional
|
|
82
|
+
*/
|
|
83
|
+
compact?: boolean | number;
|
|
84
|
+
/**
|
|
85
|
+
* Allows additional custom formatting options.
|
|
86
|
+
*/
|
|
87
|
+
[key: string]: unknown;
|
|
88
|
+
};
|
|
89
|
+
export type InputLogObject = {
|
|
90
|
+
/**
|
|
91
|
+
* The logging level of the message. See {@link LogLevelDeprecated}.
|
|
92
|
+
* @optional
|
|
93
|
+
*/
|
|
94
|
+
level?: LogLevelDeprecated;
|
|
95
|
+
/**
|
|
96
|
+
* A string tag to categorize or identify the log message.
|
|
97
|
+
* @optional
|
|
98
|
+
*/
|
|
99
|
+
tag?: string;
|
|
100
|
+
/**
|
|
101
|
+
* The type of log message, which affects how it's processed and displayed. See {@link LogTypeDeprecated}.
|
|
102
|
+
* @optional
|
|
103
|
+
*/
|
|
104
|
+
type?: LogTypeDeprecated;
|
|
105
|
+
/**
|
|
106
|
+
* The main log message text.
|
|
107
|
+
* @optional
|
|
108
|
+
*/
|
|
109
|
+
message?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Additional text or texts to be logged with the message.
|
|
112
|
+
* @optional
|
|
113
|
+
*/
|
|
114
|
+
additional?: string | string[];
|
|
115
|
+
/**
|
|
116
|
+
* Additional arguments to be logged with the message.
|
|
117
|
+
* @optional
|
|
118
|
+
*/
|
|
119
|
+
args?: any[];
|
|
120
|
+
/**
|
|
121
|
+
* The date and time when the log message was created.
|
|
122
|
+
* @optional
|
|
123
|
+
*/
|
|
124
|
+
date?: Date;
|
|
125
|
+
};
|
|
126
|
+
export type LogObject = {
|
|
127
|
+
/**
|
|
128
|
+
* The logging level of the message, overridden if required. See {@link LogLevelDeprecated}.
|
|
129
|
+
*/
|
|
130
|
+
level: LogLevelDeprecated;
|
|
131
|
+
/**
|
|
132
|
+
* The type of log message, overridden if required. See {@link LogTypeDeprecated}.
|
|
133
|
+
*/
|
|
134
|
+
type: LogTypeDeprecated;
|
|
135
|
+
/**
|
|
136
|
+
* A string tag to categorize or identify the log message, overridden if necessary.
|
|
137
|
+
*/
|
|
138
|
+
tag: string;
|
|
139
|
+
/**
|
|
140
|
+
* Additional arguments to be logged with the message, overridden if necessary.
|
|
141
|
+
*/
|
|
142
|
+
args: any[];
|
|
143
|
+
/**
|
|
144
|
+
* The date and time the log message was created, overridden if necessary.
|
|
145
|
+
*/
|
|
146
|
+
date: Date;
|
|
147
|
+
/**
|
|
148
|
+
* Allows additional custom properties to be set on the log object.
|
|
149
|
+
*/
|
|
150
|
+
[key: string]: unknown;
|
|
151
|
+
} & InputLogObject;
|
|
152
|
+
export type RelinkaReporterDeprecated = {
|
|
153
|
+
/**
|
|
154
|
+
* Defines how a log message is processed and displayed by this reporter.
|
|
155
|
+
* @param logObj The LogObject containing the log information to process. See {@link LogObject}.
|
|
156
|
+
* @param ctx An object containing context information such as options. See {@link RelinkaOptionsDeprecated}.
|
|
157
|
+
*/
|
|
158
|
+
log: (logObj: LogObject, ctx: {
|
|
159
|
+
options: RelinkaOptionsDeprecated;
|
|
160
|
+
}) => void;
|
|
161
|
+
};
|
|
File without changes
|
|
@@ -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 {};
|