@visulima/ansi 2.0.0 → 3.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 (152) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/LICENSE.md +1 -132
  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 +1 -27
  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 +1 -23
  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 -29
  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 -25
  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.mts DELETED
@@ -1,94 +0,0 @@
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;
package/dist/xterm.mjs DELETED
@@ -1,35 +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 keyModifierOptions = /* @__PURE__ */ __name((resource, value) => {
6
- if (resource < 0 || !Number.isInteger(resource)) {
7
- return "";
8
- }
9
- const pp = resource.toString();
10
- if (value !== void 0) {
11
- if (!Number.isInteger(value)) {
12
- return "";
13
- }
14
- const pv = value.toString();
15
- return `${CSI}>${pp};${pv}m`;
16
- }
17
- return `${CSI}>${pp}m`;
18
- }, "keyModifierOptions");
19
- const XTMODKEYS = keyModifierOptions;
20
- const queryKeyModifierOptions = /* @__PURE__ */ __name((resource) => {
21
- if (resource < 0 || !Number.isInteger(resource)) {
22
- return "";
23
- }
24
- const pp = resource.toString();
25
- return `${CSI}?${pp}m`;
26
- }, "queryKeyModifierOptions");
27
- const resetKeyModifierOptions = /* @__PURE__ */ __name((resource) => keyModifierOptions(resource), "resetKeyModifierOptions");
28
- const setKeyModifierOptions = /* @__PURE__ */ __name((resource, value) => keyModifierOptions(resource, value), "setKeyModifierOptions");
29
- const XTQMODKEYS = queryKeyModifierOptions;
30
- const setModifyOtherKeys1 = `${CSI}>4;1m`;
31
- const setModifyOtherKeys2 = `${CSI}>4;2m`;
32
- const resetModifyOtherKeys = `${CSI}>4m`;
33
- const queryModifyOtherKeys = `${CSI}?4m`;
34
-
35
- export { XTMODKEYS, XTQMODKEYS, keyModifierOptions, queryKeyModifierOptions, queryModifyOtherKeys, resetKeyModifierOptions, resetModifyOtherKeys, setKeyModifierOptions, setModifyOtherKeys1, setModifyOtherKeys2 };