@visulima/ansi 2.0.1 → 3.0.1

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 (152) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/LICENSE.md +2 -133
  3. package/README.md +226 -226
  4. package/dist/alternative-screen.d.ts +6 -74
  5. package/dist/alternative-screen.js +1 -0
  6. package/dist/clear.d.ts +6 -77
  7. package/dist/clear.js +1 -0
  8. package/dist/cursor.d.ts +48 -429
  9. package/dist/cursor.js +1 -0
  10. package/dist/erase.d.ts +14 -197
  11. package/dist/erase.js +1 -0
  12. package/dist/hyperlink.d.ts +2 -26
  13. package/dist/hyperlink.js +1 -0
  14. package/dist/image.d.ts +7 -69
  15. package/dist/image.js +1 -0
  16. package/dist/index.d.ts +30 -35
  17. package/dist/index.js +1 -0
  18. package/dist/iterm2.d.ts +43 -58
  19. package/dist/iterm2.js +1 -0
  20. package/dist/mode.d.ts +174 -648
  21. package/dist/mode.js +1 -0
  22. package/dist/mouse.d.ts +21 -203
  23. package/dist/mouse.js +1 -0
  24. package/dist/packem_shared/IT2_AUTO-BYrffRAq.js +1 -0
  25. package/dist/packem_shared/ITerm2File-C88DBJC-.js +1 -0
  26. package/dist/packem_shared/constants-D12jy2Zh.js +1 -0
  27. package/dist/packem_shared/cursor-D2UOfUc_.js +1 -0
  28. package/dist/packem_shared/resetProgressBar-BtBbpWCM.js +1 -0
  29. package/dist/packem_shared/restoreCursor-D3XBmqcY.js +2 -0
  30. package/dist/passthrough.d.ts +6 -77
  31. package/dist/passthrough.js +1 -0
  32. package/dist/reset.d.ts +4 -26
  33. package/dist/reset.js +1 -0
  34. package/dist/screen.d.ts +11 -234
  35. package/dist/screen.js +1 -0
  36. package/dist/scroll.d.ts +6 -67
  37. package/dist/scroll.js +1 -0
  38. package/dist/status.d.ts +48 -498
  39. package/dist/status.js +1 -0
  40. package/dist/strip.d.ts +2 -22
  41. package/dist/strip.js +1 -0
  42. package/dist/termcap.d.ts +5 -38
  43. package/dist/termcap.js +1 -0
  44. package/dist/title.d.ts +10 -185
  45. package/dist/title.js +1 -0
  46. package/dist/window-ops.d.ts +24 -396
  47. package/dist/window-ops.js +1 -0
  48. package/dist/xterm.d.ts +12 -94
  49. package/dist/xterm.js +1 -0
  50. package/package.json +45 -230
  51. package/dist/alternative-screen.cjs +0 -17
  52. package/dist/alternative-screen.d.cts +0 -74
  53. package/dist/alternative-screen.d.mts +0 -74
  54. package/dist/alternative-screen.mjs +0 -10
  55. package/dist/clear.cjs +0 -17
  56. package/dist/clear.d.cts +0 -77
  57. package/dist/clear.d.mts +0 -77
  58. package/dist/clear.mjs +0 -10
  59. package/dist/constants.d.cts +0 -20
  60. package/dist/constants.d.mts +0 -20
  61. package/dist/constants.d.ts +0 -20
  62. package/dist/cursor.cjs +0 -41
  63. package/dist/cursor.d.cts +0 -437
  64. package/dist/cursor.d.mts +0 -437
  65. package/dist/cursor.mjs +0 -3
  66. package/dist/erase.cjs +0 -64
  67. package/dist/erase.d.cts +0 -206
  68. package/dist/erase.d.mts +0 -206
  69. package/dist/erase.mjs +0 -49
  70. package/dist/helpers.d.cts +0 -14
  71. package/dist/helpers.d.mts +0 -14
  72. package/dist/helpers.d.ts +0 -14
  73. package/dist/hyperlink.cjs +0 -9
  74. package/dist/hyperlink.d.cts +0 -27
  75. package/dist/hyperlink.d.mts +0 -27
  76. package/dist/hyperlink.mjs +0 -7
  77. package/dist/image.cjs +0 -28
  78. package/dist/image.d.cts +0 -73
  79. package/dist/image.d.mts +0 -73
  80. package/dist/image.mjs +0 -24
  81. package/dist/index.cjs +0 -246
  82. package/dist/index.d.cts +0 -35
  83. package/dist/index.d.mts +0 -35
  84. package/dist/index.mjs +0 -25
  85. package/dist/iterm2/iterm2-properties.d.cts +0 -135
  86. package/dist/iterm2/iterm2-properties.d.mts +0 -135
  87. package/dist/iterm2/iterm2-properties.d.ts +0 -135
  88. package/dist/iterm2/iterm2-sequences.d.cts +0 -96
  89. package/dist/iterm2/iterm2-sequences.d.mts +0 -96
  90. package/dist/iterm2/iterm2-sequences.d.ts +0 -96
  91. package/dist/iterm2.cjs +0 -26
  92. package/dist/iterm2.d.cts +0 -58
  93. package/dist/iterm2.d.mts +0 -58
  94. package/dist/iterm2.mjs +0 -14
  95. package/dist/mode.cjs +0 -388
  96. package/dist/mode.d.cts +0 -657
  97. package/dist/mode.d.mts +0 -657
  98. package/dist/mode.mjs +0 -235
  99. package/dist/mouse.cjs +0 -127
  100. package/dist/mouse.d.cts +0 -230
  101. package/dist/mouse.d.mts +0 -230
  102. package/dist/mouse.mjs +0 -108
  103. package/dist/packem_shared/IT2_AUTO-5vTJQMm6.cjs +0 -15
  104. package/dist/packem_shared/IT2_AUTO-DnfCUXso.mjs +0 -8
  105. package/dist/packem_shared/ITerm2File-BGPqNSjB.cjs +0 -137
  106. package/dist/packem_shared/ITerm2File-DKFkdqdA.mjs +0 -130
  107. package/dist/packem_shared/constants-BK26O-46.cjs +0 -17
  108. package/dist/packem_shared/constants-CE7WkXh_.mjs +0 -9
  109. package/dist/packem_shared/cursor-CQKLCu7U.cjs +0 -105
  110. package/dist/packem_shared/cursor-DhFQcQ9g.mjs +0 -73
  111. package/dist/packem_shared/restoreCursor-C6pNB8UY.mjs +0 -336
  112. package/dist/packem_shared/restoreCursor-DC_ZKZwT.cjs +0 -342
  113. package/dist/passthrough.cjs +0 -38
  114. package/dist/passthrough.d.cts +0 -77
  115. package/dist/passthrough.d.mts +0 -77
  116. package/dist/passthrough.mjs +0 -31
  117. package/dist/reset.cjs +0 -9
  118. package/dist/reset.d.cts +0 -26
  119. package/dist/reset.d.mts +0 -26
  120. package/dist/reset.mjs +0 -4
  121. package/dist/screen.cjs +0 -41
  122. package/dist/screen.d.cts +0 -234
  123. package/dist/screen.d.mts +0 -234
  124. package/dist/screen.mjs +0 -29
  125. package/dist/scroll.cjs +0 -27
  126. package/dist/scroll.d.cts +0 -67
  127. package/dist/scroll.d.mts +0 -67
  128. package/dist/scroll.mjs +0 -20
  129. package/dist/status.cjs +0 -147
  130. package/dist/status.d.cts +0 -501
  131. package/dist/status.d.mts +0 -501
  132. package/dist/status.mjs +0 -104
  133. package/dist/strip.cjs +0 -20
  134. package/dist/strip.d.cts +0 -23
  135. package/dist/strip.d.mts +0 -23
  136. package/dist/strip.mjs +0 -18
  137. package/dist/termcap.cjs +0 -33
  138. package/dist/termcap.d.cts +0 -38
  139. package/dist/termcap.d.mts +0 -38
  140. package/dist/termcap.mjs +0 -27
  141. package/dist/title.cjs +0 -31
  142. package/dist/title.d.cts +0 -185
  143. package/dist/title.d.mts +0 -185
  144. package/dist/title.mjs +0 -20
  145. package/dist/window-ops.cjs +0 -85
  146. package/dist/window-ops.d.cts +0 -418
  147. package/dist/window-ops.d.mts +0 -418
  148. package/dist/window-ops.mjs +0 -63
  149. package/dist/xterm.cjs +0 -48
  150. package/dist/xterm.d.cts +0 -94
  151. package/dist/xterm.d.mts +0 -94
  152. package/dist/xterm.mjs +0 -35
