@peteanderson/ansi 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +194 -0
  3. package/dist/ansi.d.ts +79 -41
  4. package/dist/ansi.d.ts.map +1 -1
  5. package/dist/ansi.js +9 -6
  6. package/dist/ansi.js.map +1 -1
  7. package/dist/features/build.d.ts.map +1 -1
  8. package/dist/features/build.js.map +1 -1
  9. package/dist/features/detect.d.ts.map +1 -1
  10. package/dist/features/detect.js.map +1 -1
  11. package/dist/features/features.d.ts +1 -3
  12. package/dist/features/features.d.ts.map +1 -1
  13. package/dist/features/features.js +12 -13
  14. package/dist/features/features.js.map +1 -1
  15. package/dist/features/index.d.ts +1 -0
  16. package/dist/features/index.d.ts.map +1 -1
  17. package/dist/features/types.d.ts +2 -0
  18. package/dist/features/types.d.ts.map +1 -1
  19. package/dist/pad.d.ts +10 -0
  20. package/dist/pad.d.ts.map +1 -1
  21. package/dist/pad.js +8 -0
  22. package/dist/pad.js.map +1 -1
  23. package/dist/sgr/color/channel.d.ts +4 -0
  24. package/dist/sgr/color/channel.d.ts.map +1 -0
  25. package/dist/sgr/color/channel.js +33 -0
  26. package/dist/sgr/color/channel.js.map +1 -0
  27. package/dist/sgr/color/color.d.ts +3 -4
  28. package/dist/sgr/color/color.d.ts.map +1 -1
  29. package/dist/sgr/color/color.js +16 -65
  30. package/dist/sgr/color/color.js.map +1 -1
  31. package/dist/sgr/color/context.d.ts +13 -0
  32. package/dist/sgr/color/context.d.ts.map +1 -0
  33. package/dist/sgr/color/context.js +24 -0
  34. package/dist/sgr/color/context.js.map +1 -0
  35. package/dist/sgr/color/rgb.d.ts +5 -0
  36. package/dist/sgr/color/rgb.d.ts.map +1 -0
  37. package/dist/sgr/color/rgb.js +32 -0
  38. package/dist/sgr/color/rgb.js.map +1 -0
  39. package/dist/sgr/color/utils.d.ts.map +1 -1
  40. package/dist/sgr/color/utils.js +12 -4
  41. package/dist/sgr/color/utils.js.map +1 -1
  42. package/dist/sgr/combine.d.ts +3 -0
  43. package/dist/sgr/combine.d.ts.map +1 -0
  44. package/dist/sgr/combine.js +14 -0
  45. package/dist/sgr/combine.js.map +1 -0
  46. package/dist/sgr/format-builder.d.ts +3 -0
  47. package/dist/sgr/format-builder.d.ts.map +1 -0
  48. package/dist/sgr/format-builder.js +33 -0
  49. package/dist/sgr/format-builder.js.map +1 -0
  50. package/dist/sgr/index.d.ts +2 -3
  51. package/dist/sgr/index.d.ts.map +1 -1
  52. package/dist/sgr/index.js +1 -3
  53. package/dist/sgr/index.js.map +1 -1
  54. package/dist/sgr/lazy.d.ts +6 -0
  55. package/dist/sgr/lazy.d.ts.map +1 -0
  56. package/dist/sgr/lazy.js +17 -0
  57. package/dist/sgr/lazy.js.map +1 -0
  58. package/dist/sgr/sgr.d.ts +3 -14
  59. package/dist/sgr/sgr.d.ts.map +1 -1
  60. package/dist/sgr/sgr.js +44 -37
  61. package/dist/sgr/sgr.js.map +1 -1
  62. package/dist/sgr/style.d.ts +2 -14
  63. package/dist/sgr/style.d.ts.map +1 -1
  64. package/dist/sgr/style.js +27 -16
  65. package/dist/sgr/style.js.map +1 -1
  66. package/dist/sgr/types.d.ts +59 -0
  67. package/dist/sgr/types.d.ts.map +1 -0
  68. package/dist/sgr/{color/types.js.map → types.js.map} +1 -1
  69. package/dist/simplify/atom.d.ts.map +1 -1
  70. package/dist/simplify/atom.js +8 -1
  71. package/dist/simplify/atom.js.map +1 -1
  72. package/dist/simplify/simplify.d.ts +1 -0
  73. package/dist/simplify/simplify.d.ts.map +1 -1
  74. package/dist/slice.d.ts +1 -0
  75. package/dist/slice.d.ts.map +1 -1
  76. package/dist/slice.js +1 -0
  77. package/dist/slice.js.map +1 -1
  78. package/dist/strip.d.ts +6 -0
  79. package/dist/strip.d.ts.map +1 -1
  80. package/dist/strip.js +3 -0
  81. package/dist/strip.js.map +1 -1
  82. package/dist/typed-object.d.ts +16 -0
  83. package/dist/typed-object.d.ts.map +1 -0
  84. package/dist/typed-object.js +36 -0
  85. package/dist/typed-object.js.map +1 -0
  86. package/dist/types.d.ts +25 -0
  87. package/dist/types.d.ts.map +1 -0
  88. package/dist/types.js +3 -0
  89. package/dist/types.js.map +1 -0
  90. package/package.json +26 -10
  91. package/src/ansi.ts +11 -36
  92. package/src/features/build.ts +4 -3
  93. package/src/features/detect.ts +6 -3
  94. package/src/features/features.ts +19 -30
  95. package/src/features/index.ts +2 -0
  96. package/src/features/types.ts +9 -0
  97. package/src/pad.ts +12 -1
  98. package/src/sgr/color/channel.ts +44 -0
  99. package/src/sgr/color/color.ts +30 -95
  100. package/src/sgr/color/context.ts +44 -0
  101. package/src/sgr/color/index.ts +1 -1
  102. package/src/sgr/color/rgb.ts +48 -0
  103. package/src/sgr/color/utils.ts +13 -4
  104. package/src/sgr/combine.ts +13 -0
  105. package/src/sgr/format-builder.ts +47 -0
  106. package/src/sgr/index.ts +3 -3
  107. package/src/sgr/lazy.ts +21 -0
  108. package/src/sgr/sgr.ts +61 -57
  109. package/src/sgr/style.ts +35 -18
  110. package/src/sgr/types.ts +91 -0
  111. package/src/simplify/atom.ts +8 -2
  112. package/src/simplify/simplify.ts +3 -1
  113. package/src/slice.ts +4 -1
  114. package/src/strip.ts +10 -1
  115. package/src/typed-object.ts +85 -0
  116. package/src/types.ts +28 -0
  117. package/src/utility-types.d.ts +18 -0
  118. package/dist/sgr/color/test-rgb.d.ts +0 -3
  119. package/dist/sgr/color/test-rgb.d.ts.map +0 -1
  120. package/dist/sgr/color/test-rgb.js +0 -149
  121. package/dist/sgr/color/test-rgb.js.map +0 -1
  122. package/dist/sgr/color/types.d.ts +0 -30
  123. package/dist/sgr/color/types.d.ts.map +0 -1
  124. package/dist/sgr/utils.d.ts +0 -3
  125. package/dist/sgr/utils.d.ts.map +0 -1
  126. package/dist/sgr/utils.js +0 -16
  127. package/dist/sgr/utils.js.map +0 -1
  128. package/dist/simplify/test.d.ts +0 -2
  129. package/dist/simplify/test.d.ts.map +0 -1
  130. package/dist/simplify/test.js +0 -64
  131. package/dist/simplify/test.js.map +0 -1
  132. package/src/sgr/color/types.ts +0 -32
  133. package/src/sgr/utils.ts +0 -17
  134. /package/dist/sgr/{color/types.js → types.js} +0 -0
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright 2026 Pete Anderson
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,194 @@
1
+ # @peteanderson/ansi
2
+
3
+ ANSI escape sequence helpers for Node.js terminal output. Automatically detects terminal
4
+ capabilities and adapts output accordingly.
5
+
6
+ ## Installation
7
+
8
+ ```sh
9
+ npm install @peteanderson/ansi
10
+ ```
11
+
12
+ ## Usage
13
+
14
+ ```js
15
+ const ansi = require("@peteanderson/ansi");
16
+
17
+ console.log(ansi.fg.red("error: something went wrong"));
18
+ // Fluent chaining with .and
19
+ console.log(ansi.bg.blue.and.fg.white.and.bold("highlighted"));
20
+ console.log(ansi.style.bold("important"));
21
+ console.log(ansi.fg.rgb(5, 2, 0)("custom color"));
22
+
23
+ // Disable colors for a specific stream
24
+ const ansiNoColor = ansi(1); // force 1-bit (no color)
25
+ console.log(ansiNoColor.fg.red("this won't be colored"));
26
+
27
+ // Override specific features
28
+ const customAnsi = ansi({colorDepth: 8, caret: false});
29
+ ```
30
+
31
+ ## Feature Detection
32
+
33
+ The module automatically detects:
34
+
35
+ - **Color depth**: 1 (none), 4 (16 colors), 8 (256 colors), 24 (true color)
36
+ - **Style support**: enabled if color depth > 1
37
+ - **Other features**: caret, erase, scroll — enabled if output is a TTY and `TERM` is not `dumb`
38
+
39
+ When disabled, features output empty strings. Color outputs plain text. This can be overridden:
40
+
41
+ - Pass a boolean to force color on/off
42
+ - Pass a number to set specific color depth (1, 3, 4, 8, or 24)
43
+ - Pass a stream to use for detection
44
+ - Pass a partial features object to override individual features
45
+
46
+ ## API
47
+
48
+ ### Default Export
49
+
50
+ The module exports a callable function with detection-based properties:
51
+
52
+ ```js
53
+ const ansi = require("@peteanderson/ansi");
54
+ const customAnsi = ansi(options); // returns configured instance
55
+ ```
56
+
57
+ ### `fg` — foreground colors
58
+
59
+ Functions that wrap text with color codes (or plain text if disabled):
60
+
61
+ - Basic colors: `black` `red` `green` `yellow` `blue` `magenta` `cyan` `white` `default`
62
+ - Bright colors: `brightBlack` `brightRed` `brightGreen` `brightYellow` `brightBlue` `brightMagenta`
63
+ `brightCyan` `brightWhite`
64
+ - `fg.rgb(r, g, b)(text)` - 24-bit RGB color, downscaled for lower color depths
65
+ - `fg.x256(code)(text)` or `fg.x256(r, g, b)(text)` - 256-color palette, downscaled as needed
66
+
67
+ All return functions with `open` and `close` properties for raw sequences and an `and` property for
68
+ fluent chaining.
69
+
70
+ ### `bg` — background colors
71
+
72
+ Functions that wrap text with color codes (or plain text if disabled):
73
+
74
+ - Basic colors: `black` `red` `green` `yellow` `blue` `magenta` `cyan` `white` `default`
75
+ - Bright colors: `brightBlack` `brightRed` `brightGreen` `brightYellow` `brightBlue` `brightMagenta`
76
+ `brightCyan` `brightWhite`
77
+ - `bg.rgb(r, g, b)(text)` - 24-bit RGB color, downscaled for lower color depths
78
+ - `bg.x256(code)(text)` or `bg.x256(r, g, b)(text)` - 256-color palette, downscaled as needed
79
+
80
+ All return functions with `open` and `close` properties for raw sequences and an `and` property for
81
+ fluent chaining.
82
+
83
+ ### `style`
84
+
85
+ Functions that wrap text with style codes (disabled if color depth = 1):
86
+
87
+ `bold` `dim` `italic` `underline` `inverse` `hidden` `strikethrough` `doubleUnderline` `framed`
88
+ `encircled` `overline`
89
+
90
+ All return functions with `open` and `close` properties for raw sequences and an `and` property for
91
+ fluent chaining.
92
+
93
+ #### Fluent Chaining with `.and`
94
+
95
+ Styles can be chained using the `.and` property for a natural, fluent interface. The `style`
96
+ namespace is unnested in chains:
97
+
98
+ ```js
99
+ // Top-level: use style namespace
100
+ ansi.style.bold("bold text");
101
+
102
+ // In a chain: no need for style namespace
103
+ ansi.fg.white.and.bg.blue.and.bold("white on blue, bold");
104
+ ansi.fg.red.and.underline("red underlined");
105
+ ```
106
+
107
+ ### `reset`
108
+
109
+ The SGR reset sequence. Empty string if color is disabled.
110
+
111
+ ### `caret`
112
+
113
+ Available if feature is enabled:
114
+
115
+ - `caret.show` / `caret.hide` - show or hide the cursor
116
+ - `caret.position.get` - get the current cursor position (terminal sends position to stdin)
117
+ - `caret.position.set(row, col)` - set cursor position (1-based indexing)
118
+ - `caret.shape.block` / `caret.shape.underline` / `caret.shape.bar` - change cursor shape
119
+ - `caret.up(n)` / `caret.down(n)` / `caret.forward(n)` / `caret.backward(n)` - move cursor
120
+ - `caret.nextLine(n)` / `caret.prevLine(n)` - move cursor to next/previous line
121
+ - `caret.x(col)` - move cursor to column (1-based)
122
+ - `caret.save` / `caret.restore` - save/restore cursor position (VT100)
123
+
124
+ ### `terminal`
125
+
126
+ Terminal control features (available if feature is enabled):
127
+
128
+ - `terminal.focusReporting.enable` / `terminal.focusReporting.disable` - enable/disable focus
129
+ reporting
130
+ - `terminal.alternateBuffer.on` / `terminal.alternateBuffer.off` - switch to/from alternate buffer
131
+ - `terminal.alternateBuffer.legacy.on` / `terminal.alternateBuffer.legacy.off` - use legacy
132
+ alternate buffer sequences
133
+ - `terminal.bracketedPasteMode.enable` / `terminal.bracketedPasteMode.disable` - enable/disable
134
+ bracketed paste mode
135
+
136
+ ### `erase`
137
+
138
+ Available if feature is enabled:
139
+
140
+ - `erase.line.toStart` / `erase.line.toEnd` / `erase.line.full` - erase line
141
+ - `erase.screen.toStart` / `erase.screen.toEnd` / `erase.screen.full` - erase screen
142
+ - `erase.screen.scrollback` - erase screen and scrollback buffer
143
+
144
+ ### `scroll`
145
+
146
+ Available if feature is enabled:
147
+
148
+ - `scroll.up(lines)` - scroll up (default 1 line)
149
+ - `scroll.down(lines)` - scroll down (default 1 line)
150
+
151
+ ### `strip(text)`
152
+
153
+ Removes all ANSI CSI sequences from a string (always available).
154
+
155
+ ### `slice(text, start, end)`
156
+
157
+ Slices a string by visible characters, ignoring ANSI sequences (always available).
158
+
159
+ ### `sanitize(text)`
160
+
161
+ Removes "unsafe" CSI sequences, leaving only color and style codes (always available).
162
+
163
+ ### `simplify(text)`
164
+
165
+ Simplifies ANSI SGR sequences by combining adjacent sequences and removing redundant codes (always
166
+ available).
167
+
168
+ ### `visibleLength(text)`
169
+
170
+ Returns the visible length of a string with all ANSI sequences removed (always available).
171
+
172
+ ### `padStart(text, targetLength)` and `padEnd(text, targetLength)`
173
+
174
+ Pads a string to a target visible length using spaces. Accounts for ANSI sequences when calculating
175
+ length.
176
+
177
+ ### `features`
178
+
179
+ Object containing the detected feature configuration:
180
+
181
+ ```ts
182
+ {
183
+ colorDepth : 1 | 3 | 4 | 8 | 24;
184
+ style : boolean;
185
+ caret : boolean;
186
+ erase : boolean;
187
+ scroll : boolean;
188
+ terminal : boolean;
189
+ }
190
+ ```
191
+
192
+ ## License
193
+
194
+ MIT
package/dist/ansi.d.ts CHANGED
@@ -1,46 +1,84 @@
1
1
  import { padEnd, padStart } from "./pad";
