console-toolkit 1.2.8 → 1.2.10

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 (156) hide show
  1. package/README.md +70 -25
  2. package/package.json +26 -6
  3. package/src/alphanumeric/arrows.d.ts +48 -0
  4. package/src/alphanumeric/arrows.js +23 -0
  5. package/src/alphanumeric/fractions.d.ts +65 -0
  6. package/src/alphanumeric/fractions.js +49 -0
  7. package/src/alphanumeric/number-formatters.d.ts +91 -0
  8. package/src/alphanumeric/number-formatters.js +45 -1
  9. package/src/alphanumeric/roman.d.ts +15 -0
  10. package/src/alphanumeric/roman.js +12 -0
  11. package/src/alphanumeric/unicode-cultural-numbers.d.ts +65 -0
  12. package/src/alphanumeric/unicode-cultural-numbers.js +1 -0
  13. package/src/alphanumeric/unicode-letters.d.ts +32 -0
  14. package/src/alphanumeric/unicode-letters.js +8 -0
  15. package/src/alphanumeric/unicode-numbers.d.ts +44 -0
  16. package/src/alphanumeric/unicode-numbers.js +21 -0
  17. package/src/alphanumeric/utils.d.ts +45 -0
  18. package/src/alphanumeric/utils.js +26 -0
  19. package/src/ansi/csi.d.ts +141 -0
  20. package/src/ansi/csi.js +51 -2
  21. package/src/ansi/index.d.ts +26 -0
  22. package/src/ansi/sgr-constants.d.ts +173 -0
  23. package/src/ansi/sgr-state.d.ts +91 -0
  24. package/src/ansi/sgr-state.js +45 -0
  25. package/src/ansi/sgr.d.ts +587 -0
  26. package/src/ansi/sgr.js +426 -6
  27. package/src/box.d.ts +160 -0
  28. package/src/box.js +113 -12
  29. package/src/charts/bars/block-frac-grouped.d.ts +12 -0
  30. package/src/charts/bars/block-frac-grouped.js +6 -0
  31. package/src/charts/bars/block-frac.d.ts +34 -0
  32. package/src/charts/bars/block-frac.js +13 -0
  33. package/src/charts/bars/block-grouped.d.ts +12 -0
  34. package/src/charts/bars/block-grouped.js +6 -0
  35. package/src/charts/bars/block.d.ts +43 -0
  36. package/src/charts/bars/block.js +13 -0
  37. package/src/charts/bars/draw-grouped.d.ts +41 -0
  38. package/src/charts/bars/draw-grouped.js +4 -0
  39. package/src/charts/bars/draw-stacked.d.ts +47 -0
  40. package/src/charts/bars/draw-stacked.js +4 -0
  41. package/src/charts/bars/frac-grouped.d.ts +32 -0
  42. package/src/charts/bars/frac-grouped.js +13 -0
  43. package/src/charts/bars/plain-grouped.d.ts +12 -0
  44. package/src/charts/bars/plain-grouped.js +6 -0
  45. package/src/charts/bars/plain.d.ts +75 -0
  46. package/src/charts/bars/plain.js +27 -0
  47. package/src/charts/columns/block-frac-grouped.d.ts +12 -0
  48. package/src/charts/columns/block-frac-grouped.js +6 -0
  49. package/src/charts/columns/block-frac.d.ts +39 -0
  50. package/src/charts/columns/block-frac.js +13 -0
  51. package/src/charts/columns/block-grouped.d.ts +12 -0
  52. package/src/charts/columns/block-grouped.js +6 -0
  53. package/src/charts/columns/block.d.ts +43 -0
  54. package/src/charts/columns/block.js +13 -0
  55. package/src/charts/columns/draw-grouped.d.ts +41 -0
  56. package/src/charts/columns/draw-grouped.js +4 -0
  57. package/src/charts/columns/draw-stacked.d.ts +39 -0
  58. package/src/charts/columns/draw-stacked.js +4 -0
  59. package/src/charts/columns/frac-grouped.d.ts +37 -0
  60. package/src/charts/columns/frac-grouped.js +13 -0
  61. package/src/charts/columns/plain-grouped.d.ts +12 -0
  62. package/src/charts/columns/plain-grouped.js +6 -0
  63. package/src/charts/columns/plain.d.ts +32 -0
  64. package/src/charts/columns/plain.js +13 -0
  65. package/src/charts/themes/default.d.ts +6 -0
  66. package/src/charts/themes/default.js +1 -0
  67. package/src/charts/themes/rainbow-reversed.d.ts +6 -0
  68. package/src/charts/themes/rainbow-reversed.js +2 -1
  69. package/src/charts/themes/rainbow.d.ts +6 -0
  70. package/src/charts/themes/rainbow.js +1 -0
  71. package/src/charts/utils.d.ts +79 -0
  72. package/src/charts/utils.js +32 -4
  73. package/src/draw-block-frac.d.ts +16 -0
  74. package/src/draw-block-frac.js +14 -0
  75. package/src/draw-block.d.ts +53 -0
  76. package/src/draw-block.js +25 -1
  77. package/src/meta.d.ts +84 -0
  78. package/src/meta.js +64 -0
  79. package/src/output/show.d.ts +55 -0
  80. package/src/output/show.js +28 -0
  81. package/src/output/updater.d.ts +114 -0
  82. package/src/output/updater.js +58 -4
  83. package/src/output/writer.d.ts +87 -0
  84. package/src/output/writer.js +57 -5
  85. package/src/panel.d.ts +402 -0
  86. package/src/panel.js +219 -5
  87. package/src/plot/bitmap.d.ts +80 -0
  88. package/src/plot/bitmap.js +33 -4
  89. package/src/plot/draw-line.d.ts +13 -0
  90. package/src/plot/draw-line.js +8 -0
  91. package/src/plot/draw-rect.d.ts +13 -0
  92. package/src/plot/draw-rect.js +38 -30
  93. package/src/plot/index.d.ts +39 -0
  94. package/src/plot/index.js +22 -0
  95. package/src/plot/to-quads.d.ts +10 -0
  96. package/src/plot/to-quads.js +5 -0
  97. package/src/spinner/index.d.ts +4 -0
  98. package/src/spinner/index.js +0 -2
  99. package/src/spinner/spin.d.ts +13 -0
  100. package/src/spinner/spin.js +13 -2
  101. package/src/spinner/spinner.d.ts +69 -0
  102. package/src/spinner/spinner.js +30 -2
  103. package/src/spinner/spinners.d.ts +34 -0
  104. package/src/spinner/spinners.js +23 -9
  105. package/src/strings/clip.d.ts +21 -0
  106. package/src/strings/clip.js +10 -0
  107. package/src/strings/parse.d.ts +23 -0
  108. package/src/strings/parse.js +7 -0
  109. package/src/strings/split.d.ts +38 -0
  110. package/src/strings/split.js +15 -0
  111. package/src/strings.d.ts +44 -0
  112. package/src/strings.js +34 -4
  113. package/src/style.d.ts +462 -0
  114. package/src/style.js +58 -4
  115. package/src/symbols.d.ts +167 -0
  116. package/src/symbols.js +91 -7
  117. package/src/table/draw-borders.d.ts +38 -0
  118. package/src/table/draw-borders.js +10 -2
  119. package/src/table/index.d.ts +8 -0
  120. package/src/table/index.js +1 -0
  121. package/src/table/table.d.ts +234 -0
  122. package/src/table/table.js +59 -1
  123. package/src/themes/blocks/unicode-half.d.ts +6 -0
  124. package/src/themes/blocks/unicode-half.js +1 -0
  125. package/src/themes/blocks/unicode-thin.d.ts +6 -0
  126. package/src/themes/blocks/unicode-thin.js +1 -0
  127. package/src/themes/lines/ascii-compact.d.ts +6 -0
  128. package/src/themes/lines/ascii-compact.js +1 -0
  129. package/src/themes/lines/ascii-dots.d.ts +6 -0
  130. package/src/themes/lines/ascii-dots.js +1 -0
  131. package/src/themes/lines/ascii-girder.d.ts +6 -0
  132. package/src/themes/lines/ascii-girder.js +1 -0
  133. package/src/themes/lines/ascii-github.d.ts +6 -0
  134. package/src/themes/lines/ascii-github.js +1 -0
  135. package/src/themes/lines/ascii-reddit.d.ts +6 -0
  136. package/src/themes/lines/ascii-reddit.js +1 -0
  137. package/src/themes/lines/ascii-rounded.d.ts +6 -0
  138. package/src/themes/lines/ascii-rounded.js +1 -0
  139. package/src/themes/lines/ascii.d.ts +6 -0
  140. package/src/themes/lines/ascii.js +1 -0
  141. package/src/themes/lines/unicode-bold.d.ts +6 -0
  142. package/src/themes/lines/unicode-bold.js +1 -0
  143. package/src/themes/lines/unicode-rounded.d.ts +6 -0
  144. package/src/themes/lines/unicode-rounded.js +1 -0
  145. package/src/themes/lines/unicode.d.ts +6 -0
  146. package/src/themes/lines/unicode.js +1 -0
  147. package/src/themes/utils.d.ts +33 -0
  148. package/src/themes/utils.js +7 -0
  149. package/src/turtle/draw-line-art.d.ts +19 -0
  150. package/src/turtle/draw-line-art.js +7 -0
  151. package/src/turtle/draw-unicode.d.ts +19 -0
  152. package/src/turtle/draw-unicode.js +8 -0
  153. package/src/turtle/index.d.ts +21 -0
  154. package/src/turtle/index.js +8 -0
  155. package/src/turtle/turtle.d.ts +269 -0
  156. package/src/turtle/turtle.js +124 -4