package/dist/xterm.d.ts CHANGED
@@ -1,94 +1,12 @@
1
- /**
2
- * XTerm Key Modifier Options XTMODKEYS.
3
- * Sets or resets XTerm key modifier resources.
4
- *
5
- * Sequence: `CSI > Pp m` (to reset resource Pp)
6
- * Sequence: `CSI > Pp ; Pv m` (to set resource Pp to value Pv)
7
- * @param resource The resource parameter (Pp), a non-negative integer.
8
- * @param value Optional. The value parameter (Pv), a non-negative integer. If omitted, the resource is reset.
9
- * If provided and not positive, it's treated as if omitted (resource is reset).
10
- * @returns The ANSI escape sequence.
11
- * @see {@link https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_}
12
- */
13
- export declare const keyModifierOptions: (resource: number, value?: number) => string;
14
- /**
15
- * Alias for {@link keyModifierOptions}.
16
- * Provides a shorthand for setting or resetting XTerm key modifier resources.
17
- * @see keyModifierOptions
18
- */
19
- export declare const XTMODKEYS: (resource: number, value?: number) => string;
20
- /**
21
- * Query XTerm Key Modifier Options (XTQMODKEYS).
22
- * Requests the current setting of an XTerm key modifier resource.
23
- *
24
- * Sequence: `CSI ? Pp m`
25
- * @param resource The resource parameter (Pp), a non-negative integer.
26
- * @returns The ANSI escape sequence.
27
- * @see {@link https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_}
28
- */
29
- export declare const queryKeyModifierOptions: (resource: number) => string;
30
- /**
31
- * Resets an XTerm key modifier resource to its initial value.
32
- * This is an alias for `keyModifierOptions(resource)`.
33
- * @param resource The resource parameter (Pp).
34
- */
35
- export declare const resetKeyModifierOptions: (resource: number) => string;
36
- /**
37
- * Sets an XTerm key modifier resource to a specific value.
38
- * This is a more explicit alias for `keyModifierOptions(resource, value)`.
39
- * @param resource The resource parameter (Pp).
40
- * @param value The value parameter (Pv).
41
- */
42
- export declare const setKeyModifierOptions: (resource: number, value: number) => string;
43
- /** Alias for {@link queryKeyModifierOptions}. */
44
- export declare const XTQMODKEYS: (resource: number) => string;
45
- /**
46
- * Set XTerm "modifyOtherKeys" mode to mode 1 (sends modified escape sequences for certain keys).
47
- * Sequence: `CSI > 4 ; 1 m`
48
- * @example
49
- * ```typescript
50
- * import { setModifyOtherKeys1 } from "@visulima/ansi";
51
- *
52
- * process.stdout.write(setModifyOtherKeys1);
53
- * // Sends: "\x1b[>4;1m"
54
- * ```
55
- */
56
- export declare const setModifyOtherKeys1: string;
57
- /**
58
- * Set XTerm "modifyOtherKeys" mode to mode 2 (alternative modified escape sequences).
59
- * Sequence: `CSI > 4 ; 2 m`
60
- * @example
61
- * ```typescript
62
- * import { setModifyOtherKeys2 } from "@visulima/ansi";
63
- *
64
- * process.stdout.write(setModifyOtherKeys2);
65
- * // Sends: "\x1b[>4;2m"
66
- * ```
67
- */
68
- export declare const setModifyOtherKeys2: string;
69
- /**
70
- * Reset XTerm "modifyOtherKeys" to its default behavior (mode 0 or initial value).
71
- * Sequence: `CSI > 4 m` (This effectively sets resource 4, value 0, or resets resource 4).
72
- * @example
73
- * ```typescript
74
- * import { resetModifyOtherKeys } from "@visulima/ansi";
75
- *
76
- * process.stdout.write(resetModifyOtherKeys);
77
- * // Sends: "\x1b[>4m"
78
- * ```
79
- */
80
- export declare const resetModifyOtherKeys: string;
81
- /**
82
- * Query the current XTerm "modifyOtherKeys" mode.
83
- * Sequence: `CSI ? 4 m`
84
- * Response: `CSI > 4 ; Ps m` where Ps is 0, 1, or 2.
85
- * @example
86
- * ```typescript
87
- * import { queryModifyOtherKeys } from "@visulima/ansi";
88
- *
89
- * process.stdout.write(queryModifyOtherKeys);
90
- * // Sends: "\x1b[?4m"
91
- * // Expect a response like: "\x1b[>4;1m" if mode 1 is set.
92
- * ```
93
- */
94
- export declare const queryModifyOtherKeys: string;
1
+ declare const keyModifierOptions: (resource: number, value?: number) => string;
2
+ declare const XTMODKEYS: (resource: number, value?: number) => string;
3
+ declare const queryKeyModifierOptions: (resource: number) => string;
4
+ declare const resetKeyModifierOptions: (resource: number) => string;
5
+ declare const setKeyModifierOptions: (resource: number, value: number) => string;
6
+ declare const XTQMODKEYS: (resource: number) => string;
7
+ declare const setModifyOtherKeys1: string;
8
+ declare const setModifyOtherKeys2: string;
9
+ declare const resetModifyOtherKeys: string;
10
+ declare const queryModifyOtherKeys: string;
11
+
12
+ export { XTMODKEYS, XTQMODKEYS, keyModifierOptions, queryKeyModifierOptions, queryModifyOtherKeys, resetKeyModifierOptions, resetModifyOtherKeys, setKeyModifierOptions, setModifyOtherKeys1, setModifyOtherKeys2 };
package/dist/xterm.js ADDED
@@ -0,0 +1 @@
1
+ var f=Object.defineProperty;var s=(e,r)=>f(e,"name",{value:r,configurable:!0});import{C as i}from"./packem_shared/constants-D12jy2Zh.js";var u=Object.defineProperty,t=s((e,r)=>u(e,"name",{value:r,configurable:!0}),"n");const o=t((e,r)=>{if(e<0||!Number.isInteger(e))return"";const n=e.toString();if(r!==void 0){if(!Number.isInteger(r))return"";const y=r.toString();return`${i}>${n};${y}m`}return`${i}>${n}m`},"keyModifierOptions"),m=o,O=t(e=>{if(e<0||!Number.isInteger(e))return"";const r=e.toString();return`${i}?${r}m`},"queryKeyModifierOptions"),K=t(e=>o(e),"resetKeyModifierOptions"),p=t((e,r)=>o(e,r),"setKeyModifierOptions"),$=O,g=`${i}>4;1m`,a=`${i}>4;2m`,c=`${i}>4m`,S=`${i}?4m`;export{m as XTMODKEYS,$ as XTQMODKEYS,o as keyModifierOptions,O as queryKeyModifierOptions,S as queryModifyOtherKeys,K as resetKeyModifierOptions,c as resetModifyOtherKeys,p as setKeyModifierOptions,g as setModifyOtherKeys1,a as setModifyOtherKeys2};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/ansi",
3
- "version": "2.0.1",
3
+ "version": "3.0.1",
4
4
  "description": "ANSI escape codes for some terminal swag.",