2
- import { simplify } from "./simplify";
3
- import { slice } from "./slice";
4
- import { sanitize, strip, visibleLength } from "./strip";
5
- import type { Args } from "./features/features";
6
- import type { Caret } from "./caret";
7
- import type { Erase } from "./erase";
8
- import type { Features } from "./features/types";
9
- import type { Scroll } from "./scroll";
10
- import type { Color, Style } from "./sgr";
11
- import type { Terminal } from "./terminal";
12
- export type Ansi = Color & {
13
- caret: Caret;
14
- erase: Erase;
15
- scroll: Scroll;
16
- reset: string;
17
- style: Style;
18
- terminal: Terminal;
19
- padEnd: typeof padEnd;
20
- padStart: typeof padStart;
21
- strip: typeof strip;
22
- visibleLength: typeof visibleLength;
23
- sanitize: typeof sanitize;
24
- slice: typeof slice;
25
- simplify: typeof simplify;
26
- features: Features;
2
+ import { strip, visibleLength } from "./strip";
3
+ import type { Args } from "./features";
4
+ import type { Ansi } from "./types";
5
+ declare function makeAnsi(...args: Args): Ansi;
6
+ export declare const ansi: typeof makeAnsi & import("./sgr").SGR & {
7
+ caret: import("./caret").Caret;
8
+ erase: import("./erase").Erase;
9
+ scroll: import("./scroll").Scroll;
10
+ terminal: import("./terminal").Terminal;
11
+ padEnd: import("./pad").PadEnd;
12
+ padStart: import("./pad").PadStart;
13
+ strip: import("./strip").Strip;
14
+ visibleLength: import("./strip").VisibleLength;
15
+ sanitize: import("./strip").Sanitize;
16
+ slice: import("./slice").Slice;
17
+ simplify: import("./simplify").Simplify;
18
+ features: import("./features").Features;
27
19
  };
28
- export declare function makeAnsi(...args: Args): Ansi;
29
- declare const ansi: typeof makeAnsi & Color & {
30
- caret: Caret;
31
- erase: Erase;
32
- scroll: Scroll;
33
- reset: string;
34
- style: Style;
35
- terminal: Terminal;
36
- padEnd: typeof padEnd;
37
- padStart: typeof padStart;
38
- strip: typeof strip;
39
- visibleLength: typeof visibleLength;
40
- sanitize: typeof sanitize;
41
- slice: typeof slice;
42
- simplify: typeof simplify;
43
- features: Features;
20
+ export declare const fg: import("./sgr/types").Channel<"bg" | import("./sgr/types").StyleKey>, bg: import("./sgr/types").Channel<"fg" | import("./sgr/types").StyleKey>, style: import("./sgr/types").Style<import("./sgr/types").ChainKey>, reset: string, caret: {
21
+ up: (count?: number) => string;
22
+ down: (count?: number) => string;
23
+ forward: (count?: number) => string;
24
+ backward: (count?: number) => string;
25
+ nextLine: (count?: number) => string;
26
+ prevLine: (count?: number) => string;
27
+ x: (x: number) => string;
28
+ save: string;
29
+ restore: string;
30
+ hide: string;
31
+ show: string;
32
+ position: {
33
+ get: string;
34
+ set: (x: number, y: number) => string;
35
+ };
36
+ shape: {
37
+ steadyBlock: string;
38
+ steadyBar: string;
39
+ steadyUnderline: string;
40
+ blinkingBlock: string;
41
+ blinkingBar: string;
42
+ blinkingUnderline: string;
43
+ default: string;
44
+ };
45
+ }, erase: {
46
+ line: {
47
+ toStart: string;
48
+ toEnd: string;
49
+ full: string;
50
+ };
51
+ screen: {
52
+ toStart: string;
53
+ toEnd: string;
54
+ full: string;
55
+ scrollback: string;
56
+ };
57
+ }, scroll: {
58
+ up: (lines?: number) => string;
59
+ down: (lines?: number) => string;
60
+ }, terminal: {
61
+ focusReporting: {
62
+ enable: string;
63
+ disable: string;
64
+ focus: string;
65
+ blur: string;
66
+ };
67
+ alternateScreen: {
68
+ enable: string;
69
+ disable: string;
70
+ legacy: {
71
+ enable: string;
72
+ disable: string;
73
+ };
74
+ };
75
+ bracketedPaste: {
76
+ enable: string;
77
+ disable: string;
78
+ start: string;
79
+ end: string;
80
+ };
44
81
  };
82
+ export { padEnd, padStart, strip, visibleLength };
45
83
  export default ansi;
46
84
  //# sourceMappingURL=ansi.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ansi.d.ts","sourceRoot":"","sources":["../src/ansi.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAqB,OAAO,CAAC;AAGtD,OAAO,EAAC,QAAQ,EAAC,MAA6B,YAAY,CAAC;AAC3D,OAAO,EAAC,KAAK,E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QAAQ;WAEV,OAAO,KAAK;mBACZ,OAAO,aAAa;cACpB,OAAO,QAAQ;WACf,OAAO,KAAK;cACZ,OAAO,QAAQ;cAEpB,QAAQ;CA8B4B,CAAC;AAEjD,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"ansi.d.ts","sourceRoot":"","sources":["../src/ansi.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAqB,OAAO,CAAC;AAKtD,OAAO,EAAW,KAAK,EAAE,aAAa,EAAC,MAAO,SAAS,CAAC;AAGxD,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,SAAS,CAAC;AAElC,iBAAS,QAAQ,CAAC,GAAG,IAAI,EAAE,IAAI,GAAG,IAAI,CAuBrC;AAED,eAAO,MAAM,IAAI;;;;;;;;;;;;;CAAsC,CAAC;AAExD,eAAO,MAAO,EAAE,wEAAE,EAAE,wEAAE,KAAK,+DAAE,KAAK,UAAE,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;GAAE,KAAK;;;;;;;;;;;;GAAE,MAAM;;;GAAE,QAAQ;;;;;;;;;;;;;;;;;;;;;CAAQ,CAAC;AAE3E,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAC,CAAA;AAE/C,eAAe,IAAI,CAAC"}
package/dist/ansi.js CHANGED
@@ -1,25 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeAnsi = makeAnsi;
3
+ exports.visibleLength = exports.strip = exports.padStart = exports.padEnd = exports.terminal = exports.scroll = exports.erase = exports.caret = exports.reset = exports.style = exports.bg = exports.fg = exports.ansi = void 0;
4
4
  const caret_1 = require("./caret");
5
5
  const erase_1 = require("./erase");
6
6
  const features_1 = require("./features");
7
7
  const pad_1 = require("./pad");
8
+ Object.defineProperty(exports, "padEnd", { enumerable: true, get: function () { return pad_1.padEnd; } });
9
+ Object.defineProperty(exports, "padStart", { enumerable: true, get: function () { return pad_1.padStart; } });
8
10
  const scroll_1 = require("./scroll");
9
11
  const sgr_1 = require("./sgr");
10
12
  const simplify_1 = require("./simplify");
11
13
  const slice_1 = require("./slice");
12
14
  const strip_1 = require("./strip");
15
+ Object.defineProperty(exports, "strip", { enumerable: true, get: function () { return strip_1.strip; } });
16
+ Object.defineProperty(exports, "visibleLength", { enumerable: true, get: function () { return strip_1.visibleLength; } });
13
17
  const terminal_1 = require("./terminal");
14
18
  function makeAnsi(...args) {
15
19
  const features = (0, features_1.getFeatures)(...args);
16
20
  return {
21
+ ...(0, sgr_1.makeSGR)(features),
17
22
  caret: (0, caret_1.makeCaret)(features.caret),
18
23
  erase: (0, erase_1.makeErase)(features.erase),
19
24
  scroll: (0, scroll_1.makeScroll)(features.scroll),
20
- reset: (0, sgr_1.makeReset)(features.colorDepth > 1),
21
- style: (0, sgr_1.makeStyle)(features.style),
22
- ...(0, sgr_1.makeColor)(features.colorDepth),
23
25
  terminal: (0, terminal_1.makeTerminal)(features.terminal),
24
26
  padEnd: pad_1.padEnd,
25
27
  padStart: pad_1.padStart,
@@ -31,6 +33,7 @@ function makeAnsi(...args) {
31
33
  features,
32
34
  };
33
35
  }
34
- const ansi = Object.assign(makeAnsi, makeAnsi());
35
- exports.default = ansi;
36
+ exports.ansi = Object.assign(makeAnsi, makeAnsi());
37
+ exports.fg = exports.ansi.fg, exports.bg = exports.ansi.bg, exports.style = exports.ansi.style, exports.reset = exports.ansi.reset, exports.caret = exports.ansi.caret, exports.erase = exports.ansi.erase, exports.scroll = exports.ansi.scroll, exports.terminal = exports.ansi.terminal;
38
+ exports.default = exports.ansi;
36
39
  //# sourceMappingURL=ansi.js.map
package/dist/ansi.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ansi.js","sourceRoot":"","sources":["../src/ansi.ts"],"names":[],"mappings":";;AAyCA,4BAyBC;AAlED,mCAAwD;AACxD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AAW9D,wBAAgB,KAAK,CACpB,KAAK,EAAQ,OAAO,EACpB,UAAU,EAAG,UAAU,EACvB,KAAK,CAAC,EAAO,OAAO,EACpB,KAAK,CAAC,EAAO,OAAO,EACpB,KAAK,CAAC,EAAO,OAAO,EACpB,MAAM,CAAC,EAAM,OAAO,EACpB,QAAQ,CAAC,EAAI,OAAO,GAClB,QAAQ,CAmBV;AAED,eAAO,MAAM,OAAO,GAAI,OAAO,OAAO,EAAE,SAAS,OAAO,KAAG,QAC7B,CAAC;AAE/B,eAAO,MAAM,MAAM,GAAI,OAAO,OAAO,EAAE,YAAY,UAAU,KAAG,QACvC,CAAC;AAE1B,eAAO,MAAM,GAAG,GAAI,QAAQ,MAAM,CAAC,WAAW,KAAG,QACd,CAAC;AAEpC,eAAO,MAAM,IAAI,QAAO,QACM,CAAC"}
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/features/build.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,SAAS,CAAC;AAWlD,wBAAgB,KAAK,CACpB,KAAK,EAAQ,OAAO,EACpB,UAAU,EAAG,UAAU,EACvB,KAAK,CAAC,EAAO,OAAO,EACpB,KAAK,CAAC,EAAO,OAAO,EACpB,KAAK,CAAC,EAAO,OAAO,EACpB,MAAM,CAAC,EAAM,OAAO,EACpB,QAAQ,CAAC,EAAI,OAAO,GAClB,QAAQ,CAmBV;AAED,eAAO,MAAM,OAAO,GAAI,OAAO,OAAO,EAAE,SAAS,OAAO,KAAG,QAC7B,CAAC;AAE/B,eAAO,MAAM,MAAM,GAAI,OAAO,OAAO,EAAE,YAAY,UAAU,KAAG,QACvC,CAAC;AAE1B,eAAO,MAAM,GAAG,GAAI,QAAQ,MAAM,CAAC,WAAW,KAAG,QACd,CAAC;AAEpC,eAAO,MAAM,IAAI,QAAO,QACM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/features/build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QAAQ,EAAE,MAAM,SAAS,CAAC;AAEpD,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,WAAW,GAAG,UAAU,CAmBrE;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,CASzG"}
1
+ {"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../src/features/detect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,SAAS,CAAC;AAElD,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,WAAW,GAAG,UAAU,CAmBrE;AAED,wBAAgB,oBAAoB,CACnC,KAAK,EAAQ,OAAO,EACpB,UAAU,EAAG,UAAU,GACrB,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,CAS9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"detect.js","sourceRoot":"","sources":["../../src/features/detect.ts"],"names":[],"mappings":";;AAEA,sCAmBC;AAED,oDASC;AA9BD,SAAgB,aAAa,CAAC,MAA2B;IACxD,IAAI,MAAM,EAAE,KAAK;QAChB,OAAO,MAAM,CAAC,aAAa,EAAgB,CAAC;IAE7C,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB;QAC1D,OAAO,CAAC,CAAC;IAEV,QAAQ,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;QACjC,KAAK,EAAE,CAAC;QACR,KAAK,MAAM,CAAC;QACZ,KAAK,GAAG;YACP,OAAO,CAAC,CAAC;QACV,KAAK,GAAG;YACP,OAAO,CAAC,CAAC;QACV,KAAK,GAAG;YACP,OAAO,EAAE,CAAC;QACX;YACC,OAAO,CAAC,CAAC;IACX,CAAC;AACF,CAAC;AAED,SAAgB,oBAAoB,CAAC,KAAc,EAAE,UAAsB;IAC1E,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,MAAM,IAAI,KAAK,CAAC;IACrD,OAAO;QACN,KAAK,EAAM,UAAU,GAAG,CAAC;QACzB,KAAK,EAAM,OAAO;QAClB,KAAK,EAAM,OAAO;QAClB,MAAM,EAAK,OAAO;QAClB,QAAQ,EAAG,OAAO;KAClB,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"detect.js","sourceRoot":"","sources":["../../src/features/detect.ts"],"names":[],"mappings":";;AAEA,sCAmBC;AAED,oDAYC;AAjCD,SAAgB,aAAa,CAAC,MAA2B;IACxD,IAAI,MAAM,EAAE,KAAK;QAChB,OAAO,MAAM,CAAC,aAAa,EAAgB,CAAC;IAE7C,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB;QAC1D,OAAO,CAAC,CAAC;IAEV,QAAQ,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;QACjC,KAAK,EAAE,CAAC;QACR,KAAK,MAAM,CAAC;QACZ,KAAK,GAAG;YACP,OAAO,CAAC,CAAC;QACV,KAAK,GAAG;YACP,OAAO,CAAC,CAAC;QACV,KAAK,GAAG;YACP,OAAO,EAAE,CAAC;QACX;YACC,OAAO,CAAC,CAAC;IACX,CAAC;AACF,CAAC;AAED,SAAgB,oBAAoB,CACnC,KAAoB,EACpB,UAAuB;IAEvB,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,MAAM,IAAI,KAAK,CAAC;IACrD,OAAO;QACN,KAAK,EAAM,UAAU,GAAG,CAAC;QACzB,KAAK,EAAM,OAAO;QAClB,KAAK,EAAM,OAAO;QAClB,MAAM,EAAK,OAAO;QAClB,QAAQ,EAAG,OAAO;KAClB,CAAC;AACH,CAAC"}
@@ -1,5 +1,3 @@
1
- import { Socket } from "node:net";
2
- import type { ColorDepth, Features } from "./types";
3
- export type Args = [enabled: boolean, stream?: NodeJS.WriteStream] | [colorDepth: ColorDepth, stream?: NodeJS.WriteStream] | [features: Partial<Features>, stream?: NodeJS.WriteStream] | [socket: Socket] | [stream?: NodeJS.WriteStream];
1
+ import type { Args, Features } from "./types";
4
2
  export declare function getFeatures(...args: Args): Features;
5
3
  //# sourceMappingURL=features.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../src/features/features.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAiC,UAAU,CAAC;AAI7D,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAc,SAAS,CAAC;AAE5D,MAAM,MAAM,IAAI,GACb,CAAC,OAAO,EAAM,OAAO,EAAY,MAAM,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC,GAC7D,CAAC,UAAU,EAAG,UAAU,EAAS,MAAM,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC,GAC7D,CAAC,QAAQ,EAAK,OAAO,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC,GAC7D,CAAC,MAAM,EAAO,MAAM,CAAC,GACrB,CAAC,MAAM,CAAC,EAAM,MAAM,CAAC,WAAW,CAAC,CAAC;AAErC,wBAAgB,WAAW,CAAC,GAAG,IAAI,EAAE,IAAI,GAAG,QAAQ,CAkCnD"}
1
+ {"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../src/features/features.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,IAAI,EAAE,QAAQ,EAAC,MAAM,SAAS,CAAC;AAE5C,wBAAgB,WAAW,CAAC,GAAG,IAAI,EAAE,IAAI,GAAG,QAAQ,CA6BnD"}
@@ -6,20 +6,19 @@ const node_tty_1 = require("node:tty");
6
6
  const build_1 = require("./build");
7
7
  const detect_1 = require("./detect");
8
8
  function getFeatures(...args) {
9
- const [first, second] = args;
10
- if (typeof first === "boolean")
11
- return (0, build_1.boolean)((second ?? process.stdout).isTTY, first);
12
- if (typeof first === "number")
13
- return (0, build_1.number)((second ?? process.stdout).isTTY, first);
14
- let input = !first || typeof first !== "object"
15
- ? second ?? process.stdout
16
- : first;
17
- if (input instanceof node_tty_1.WriteStream)
18
- return (0, build_1.tty)(input);
19
- if (input instanceof node_net_1.Socket)
9
+ let [features, stream] = args;
10
+ if (typeof features === "boolean")
11
+ return (0, build_1.boolean)((stream ?? process.stdout).isTTY, features);
12
+ if (typeof features === "number")
13
+ return (0, build_1.number)((stream ?? process.stdout).isTTY, features);
14
+ if (!features || typeof features !== "object")
15
+ features = (stream ?? process.stdout);
16
+ if (features instanceof node_tty_1.WriteStream)
17
+ return (0, build_1.tty)(features);
18
+ if (features instanceof node_net_1.Socket)
20
19
  return (0, build_1.pipe)();
21
- const { colorDepth, style, caret, erase, scroll, terminal } = input;
22
- const stream = second ?? process.stdout;
20
+ const { colorDepth, style, caret, erase, scroll, terminal } = features;
21
+ stream ?? (stream = process.stdout);
23
22
  if (colorDepth)
24
23
  (0, build_1.build)(stream.isTTY, colorDepth, style, caret, erase, scroll, terminal);
25
24
  if (stream.isTTY)
@@ -1 +1 @@
1
- {"version":3,"file":"features.js","sourceRoot":"","sources":["../../src/features/features.ts"],"names":[],"mappings":";;AAaA,kCAkCC;AA/CD,uCAA6D;AAC7D,uCAA6D;AAC7D,mCAA4D;AAC5D,qCAA6D;AAU7D,SAAgB,WAAW,CAAC,GAAG,IAAU;IACxC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,IAGvB,CAAC;IAEF,IAAI,OAAO,KAAK,KAAK,SAAS;QAC7B,OAAO,IAAA,eAAO,EAAC,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAEzD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAC5B,OAAO,IAAA,cAAM,EAAC,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAA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ingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/features/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/features/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAE3B,mBAAmB,SAAS,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { Socket } from "node:net";
1
2
  export type ColorDepth = 1 | 3 | 4 | 8 | 24;
2
3
  export interface Features {
3
4
  colorDepth: ColorDepth;
@@ -7,4 +8,5 @@ export interface Features {
7
8
  scroll: boolean;
8
9
  terminal: boolean;
9
10
  }
11
+ export type Args = [enabled: boolean, stream?: NodeJS.WriteStream] | [colorDepth: ColorDepth, stream?: NodeJS.WriteStream] | [features: Partial<Features>, stream?: NodeJS.WriteStream] | [socket: Socket] | [stream?: NodeJS.WriteStream];
10
12
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/features/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;AAE5C,MAAM,WAAW,QAAQ;IACxB,UAAU,EAAG,UAAU,CAAC;IACxB,KAAK,EAAQ,OAAO,CAAC;IACrB,KAAK,EAAQ,OAAO,CAAC;IACrB,KAAK,EAAQ,OAAO,CAAC;IACrB,MAAM,EAAO,OAAO,CAAC;IACrB,QAAQ,EAAK,OAAO,CAAC;CACrB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/features/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAErC,MAAM,MAAM,UAAU,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;AAE5C,MAAM,WAAW,QAAQ;IACxB,UAAU,EAAG,UAAU,CAAC;IACxB,KAAK,EAAQ,OAAO,CAAC;IACrB,KAAK,EAAQ,OAAO,CAAC;IACrB,KAAK,EAAQ,OAAO,CAAC;IACrB,MAAM,EAAO,OAAO,CAAC;IACrB,QAAQ,EAAK,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,IAAI,GACb,CAAC,OAAO,EAAM,OAAO,EAAY,MAAM,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC,GAC7D,CAAC,UAAU,EAAG,UAAU,EAAS,MAAM,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC,GAC7D,CAAC,QAAQ,EAAK,OAAO,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC,GAC7D,CAAC,MAAM,EAAO,MAAM,CAAC,GACrB,CAAC,MAAM,CAAC,EAAM,MAAM,CAAC,WAAW,CAAC,CAAC"}
package/dist/pad.d.ts CHANGED
@@ -1,3 +1,13 @@
1
+ /**
2
+ * Pad the given text at the end with the specified fill string to the target visible length without
3
+ * counting ANSI escape codes.
4
+ */
1
5
  export declare const padEnd: (text: string, targetLength: number, fillString?: string) => string;
6
+ /**
7
+ * Pad the given text at the start with the specified fill string to the target visible length
8
+ * without counting ANSI escape codes.
9
+ */
2
10
  export declare const padStart: (text: string, targetLength: number, fillString?: string) => string;
11
+ export type PadEnd = typeof padEnd;
12
+ export type PadStart = typeof padStart;
3
13
  //# sourceMappingURL=pad.d.ts.map
package/dist/pad.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"pad.d.ts","sourceRoot":"","sources":["../src/pad.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,GAAI,MAAM,MAAM,EAAE,cAAc,MAAM,EAAE,mBAAgB,KAAG,MACgB,CAAC;AAE/F,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,EAAE,cAAc,MAAM,EAAE,mBAAgB,KAAG,MACc,CAAC"}
1
+ {"version":3,"file":"pad.d.ts","sourceRoot":"","sources":["../src/pad.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,MAAM,GAAI,MAAM,MAAM,EAAE,cAAc,MAAM,EAAE,mBAAgB,KAAG,MACgB,CAAC;AAE/F;;;GAGG;AACH,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,EAAE,cAAc,MAAM,EAAE,mBAAgB,KAAG,MACc,CAAC;AAE/F,MAAM,MAAM,MAAM,GAAK,OAAO,MAAM,CAAC;AACrC,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC"}
package/dist/pad.js CHANGED
@@ -2,8 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.padStart = exports.padEnd = void 0;
4
4
  const strip_1 = require("./strip");
5
+ /**
6
+ * Pad the given text at the end with the specified fill string to the target visible length without
7
+ * counting ANSI escape codes.
8
+ */
5
9
  const padEnd = (text, targetLength, fillString = " ") => text + fillString.repeat(Math.max(0, targetLength - (0, strip_1.visibleLength)(text)) / fillString.length);
6
10
  exports.padEnd = padEnd;
11
+ /**
12
+ * Pad the given text at the start with the specified fill string to the target visible length
13
+ * without counting ANSI escape codes.
14
+ */
7
15
  const padStart = (text, targetLength, fillString = " ") => fillString.repeat(Math.max(0, targetLength - (0, strip_1.visibleLength)(text)) / fillString.length) + text;
8
16
  exports.padStart = padStart;
9
17
  //# sourceMappingURL=pad.js.map
package/dist/pad.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"pad.js","sourceRoot":"","sources":["../src/pad.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAE/B,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,YAAoB,EAAE,UAAU,GAAG,GAAG,EAAU,EAAE,CACtF,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,GAAG,IAAA,qBAAa,EAAC,IAAI,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AADlF,QAAA,MAAM,UAC4E;AAExF,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,YAAoB,EAAE,UAAU,GAAG,GAAG,EAAU,EAAE,CACxF,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,GAAG,IAAA,qBAAa,EAAC,IAAI,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AADlF,QAAA,QAAQ,YAC0E"}
1
+ {"version":3,"file":"pad.js","sourceRoot":"","sources":["../src/pad.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAEtC;;;GAGG;AACI,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,YAAoB,EAAE,UAAU,GAAG,GAAG,EAAU,EAAE,CACtF,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,GAAG,IAAA,qBAAa,EAAC,IAAI,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AADlF,QAAA,MAAM,UAC4E;AAE/F;;;GAGG;AACI,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,YAAoB,EAAE,UAAU,GAAG,GAAG,EAAU,EAAE,CACxF,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,GAAG,IAAA,qBAAa,EAAC,IAAI,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AADlF,QAAA,QAAQ,YAC0E"}
@@ -0,0 +1,4 @@
1
+ import type { ColorDepth } from "../../features";
2
+ import type { ChainKey, Channel, ColorKey, FormatBuilder, Style } from "../types";
3
+ export declare function makeChannel(keys: ReadonlySet<ChainKey>, makeFormatter: FormatBuilder, style: Style, colorDepth: ColorDepth, channel: ColorKey): Channel;
4
+ //# sourceMappingURL=channel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../src/sgr/color/channel.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,UAAU,EAAC,MAA6C,gBAAgB,CAAC;AACtF,OAAO,KAAK,EAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAC,MAAM,UAAU,CAAC;AAahF,wBAAgB,WAAW,CAC1B,IAAI,EAAY,WAAW,CAAC,QAAQ,CAAC,EACrC,aAAa,EAAG,aAAa,EAC7B,KAAK,EAAW,KAAK,EACrB,UAAU,EAAM,UAAU,EAC1B,OAAO,EAAS,QAAQ,GACtB,OAAO,CAmBT"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeChannel = makeChannel;
4
+ const lazy_1 = require("../lazy");
5
+ const context_1 = require("./context");
6
+ const rgb_1 = require("./rgb");
7
+ const colors = [
8
+ "black",
9
+ "red",
10
+ "green",
11
+ "yellow",
12
+ "blue",
13
+ "magenta",
14
+ "cyan",
15
+ "white",
16
+ ];
17
+ function makeChannel(keys, makeFormatter, style, colorDepth, channel) {
18
+ const ctx = (0, context_1.buildContext)(keys, makeFormatter, style, colorDepth, channel);
19
+ const { build, bright, open, close } = ctx;
20
+ const rtn = {
21
+ rgb: (0, rgb_1.makeRGB)(ctx),
22
+ x256: (0, rgb_1.makeX256)(ctx),
23
+ default: colorDepth > 1 ? `\x1b[${close}m` : "",
24
+ };
25
+ for (let i = 0; i < colors.length; i++) {
26
+ const color = colors[i];
27
+ const brightColor = `bright${color[0].toUpperCase()}${color.slice(1)}`;
28
+ lazy_1.lazy.add(rtn, color, () => build(open + i));
29
+ lazy_1.lazy.add(rtn, brightColor, () => bright(i));
30
+ }
31
+ return rtn;
32
+ }
33
+ //# sourceMappingURL=channel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel.js","sourceRoot":"","sources":["../../../src/sgr/color/channel.ts"],"names":[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,CAAC;IAED,OAAO,GAAG,CAAC;AACZ,CAAC"}
@@ -1,5 +1,4 @@
1
- import type { ColorDepth } from "../../features/types";
2
- import type { Color } from "./types";
3
- export type { Color } from "./types";
4
- export declare const makeColor: (colorDepth?: ColorDepth) => Color;
1
+ import type { ColorDepth } from "../../features";
2
+ import type { ChainKey, Color, FormatBuilder, Style } from "../types";
3
+ export declare function makeColor(keys: ReadonlySet<ChainKey>, makeFormatter: FormatBuilder, style: Style, colorDepth: ColorDepth): Color<any>;
5
4
  //# sourceMappingURL=color.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/sgr/color/color.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAU,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EAAU,KAAK,EAAC,MAAM,SAAS,CAAC;AAE5C,YAAY,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAkFnC,eAAO,MAAM,SAAS,GAAI,aAAY,UAAc,KAAG,KAIpD,CAAC"}
1
+ {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/sgr/color/color.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAiC,gBAAgB,CAAC;AAC1E,OAAO,KAAK,EAAC,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAC,MAAM,UAAU,CAAC;AAIpE,wBAAgB,SAAS,CACxB,IAAI,EAAY,WAAW,CAAC,QAAQ,CAAC,EACrC,aAAa,EAAG,aAAa,EAC7B,KAAK,EAAW,KAAK,EACrB,UAAU,EAAM,UAAU,GACxB,KAAK,CAAC,GAAG,CAAC,CAcZ"}