@@ -0,0 +1,587 @@
1
+ /** RegExp matching SGR (Select Graphics Rendition) escape sequences. */
2
+ export const matchSgr: RegExp;
3
+
4
+ /** Standard color name-to-number mapping. */
5
+ export const Colors: {
6
+ BLACK: 0;
7
+ RED: 1;
8
+ GREEN: 2;
9
+ YELLOW: 3;
10
+ BLUE: 4;
11
+ MAGENTA: 5;
12
+ CYAN: 6;
13
+ WHITE: 7;
14
+ DEFAULT: 9;
15
+ };
16
+
17
+ /** SGR command code constants. */
18
+ export const Commands: {
19
+ RESET_ALL: string;
20
+ BOLD: string;
21
+ DIM: string;
22
+ ITALIC: string;
23
+ UNDERLINE: string;
24
+ BLINK: string;
25
+ RAPID_BLINK: string;
26
+ INVERSE: string;
27
+ HIDDEN: string;
28
+ STRIKETHROUGH: string;
29
+ DEFAULT_FONT: string;
30
+ RESET_FONT: string;
31
+ FONT_GOTHIC: string;
32
+ RESET_BOLD: string;
33
+ RESET_DIM: string;
34
+ RESET_ITALIC: string;
35
+ RESET_UNDERLINE: string;
36
+ RESET_BLINK: string;
37
+ RESET_RAPID_BLINK: string;
38
+ RESET_INVERSE: string;
39
+ RESET_HIDDEN: string;
40
+ RESET_STRIKETHROUGH: string;
41
+ CURLY_UNDERLINE: string;
42
+ RESET_CURLY_UNDERLINE: string;
43
+ DOUBLE_UNDERLINE: string;
44
+ RESET_DOUBLE_UNDERLINE: string;
45
+ EXTENDED_COLOR: string;
46
+ BG_EXTENDED_COLOR: string;
47
+ DEFAULT_COLOR: string;
48
+ BG_DEFAULT_COLOR: string;
49
+ RESET_COLOR: string;
50
+ RESET_BG_COLOR: string;
51
+ OVERLINE: string;
52
+ RESET_OVERLINE: string;
53
+ DECORATION_COLOR: string;
54
+ DECORATION_DEFAULT_COLOR: string;
55
+ RESET_DECORATION_COLOR: string;
56
+ };
57
+
58
+ /** Color format identifiers for extended colors. */
59
+ export const ColorFormat: {
60
+ /** 256-color mode identifier. */
61
+ COLOR_256: string;
62
+ /** True color (24-bit) mode identifier. */
63
+ TRUE_COLOR: string;
64
+ };
65
+
66
+ /** Maps color format identifiers to their parameter count. */
67
+ export const ColorFormatSize: Record<string, number>;
68
+
69
+ /** Configuration for a color category (foreground, background, or decoration). */
70
+ export interface ColorOptions {
71
+ /** Base SGR code for standard colors. */
72
+ base: number;
73
+ /** Base SGR code for bright colors. */
74
+ brightBase: number;
75
+ /** SGR command for default color. */
76
+ default: string;
77
+ /** SGR command for extended color prefix. */
78
+ extended: string;
79
+ }
80
+
81
+ /** Foreground color configuration. */
82
+ export const FgColorOptions: ColorOptions;
83
+ /** Background color configuration. */
84
+ export const BgColorOptions: ColorOptions;
85
+ /** Decoration (underline) color configuration. */
86
+ export const DecorationColorOptions: ColorOptions;
87
+
88
+ /** Checks if a command is a foreground color command.
89
+ * @param command - The SGR command string.
90
+ * @returns True if it is a foreground color command.
91
+ */
92
+ export function isFgColorCommand(command: string): boolean;
93
+ /** Checks if a command is a background color command.
94
+ * @param command - The SGR command string.
95
+ * @returns True if it is a background color command.
96
+ */
97
+ export function isBgColorCommand(command: string): boolean;
98
+ /** Checks if a command is a font command.
99
+ * @param command - The SGR command string.
100
+ * @returns True if it is a font command.
101
+ */
102
+ export function isFontCommand(command: string): boolean;
103
+
104
+ /** Returns the reset command for a given SGR command.
105
+ * @param command - The SGR command string or number.
106
+ * @returns The corresponding reset command, or `undefined` if none.
107
+ */
108
+ export function reset(command: string | number): string | undefined;
109
+
110
+ /** Creates an SGR escape sequence from one or more commands.
111
+ * @param commands - A single command, array of commands, or numeric code.
112
+ * @returns The SGR escape sequence string.
113
+ */
114
+ export function setCommands(commands: string | string[] | number): string;
115
+
116
+ /** Converts a color name or number to a standard color number (0-9).
117
+ * @param color - Color name (e.g., 'red') or number.
118
+ * @returns The standard color number.
119
+ */
120
+ export function colorNumber(color: string | number): number;
121
+ /** Converts RGB values to a standard color number (0-7).
122
+ * @param r - Red component (truthy/falsy).
123
+ * @param g - Green component (truthy/falsy).
124
+ * @param b - Blue component (truthy/falsy).
125
+ * @returns The standard color number from 0 to 7
126
+ */
127
+ export function colorStdRgb(r: number | boolean, g: number | boolean, b: number | boolean): number;
128
+
129
+ /** Returns the foreground color SGR code.
130
+ * @param color - Color name or number.
131
+ * @returns The SGR code.
132
+ */
133
+ export function getColor(color: string | number): number;
134
+ /** Returns the background color SGR code.
135
+ * @param color - Color name or number.
136
+ * @returns The SGR code.
137
+ */
138
+ export function getBgColor(color: string | number): number;
139
+ /** Returns the bright foreground color SGR code.
140
+ * @param color - Color name or number.
141
+ * @returns The SGR code.
142
+ */
143
+ export function getBrightColor(color: string | number): number;
144
+ /** Returns the bright background color SGR code.
145
+ * @param color - Color name or number.
146
+ * @returns The SGR code.
147
+ */
148
+ export function getBgBrightColor(color: string | number): number;
149
+ /** Returns the foreground standard RGB color SGR code.
150
+ * @param r - Red component (truthy/falsy).
151
+ * @param g - Green component (truthy/falsy).
152
+ * @param b - Blue component (truthy/falsy).
153
+ * @returns The SGR code.
154
+ */
155
+ export function getStdRgb(r: number | boolean, g: number | boolean, b: number | boolean): number;
156
+ /** Returns the background standard RGB color SGR code.
157
+ * @param r - Red component (truthy/falsy).
158
+ * @param g - Green component (truthy/falsy).
159
+ * @param b - Blue component (truthy/falsy).
160
+ * @returns The SGR code.
161
+ */
162
+ export function getBgStdRgb(r: number | boolean, g: number | boolean, b: number | boolean): number;
163
+ /** Returns the bright foreground standard RGB color SGR code.
164
+ * @param r - Red component (truthy/falsy).
165
+ * @param g - Green component (truthy/falsy).
166
+ * @param b - Blue component (truthy/falsy).
167
+ * @returns The SGR code.
168
+ */
169
+ export function getBrightStdRgb(r: number | boolean, g: number | boolean, b: number | boolean): number;
170
+ /** Returns the bright background standard RGB color SGR code.
171
+ * @param r - Red component (truthy/falsy).
172
+ * @param g - Green component (truthy/falsy).
173
+ * @param b - Blue component (truthy/falsy).
174
+ * @returns The SGR code.
175
+ */
176
+ export function getBgBrightStdRgb(r: number | boolean, g: number | boolean, b: number | boolean): number;
177
+
178
+ /** Sets the foreground color.
179
+ * @param color - Color name or number.
180
+ * @returns SGR escape sequence.
181
+ */
182
+ export function setColor(color: string | number): string;
183
+ /** Sets the background color.
184
+ * @param color - Color name or number.
185
+ * @returns SGR escape sequence.
186
+ */
187
+ export function setBgColor(color: string | number): string;
188
+ /** Sets the bright foreground color.
189
+ * @param color - Color name or number.
190
+ * @returns SGR escape sequence.
191
+ */
192
+ export function setBrightColor(color: string | number): string;
193
+ /** Sets the bright background color.
194
+ * @param color - Color name or number.
195
+ * @returns SGR escape sequence.
196
+ */
197
+ export function setBgBrightColor(color: string | number): string;
198
+ /** Sets the foreground standard RGB color.
199
+ * @param r - Red component (truthy/falsy).
200
+ * @param g - Green component (truthy/falsy).
201
+ * @param b - Blue component (truthy/falsy).
202
+ * @returns SGR escape sequence.
203
+ */
204
+ export function setStdRgb(r: number | boolean, g: number | boolean, b: number | boolean): string;
205
+ /** Sets the background standard RGB color.
206
+ * @param r - Red component (truthy/falsy).
207
+ * @param g - Green component (truthy/falsy).
208
+ * @param b - Blue component (truthy/falsy).
209
+ * @returns SGR escape sequence.
210
+ */
211
+ export function setBgStdRgb(r: number | boolean, g: number | boolean, b: number | boolean): string;
212
+ /** Sets the bright foreground standard RGB color.
213
+ * @param r - Red component (truthy/falsy).
214
+ * @param g - Green component (truthy/falsy).
215
+ * @param b - Blue component (truthy/falsy).
216
+ * @returns SGR escape sequence.
217
+ */
218
+ export function setBrightStdRgb(r: number | boolean, g: number | boolean, b: number | boolean): string;
219
+ /** Sets the bright background standard RGB color.
220
+ * @param r - Red component (truthy/falsy).
221
+ * @param g - Green component (truthy/falsy).
222
+ * @param b - Blue component (truthy/falsy).
223
+ * @returns SGR escape sequence.
224
+ */
225
+ export function setBgBrightStdRgb(r: number | boolean, g: number | boolean, b: number | boolean): string;
226
+
227
+ /** Converts a font number to a valid font index.
228
+ * @param font - Font number.
229
+ * @returns The font index.
230
+ */
231
+ export function fontNumber(font: number): number;
232
+ /** Returns the SGR code for a font.
233
+ * @param font - Font number.
234
+ * @returns The SGR code.
235
+ */
236
+ export function getFont(font: number): number;
237
+ /** Sets the font.
238
+ * @param font - Font number.
239
+ * @returns SGR escape sequence.
240
+ */
241
+ export function setFont(font: number): string;
242
+
243
+ /** Returns foreground 256-color command array for a raw palette index.
244
+ * @param color - Palette index (0-255).
245
+ * @returns SGR command array.
246
+ */
247
+ export function getRawColor256(color: number): string[];
248
+ /** Returns foreground 256-color command array for a standard color.
249
+ * @param color - Color name or number.
250
+ * @returns SGR command array.
251
+ */
252
+ export function getStdColor256(color: string | number): string[];
253
+ /** Returns foreground 256-color command array for a bright standard color.
254
+ * @param color - Color name or number.
255
+ * @returns SGR command array.
256
+ */
257
+ export function getBrightStdColor256(color: string | number): string[];
258
+ /** Returns foreground 256-color command array for a 6x6x6 RGB color.
259
+ * @param r - Red component (0-5).
260
+ * @param g - Green component (0-5).
261
+ * @param b - Blue component (0-5).
262
+ * @returns SGR command array.
263
+ */
264
+ export function getColor6(r: number, g: number, b: number): string[];
265
+ /** Returns foreground 256-color command array for an RGB color.
266
+ * @param r - Red (0-255).
267
+ * @param g - Green (0-255).
268
+ * @param b - Blue (0-255).
269
+ * @returns SGR command array.
270
+ */
271
+ export function getColor256(r: number, g: number, b: number): string[];
272
+ /** Returns foreground 256-color command array for a hex color.
273
+ * @param hex - Hex color value (e.g., 0xFF0000).
274
+ * @returns SGR command array.
275
+ */
276
+ export function getHexColor256(hex: number): string[];
277
+ /** Returns foreground 256-color command array for a 24-shade gray.
278
+ * @param i - Gray index (0-23).
279
+ * @returns SGR command array.
280
+ */
281
+ export function getGrayColor24(i: number): string[];
282
+ /** Returns foreground 256-color command array for a gray by intensity.
283
+ * @param i - Gray intensity (0-255).
284
+ * @returns SGR command array.
285
+ */
286
+ export function getGrayColor256(i: number): string[];
287
+
288
+ /** Sets foreground 256-color by raw palette index.
289
+ * @param color - Palette index (0-255).
290
+ * @returns SGR escape sequence.
291
+ */
292
+ export function setRawColor256(color: number): string;
293
+ /** Sets foreground 256-color by standard color.
294
+ * @param color - Color name or number.
295
+ * @returns SGR escape sequence.
296
+ */
297
+ export function setStdColor256(color: string | number): string;
298
+ /** Sets foreground 256-color by bright standard color.
299
+ * @param color - Color name or number.
300
+ * @returns SGR escape sequence.
301
+ */
302
+ export function setBrightStdColor256(color: string | number): string;
303
+ /** Sets foreground 256-color by 6x6x6 RGB.
304
+ * @param r - Red (0-5).
305
+ * @param g - Green (0-5).
306
+ * @param b - Blue (0-5).
307
+ * @returns SGR escape sequence.
308
+ */
309
+ export function setColor6(r: number, g: number, b: number): string;
310
+ /** Sets foreground 256-color by RGB.
311
+ * @param r - Red (0-255).
312
+ * @param g - Green (0-255).
313
+ * @param b - Blue (0-255).
314
+ * @returns SGR escape sequence.
315
+ */
316
+ export function setColor256(r: number, g: number, b: number): string;
317
+ /** Sets foreground 256-color by hex.
318
+ * @param hex - Hex color value.
319
+ * @returns SGR escape sequence.
320
+ */
321
+ export function setHexColor256(hex: number): string;
322
+ /** Sets foreground 256-color gray by index.
323
+ * @param i - Gray index (0-23).
324
+ * @returns SGR escape sequence.
325
+ */
326
+ export function setGrayColor24(i: number): string;
327
+ /** Sets foreground 256-color gray by intensity.
328
+ * @param i - Gray intensity (0-255).
329
+ * @returns SGR escape sequence.
330
+ */
331
+ export function setGrayColor256(i: number): string;
332
+
333
+ /** Returns background 256-color command array for a raw palette index.
334
+ * @param color - Palette index (0-255).
335
+ * @returns SGR command array.
336
+ */
337
+ export function getBgRawColor256(color: number): string[];
338
+ /** Returns background 256-color command array for a standard color.
339
+ * @param color - Color name or number.
340
+ * @returns SGR command array.
341
+ */
342
+ export function getBgStdColor256(color: string | number): string[];
343
+ /** Returns background 256-color command array for a bright standard color.
344
+ * @param color - Color name or number.
345
+ * @returns SGR command array.
346
+ */
347
+ export function getBgBrightStdColor256(color: string | number): string[];
348
+ /** Returns background 256-color command array for a 6x6x6 RGB color.
349
+ * @param r - Red (0-5).
350
+ * @param g - Green (0-5).
351
+ * @param b - Blue (0-5).
352
+ * @returns SGR command array.
353
+ */
354
+ export function getBgColor6(r: number, g: number, b: number): string[];
355
+ /** Returns background 256-color command array for an RGB color.
356
+ * @param r - Red (0-255).
357
+ * @param g - Green (0-255).
358
+ * @param b - Blue (0-255).
359
+ * @returns SGR command array.
360
+ */
361
+ export function getBgColor256(r: number, g: number, b: number): string[];
362
+ /** Returns background 256-color command array for a hex color.
363
+ * @param hex - Hex color value.
364
+ * @returns SGR command array.
365
+ */
366
+ export function getBgHexColor256(hex: number): string[];
367
+ /** Returns background 256-color command array for a 24-shade gray.
368
+ * @param i - Gray index (0-23).
369
+ * @returns SGR command array.
370
+ */
371
+ export function getBgGrayColor24(i: number): string[];
372
+ /** Returns background 256-color command array for a gray by intensity.
373
+ * @param i - Gray intensity (0-255).
374
+ * @returns SGR command array.
375
+ */
376
+ export function getBgGrayColor256(i: number): string[];
377
+
378
+ /** Sets background 256-color by raw palette index.
379
+ * @param color - Palette index (0-255).
380
+ * @returns SGR escape sequence.
381
+ */
382
+ export function setBgRawColor256(color: number): string;
383
+ /** Sets background 256-color by standard color.
384
+ * @param color - Color name or number.
385
+ * @returns SGR escape sequence.
386
+ */
387
+ export function setBgStdColor256(color: string | number): string;
388
+ /** Sets background 256-color by bright standard color.
389
+ * @param color - Color name or number.
390
+ * @returns SGR escape sequence.
391
+ */
392
+ export function setBgBrightStdColor256(color: string | number): string;
393
+ /** Sets background 256-color by 6x6x6 RGB.
394
+ * @param r - Red (0-5).
395
+ * @param g - Green (0-5).
396
+ * @param b - Blue (0-5).
397
+ * @returns SGR escape sequence.
398
+ */
399
+ export function setBgColor6(r: number, g: number, b: number): string;
400
+ /** Sets background 256-color by RGB.
401
+ * @param r - Red (0-255).
402
+ * @param g - Green (0-255).
403
+ * @param b - Blue (0-255).
404
+ * @returns SGR escape sequence.
405
+ */
406
+ export function setBgColor256(r: number, g: number, b: number): string;
407
+ /** Sets background 256-color by hex.
408
+ * @param hex - Hex color value.
409
+ * @returns SGR escape sequence.
410
+ */
411
+ export function setBgHexColor256(hex: number): string;
412
+ /** Sets background 256-color gray by index.
413
+ * @param i - Gray index (0-23).
414
+ * @returns SGR escape sequence.
415
+ */
416
+ export function setBgGrayColor24(i: number): string;
417
+ /** Sets background 256-color gray by intensity.
418
+ * @param i - Gray intensity (0-255).
419
+ * @returns SGR escape sequence.
420
+ */
421
+ export function setBgGrayColor256(i: number): string;
422
+
423
+ /** Returns the foreground true color (24-bit) SGR command array.
424
+ * @param r - Red (0-255).
425
+ * @param g - Green (0-255).
426
+ * @param b - Blue (0-255).
427
+ * @returns SGR command array.
428
+ */
429
+ export function getTrueColor(r: number, g: number, b: number): string[];
430
+ /** Returns the foreground true color command array from hex.
431
+ * @param hex - Hex color value.
432
+ * @returns SGR command array.
433
+ */
434
+ export function getHexTrueColor(hex: number): string[];
435
+ /** Returns the background true color (24-bit) SGR command array.
436
+ * @param r - Red (0-255).
437
+ * @param g - Green (0-255).
438
+ * @param b - Blue (0-255).
439
+ * @returns SGR command array.
440
+ */
441
+ export function getBgTrueColor(r: number, g: number, b: number): string[];
442
+ /** Returns the background true color command array from hex.
443
+ * @param hex - Hex color value.
444
+ * @returns SGR command array.
445
+ */
446
+ export function getBgHexTrueColor(hex: number): string[];
447
+
448
+ /** Sets foreground true color.
449
+ * @param r - Red (0-255).
450
+ * @param g - Green (0-255).
451
+ * @param b - Blue (0-255).
452
+ * @returns SGR escape sequence.
453
+ */
454
+ export function setTrueColor(r: number, g: number, b: number): string;
455
+ /** Sets foreground true color from hex.
456
+ * @param hex - Hex color value.
457
+ * @returns SGR escape sequence.
458
+ */
459
+ export function setHexTrueColor(hex: number): string;
460
+ /** Sets background true color.
461
+ * @param r - Red (0-255).
462
+ * @param g - Green (0-255).
463
+ * @param b - Blue (0-255).
464
+ * @returns SGR escape sequence.
465
+ */
466
+ export function setBgTrueColor(r: number, g: number, b: number): string;
467
+ /** Sets background true color from hex.
468
+ * @param hex - Hex color value.
469
+ * @returns SGR escape sequence.
470
+ */
471
+ export function setBgHexTrueColor(hex: number): string;
472
+
473
+ /** Returns decoration 256-color command array for a raw palette index.
474
+ * @param color - Palette index (0-255).
475
+ * @returns SGR command array.
476
+ */
477
+ export function getDecorationRawColor256(color: number): string[];
478
+ /** Returns decoration 256-color command array for a standard color.
479
+ * @param color - Color name or number.
480
+ * @returns SGR command array.
481
+ */
482
+ export function getDecorationStdColor256(color: string | number): string[];
483
+ /** Returns decoration 256-color command array for a bright standard color.
484
+ * @param color - Color name or number.
485
+ * @returns SGR command array.
486
+ */
487
+ export function getDecorationBrightStdColor256(color: string | number): string[];
488
+ /** Returns decoration 256-color command array for a 6x6x6 RGB color.
489
+ * @param r - Red (0-5).
490
+ * @param g - Green (0-5).
491
+ * @param b - Blue (0-5).
492
+ * @returns SGR command array.
493
+ */
494
+ export function getDecorationColor6(r: number, g: number, b: number): string[];
495
+ /** Returns decoration 256-color command array for an RGB color.
496
+ * @param r - Red (0-255).
497
+ * @param g - Green (0-255).
498
+ * @param b - Blue (0-255).
499
+ * @returns SGR command array.
500
+ */
501
+ export function getDecorationColor256(r: number, g: number, b: number): string[];
502
+ /** Returns decoration 256-color command array for a hex color.
503
+ * @param hex - Hex color value.
504
+ * @returns SGR command array.
505
+ */
506
+ export function getDecorationHexColor256(hex: number): string[];
507
+ /** Returns decoration 256-color command array for a 24-shade gray.
508
+ * @param i - Gray index (0-23).
509
+ * @returns SGR command array.
510
+ */
511
+ export function getDecorationGrayColor24(i: number): string[];
512
+ /** Returns decoration 256-color command array for a gray by intensity.
513
+ * @param i - Gray intensity (0-255).
514
+ * @returns SGR command array.
515
+ */
516
+ export function getDecorationGrayColor256(i: number): string[];
517
+
518
+ /** Sets decoration 256-color by raw palette index.
519
+ * @param color - Palette index (0-255).
520
+ * @returns SGR escape sequence.
521
+ */
522
+ export function setDecorationRawColor256(color: number): string;
523
+ /** Sets decoration 256-color by standard color.
524
+ * @param color - Color name or number.
525
+ * @returns SGR escape sequence.
526
+ */
527
+ export function setDecorationStdColor256(color: string | number): string;
528
+ /** Sets decoration 256-color by bright standard color.
529
+ * @param color - Color name or number.
530
+ * @returns SGR escape sequence.
531
+ */
532
+ export function setDecorationBrightStdColor256(color: string | number): string;
533
+ /** Sets decoration 256-color by 6x6x6 RGB.
534
+ * @param r - Red (0-5).
535
+ * @param g - Green (0-5).
536
+ * @param b - Blue (0-5).
537
+ * @returns SGR escape sequence.
538
+ */
539
+ export function setDecorationColor6(r: number, g: number, b: number): string;
540
+ /** Sets decoration 256-color by RGB.
541
+ * @param r - Red (0-255).
542
+ * @param g - Green (0-255).
543
+ * @param b - Blue (0-255).
544
+ * @returns SGR escape sequence.
545
+ */
546
+ export function setDecorationColor256(r: number, g: number, b: number): string;
547
+ /** Sets decoration 256-color by hex.
548
+ * @param hex - Hex color value.
549
+ * @returns SGR escape sequence.
550
+ */
551
+ export function setDecorationHexColor256(hex: number): string;
552
+ /** Sets decoration 256-color gray by index.
553
+ * @param i - Gray index (0-23).
554
+ * @returns SGR escape sequence.
555
+ */
556
+ export function setDecorationGrayColor24(i: number): string;
557
+ /** Sets decoration 256-color gray by intensity.
558
+ * @param i - Gray intensity (0-255).
559
+ * @returns SGR escape sequence.
560
+ */
561
+ export function setDecorationGrayColor256(i: number): string;
562
+
563
+ /** Returns decoration true color command array.
564
+ * @param r - Red (0-255).
565
+ * @param g - Green (0-255).
566
+ * @param b - Blue (0-255).
567
+ * @returns SGR command array.
568
+ */
569
+ export function getDecorationTrueColor(r: number, g: number, b: number): string[];
570
+ /** Returns decoration true color command array from hex.
571
+ * @param hex - Hex color value.
572
+ * @returns SGR command array.
573
+ */
574
+ export function getDecorationHexTrueColor(hex: number): string[];
575
+
576
+ /** Sets decoration true color.
577
+ * @param r - Red (0-255).
578
+ * @param g - Green (0-255).
579
+ * @param b - Blue (0-255).
580
+ * @returns SGR escape sequence.
581
+ */
582
+ export function setDecorationTrueColor(r: number, g: number, b: number): string;
583
+ /** Sets decoration true color from hex.
584
+ * @param hex - Hex color value.
585
+ * @returns SGR escape sequence.
586
+ */
587
+ export function setDecorationHexTrueColor(hex: number): string;