5
5
  "keywords": [
6
6
  "alternative-screen",
@@ -67,282 +67,97 @@
67
67
  "type": "module",
68
68
  "exports": {
69
69
  ".": {
70
- "require": {
71
- "types": "./dist/index.d.cts",
72
- "default": "./dist/index.cjs"
73
- },
74
- "import": {
75
- "types": "./dist/index.d.mts",
76
- "default": "./dist/index.mjs"
77
- }
70
+ "types": "./dist/index.d.ts",
71
+ "default": "./dist/index.js"
78
72
  },
79
73
  "./alternative-screen": {
80
- "require": {
81
- "types": "./dist/alternative-screen.d.cts",
82
- "default": "./dist/alternative-screen.cjs"
83
- },
84
- "import": {
85
- "types": "./dist/alternative-screen.d.mts",
86
- "default": "./dist/alternative-screen.mjs"
87
- }
74
+ "types": "./dist/alternative-screen.d.ts",
75
+ "default": "./dist/alternative-screen.js"
88
76
  },
89
77
  "./clear": {
90
- "require": {
91
- "types": "./dist/clear.d.cts",
92
- "default": "./dist/clear.cjs"
93
- },
94
- "import": {
95
- "types": "./dist/clear.d.mts",
96
- "default": "./dist/clear.mjs"
97
- }
78
+ "types": "./dist/clear.d.ts",
79
+ "default": "./dist/clear.js"
98
80
  },
99
81
  "./cursor": {
100
- "require": {
101
- "types": "./dist/cursor.d.cts",
102
- "default": "./dist/cursor.cjs"
103
- },
104
- "import": {
105
- "types": "./dist/cursor.d.mts",
106
- "default": "./dist/cursor.mjs"
107
- }
82
+ "types": "./dist/cursor.d.ts",
83
+ "default": "./dist/cursor.js"
108
84
  },
109
85
  "./erase": {
110
- "require": {
111
- "types": "./dist/erase.d.cts",
112
- "default": "./dist/erase.cjs"
113
- },
114
- "import": {
115
- "types": "./dist/erase.d.mts",
116
- "default": "./dist/erase.mjs"
117
- }
86
+ "types": "./dist/erase.d.ts",
87
+ "default": "./dist/erase.js"
118
88
  },
119
89
  "./image": {
120
- "require": {
121
- "types": "./dist/image.d.cts",
122
- "default": "./dist/image.cjs"
123
- },
124
- "import": {
125
- "types": "./dist/image.d.mts",
126
- "default": "./dist/image.mjs"
127
- }
90
+ "types": "./dist/image.d.ts",
91
+ "default": "./dist/image.js"
128
92
  },
129
93
  "./hyperlink": {
130
- "require": {
131
- "types": "./dist/hyperlink.d.cts",
132
- "default": "./dist/hyperlink.cjs"
133
- },
134
- "import": {
135
- "types": "./dist/hyperlink.d.mts",
136
- "default": "./dist/hyperlink.mjs"
137
- }
94
+ "types": "./dist/hyperlink.d.ts",
95
+ "default": "./dist/hyperlink.js"
138
96
  },
139
97
  "./scroll": {
140
- "require": {
141
- "types": "./dist/scroll.d.cts",
142
- "default": "./dist/scroll.cjs"
143
- },
144
- "import": {
145
- "types": "./dist/scroll.d.mts",
146
- "default": "./dist/scroll.mjs"
147
- }
98
+ "types": "./dist/scroll.d.ts",
99
+ "default": "./dist/scroll.js"
148
100
  },
149
101
  "./strip": {
150
- "require": {
151
- "types": "./dist/strip.d.cts",
152
- "default": "./dist/strip.cjs"
153
- },
154
- "import": {
155
- "types": "./dist/strip.d.mts",
156
- "default": "./dist/strip.mjs"
157
- }
102
+ "types": "./dist/strip.d.ts",
103
+ "default": "./dist/strip.js"
158
104
  },
159
105
  "./termcap": {
160
- "require": {
161
- "types": "./dist/termcap.d.cts",
162
- "default": "./dist/termcap.cjs"
163
- },
164
- "import": {
165
- "types": "./dist/termcap.d.mts",
166
- "default": "./dist/termcap.mjs"
167
- }
106
+ "types": "./dist/termcap.d.ts",
107
+ "default": "./dist/termcap.js"
168
108
  },
169
109
  "./title": {
170
- "require": {
171
- "types": "./dist/title.d.cts",
172
- "default": "./dist/title.cjs"
173
- },
174
- "import": {
175
- "types": "./dist/title.d.mts",
176
- "default": "./dist/title.mjs"
177
- }
110
+ "types": "./dist/title.d.ts",
111
+ "default": "./dist/title.js"
178
112
  },
179
113
  "./window-ops": {
180
- "require": {
181
- "types": "./dist/window-ops.d.cts",
182
- "default": "./dist/window-ops.cjs"
183
- },
184
- "import": {
185
- "types": "./dist/window-ops.d.mts",
186
- "default": "./dist/window-ops.mjs"
187
- }
114
+ "types": "./dist/window-ops.d.ts",
115
+ "default": "./dist/window-ops.js"
188
116
  },
189
117
  "./xterm": {
190
- "require": {
191
- "types": "./dist/xterm.d.cts",
192
- "default": "./dist/xterm.cjs"
193
- },
194
- "import": {
195
- "types": "./dist/xterm.d.mts",
196
- "default": "./dist/xterm.mjs"
197
- }
118
+ "types": "./dist/xterm.d.ts",
119
+ "default": "./dist/xterm.js"
198
120
  },
199
121
  "./iterm2": {
200
- "require": {
201
- "types": "./dist/iterm2.d.cts",
202
- "default": "./dist/iterm2.cjs"
203
- },
204
- "import": {
205
- "types": "./dist/iterm2.d.mts",
206
- "default": "./dist/iterm2.mjs"
207
- }
122
+ "types": "./dist/iterm2.d.ts",
123
+ "default": "./dist/iterm2.js"
208
124
  },
209
125
  "./mode": {
210
- "require": {
211
- "types": "./dist/mode.d.cts",
212
- "default": "./dist/mode.cjs"
213
- },
214
- "import": {
215
- "types": "./dist/mode.d.mts",
216
- "default": "./dist/mode.mjs"
217
- }
126
+ "types": "./dist/mode.d.ts",
127
+ "default": "./dist/mode.js"
218
128
  },
219
129
  "./mouse": {
220
- "require": {
221
- "types": "./dist/mouse.d.cts",
222
- "default": "./dist/mouse.cjs"
223
- },
224
- "import": {
225
- "types": "./dist/mouse.d.mts",
226
- "default": "./dist/mouse.mjs"
227
- }
130
+ "types": "./dist/mouse.d.ts",
131
+ "default": "./dist/mouse.js"
228
132
  },
229
133
  "./passthrough": {
230
- "require": {
231
- "types": "./dist/passthrough.d.cts",
232
- "default": "./dist/passthrough.cjs"
233
- },
234
- "import": {
235
- "types": "./dist/passthrough.d.mts",
236
- "default": "./dist/passthrough.mjs"
237
- }
134
+ "types": "./dist/passthrough.d.ts",
135
+ "default": "./dist/passthrough.js"
238
136
  },
239
137
  "./reset": {
240
- "require": {
241
- "types": "./dist/reset.d.cts",
242
- "default": "./dist/reset.cjs"
243
- },
244
- "import": {
245
- "types": "./dist/reset.d.mts",
246
- "default": "./dist/reset.mjs"
247
- }
138
+ "types": "./dist/reset.d.ts",
139
+ "default": "./dist/reset.js"
248
140
  },
249
141
  "./screen": {
250
- "require": {
251
- "types": "./dist/screen.d.cts",
252
- "default": "./dist/screen.cjs"
253
- },
254
- "import": {
255
- "types": "./dist/screen.d.mts",
256
- "default": "./dist/screen.mjs"
257
- }
142
+ "types": "./dist/screen.d.ts",
143
+ "default": "./dist/screen.js"
258
144
  },
259
145
  "./status": {
260
- "require": {
261
- "types": "./dist/status.d.cts",
262
- "default": "./dist/status.cjs"
263
- },
264
- "import": {
265
- "types": "./dist/status.d.mts",
266
- "default": "./dist/status.mjs"
267
- }
146
+ "types": "./dist/status.d.ts",
147
+ "default": "./dist/status.js"
268
148
  },
269
149
  "./package.json": "./package.json"
270
150
  },
271
- "main": "dist/index.cjs",
272
- "module": "dist/index.mjs",
273
- "browser": "./dist/index.mjs",
274
- "types": "dist/index.d.ts",
275
- "typesVersions": {
276
- ">=5.0": {
277
- ".": [
278
- "./dist/index.d.ts"
279
- ],
280
- "alternative-screen": [
281
- "./dist/alternative-screen.d.ts"
282
- ],
283
- "clear": [
284
- "./dist/clear.d.ts"
285
- ],
286
- "cursor": [
287
- "./dist/cursor.d.ts"
288
- ],
289
- "erase": [
290
- "./dist/erase.d.ts"
291
- ],
292
- "image": [
293
- "./dist/image.d.ts"
294
- ],
295
- "hyperlink": [
296
- "./dist/hyperlink.d.ts"
297
- ],
298
- "scroll": [
299
- "./dist/scroll.d.ts"
300
- ],
301
- "strip": [
302
- "./dist/strip.d.ts"
303
- ],
304
- "termcap": [
305
- "./dist/termcap.d.ts"
306
- ],
307
- "title": [
308
- "./dist/title.d.ts"
309
- ],
310
- "window-ops": [
311
- "./dist/window-ops.d.ts"
312
- ],
313
- "xterm": [
314
- "./dist/xterm.d.ts"
315
- ],
316
- "iterm2": [
317
- "./dist/iterm2.d.ts"
318
- ],
319
- "mode": [
320
- "./dist/mode.d.ts"
321
- ],
322
- "mouse": [
323
- "./dist/mouse.d.ts"
324
- ],
325
- "passthrough": [
326
- "./dist/passthrough.d.ts"
327
- ],
328
- "reset": [
329
- "./dist/reset.d.ts"
330
- ],
331
- "screen": [
332
- "./dist/screen.d.ts"
333
- ],
334
- "status": [
335
- "./dist/status.d.ts"
336
- ]
337
- }
338
- },
339
151
  "files": [
340
152
  "dist",
341
153
  "README.md",
342
154
  "CHANGELOG.md"
343
155
  ],
156
+ "dependencies": {
157
+ "type-fest": "^5.1.0"
158
+ },
344
159
  "engines": {
345
- "node": ">=20.18 <=24.x"
160
+ "node": ">=20.19 <=25.x"
346
161
  },
347
162
  "publishConfig": {
348
163
  "access": "public",
@@ -1,17 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
-
5
- const constants = require('./packem_shared/constants-BK26O-46.cjs');
6
-
7
- var __defProp = Object.defineProperty;
8
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
- const ALT_SCREEN_ON = `${constants.CSI}?1049h`;
10
- const ALT_SCREEN_OFF = `${constants.CSI}?1049l`;
11
- const alternativeScreenOn = /* @__PURE__ */ __name(() => ALT_SCREEN_ON, "alternativeScreenOn");
12
- const alternativeScreenOff = /* @__PURE__ */ __name(() => ALT_SCREEN_OFF, "alternativeScreenOff");
13
-
14
- exports.ALT_SCREEN_OFF = ALT_SCREEN_OFF;
15
- exports.ALT_SCREEN_ON = ALT_SCREEN_ON;
16
- exports.alternativeScreenOff = alternativeScreenOff;
17
- exports.alternativeScreenOn = alternativeScreenOn;
@@ -1,74 +0,0 @@
1
- /**
2
- * ANSI escape sequence to enable the alternative screen buffer.
3
- *
4
- * This sequence (`CSI ?1049h`) instructs the terminal to switch to the alternative screen buffer.
5
- * This is a common practice for full-screen terminal applications (e.g., vim, less, htop)
6
- * to provide a separate screen area for their interface, leaving the original shell content
7
- * undisturbed and restoring it upon exit.
8
- * When this mode is activated, the original screen content is typically saved by the terminal,
9
- * and a blank screen is presented. Operations then occur on this alternative buffer.
10
- *
11
- * The specific behavior (like whether the screen is cleared on switch) can sometimes vary
12
- * slightly between terminal emulators. `?1049h` generally includes saving the cursor position
13
- * along with the screen content and clearing the alternative screen.
14
- * It is closely related to mode `?47h`, which also switches to an alternative buffer but might
15
- * have different semantics regarding screen clearing and cursor saving.
16
- * Mode `?1049h` is generally preferred for a more robust alternative screen experience.
17
- * @see {@link ALT_SCREEN_OFF} for the sequence to disable the alternative screen buffer.
18
- * @see {@link alternativeScreenOn} for a function that returns this sequence.
19
- * @see {@link https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-The-Alternate-Screen-Buffer} Xterm Control Sequences documentation.
20
- * @see {@link https://vt100.net/docs/vt510-rm/DECSLPP.html} (related DEC modes, though 1049 is more common for this behavior).
21
- */
22
- export declare const ALT_SCREEN_ON: string;
23
- /**
24
- * ANSI escape sequence to disable the alternative screen buffer.
25
- *
26
- * This sequence (`CSI ?1049l`) instructs the terminal to switch back from the alternative
27
- * screen buffer to the main screen buffer. When this occurs, the terminal typically
28
- * restores the screen content and cursor position that were saved when the alternative
29
- * buffer was activated by {@link ALT_SCREEN_ON}.
30
- *
31
- * This is used when a full-screen application exits, allowing the user to return to their
32
- * previous shell session seamlessly.
33
- * @see {@link ALT_SCREEN_ON} for the sequence to enable the alternative screen buffer.
34
- * @see {@link alternativeScreenOff} for a function that returns this sequence.
35
- */
36
- export declare const ALT_SCREEN_OFF: string;
37
- /**
38
- * Returns the ANSI escape sequence to enable the alternative screen buffer.
39
- *
40
- * This function is a convenience wrapper around the {@link ALT_SCREEN_ON} constant.
41
- * It provides a more descriptive way to obtain the sequence for enabling the
42
- * alternative screen, often used at the initialization phase of a full-screen
43
- * terminal application.
44
- * @returns The ANSI escape sequence (`CSI ?1049h`) for enabling the alternative screen buffer.
45
- * @example
46
- * ```typescript
47
- * import { alternativeScreenOn } from '@visulima/ansi/alternative-screen';
48
- *
49
- * process.stdout.write(alternativeScreenOn());
50
- * // Terminal switches to the alternative screen buffer.
51
- * ```
52
- * @see {@link ALT_SCREEN_ON}
53
- * @see {@link alternativeScreenOff}
54
- */
55
- export declare const alternativeScreenOn: () => string;
56
- /**
57
- * Returns the ANSI escape sequence to disable the alternative screen buffer.
58
- *
59
- * This function is a convenience wrapper around the {@link ALT_SCREEN_OFF} constant.
60
- * It provides a more descriptive way to obtain the sequence for disabling the
61
- * alternative screen, typically used when a full-screen terminal application is exiting
62
- * to restore the user's original terminal state.
63
- * @returns The ANSI escape sequence (`CSI ?1049l`) for disabling the alternative screen buffer.
64
- * @example
65
- * ```typescript
66
- * import { alternativeScreenOff } from '@visulima/ansi/alternative-screen';
67
- *
68
- * process.stdout.write(alternativeScreenOff());
69
- * // Terminal switches back to the main screen buffer, restoring previous content.
70
- * ```
71
- * @see {@link ALT_SCREEN_OFF}
72
- * @see {@link alternativeScreenOn}
73
- */
74
- export declare const alternativeScreenOff: () => string;
@@ -1,74 +0,0 @@
1
- /**
2
- * ANSI escape sequence to enable the alternative screen buffer.
3
- *
4
- * This sequence (`CSI ?1049h`) instructs the terminal to switch to the alternative screen buffer.
5
- * This is a common practice for full-screen terminal applications (e.g., vim, less, htop)
6
- * to provide a separate screen area for their interface, leaving the original shell content
7
- * undisturbed and restoring it upon exit.
8
- * When this mode is activated, the original screen content is typically saved by the terminal,
9
- * and a blank screen is presented. Operations then occur on this alternative buffer.
10
- *
11
- * The specific behavior (like whether the screen is cleared on switch) can sometimes vary
12
- * slightly between terminal emulators. `?1049h` generally includes saving the cursor position
13
- * along with the screen content and clearing the alternative screen.
14
- * It is closely related to mode `?47h`, which also switches to an alternative buffer but might
15
- * have different semantics regarding screen clearing and cursor saving.
16
- * Mode `?1049h` is generally preferred for a more robust alternative screen experience.
17
- * @see {@link ALT_SCREEN_OFF} for the sequence to disable the alternative screen buffer.
18
- * @see {@link alternativeScreenOn} for a function that returns this sequence.
19
- * @see {@link https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-The-Alternate-Screen-Buffer} Xterm Control Sequences documentation.
20
- * @see {@link https://vt100.net/docs/vt510-rm/DECSLPP.html} (related DEC modes, though 1049 is more common for this behavior).
21
- */
22
- export declare const ALT_SCREEN_ON: string;
23
- /**
24
- * ANSI escape sequence to disable the alternative screen buffer.
25
- *
26
- * This sequence (`CSI ?1049l`) instructs the terminal to switch back from the alternative
27
- * screen buffer to the main screen buffer. When this occurs, the terminal typically
28
- * restores the screen content and cursor position that were saved when the alternative
29
- * buffer was activated by {@link ALT_SCREEN_ON}.
30
- *
31
- * This is used when a full-screen application exits, allowing the user to return to their
32
- * previous shell session seamlessly.
33
- * @see {@link ALT_SCREEN_ON} for the sequence to enable the alternative screen buffer.
34
- * @see {@link alternativeScreenOff} for a function that returns this sequence.
35
- */
36
- export declare const ALT_SCREEN_OFF: string;
37
- /**
38
- * Returns the ANSI escape sequence to enable the alternative screen buffer.
39
- *
40
- * This function is a convenience wrapper around the {@link ALT_SCREEN_ON} constant.
41
- * It provides a more descriptive way to obtain the sequence for enabling the
42
- * alternative screen, often used at the initialization phase of a full-screen
43
- * terminal application.
44
- * @returns The ANSI escape sequence (`CSI ?1049h`) for enabling the alternative screen buffer.
45
- * @example
46
- * ```typescript
47
- * import { alternativeScreenOn } from '@visulima/ansi/alternative-screen';
48
- *
49
- * process.stdout.write(alternativeScreenOn());
50
- * // Terminal switches to the alternative screen buffer.
51
- * ```
52
- * @see {@link ALT_SCREEN_ON}
53
- * @see {@link alternativeScreenOff}
54
- */
55
- export declare const alternativeScreenOn: () => string;
56
- /**
57
- * Returns the ANSI escape sequence to disable the alternative screen buffer.
58
- *
59
- * This function is a convenience wrapper around the {@link ALT_SCREEN_OFF} constant.
60
- * It provides a more descriptive way to obtain the sequence for disabling the
61
- * alternative screen, typically used when a full-screen terminal application is exiting
62
- * to restore the user's original terminal state.
63
- * @returns The ANSI escape sequence (`CSI ?1049l`) for disabling the alternative screen buffer.
64
- * @example
65
- * ```typescript
66
- * import { alternativeScreenOff } from '@visulima/ansi/alternative-screen';
67
- *
68
- * process.stdout.write(alternativeScreenOff());
69
- * // Terminal switches back to the main screen buffer, restoring previous content.
70
- * ```
71
- * @see {@link ALT_SCREEN_OFF}
72
- * @see {@link alternativeScreenOn}
73
- */
74
- export declare const alternativeScreenOff: () => string;
@@ -1,10 +0,0 @@
1
- import { C as CSI } from './packem_shared/constants-CE7WkXh_.mjs';
2
-
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- const ALT_SCREEN_ON = `${CSI}?1049h`;
6
- const ALT_SCREEN_OFF = `${CSI}?1049l`;
7
- const alternativeScreenOn = /* @__PURE__ */ __name(() => ALT_SCREEN_ON, "alternativeScreenOn");
8
- const alternativeScreenOff = /* @__PURE__ */ __name(() => ALT_SCREEN_OFF, "alternativeScreenOff");
9
-
10
- export { ALT_SCREEN_OFF, ALT_SCREEN_ON, alternativeScreenOff, alternativeScreenOn };
package/dist/clear.cjs DELETED
@@ -1,17 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
-
5
- const constants = require('./packem_shared/constants-BK26O-46.cjs');
6
- const cursor = require('./packem_shared/cursor-CQKLCu7U.cjs');
7
- const erase = require('./erase.cjs');
8
-
9
- const clearScreenFromTopLeft = cursor.cursorTo(0, 0) + erase.eraseDisplay(erase.EraseDisplayMode.ToEnd);
10
- const clearLineAndHomeCursor = `${erase.eraseInLine(erase.EraseLineMode.EntireLine) + constants.CSI}G`;
11
- const clearScreenAndHomeCursor = `${constants.CSI}H${erase.eraseDisplay(erase.EraseDisplayMode.EntireScreen)}`;
12
- const resetTerminal = cursor.isWindows ? `${erase.eraseDisplay(erase.EraseDisplayMode.EntireScreen) + constants.CSI}0f` : `${erase.eraseDisplay(erase.EraseDisplayMode.EntireScreen) + erase.eraseDisplay(erase.EraseDisplayMode.EntireScreenAndScrollback) + constants.CSI}H${constants.ESC}c`;
13
-
14
- exports.clearLineAndHomeCursor = clearLineAndHomeCursor;
15
- exports.clearScreenAndHomeCursor = clearScreenAndHomeCursor;
16
- exports.clearScreenFromTopLeft = clearScreenFromTopLeft;
17
- exports.resetTerminal = resetTerminal;