@visulima/ansi 4.0.0-alpha.2 → 4.0.0-alpha.3

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 (53) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/alternative-screen.d.ts +74 -0
  3. package/dist/alternative-screen.js +1 -0
  4. package/dist/clear.d.ts +77 -0
  5. package/dist/clear.js +1 -0
  6. package/dist/constants.d.ts +20 -0
  7. package/dist/cursor.d.ts +437 -0
  8. package/dist/cursor.js +1 -0
  9. package/dist/erase.d.ts +206 -0
  10. package/dist/erase.js +1 -0
  11. package/dist/helpers.d.ts +14 -0
  12. package/dist/hyperlink.d.ts +27 -0
  13. package/dist/hyperlink.js +1 -0
  14. package/dist/image.d.ts +73 -0
  15. package/dist/image.js +1 -0
  16. package/dist/index.d.ts +36 -0
  17. package/dist/index.js +1 -0
  18. package/dist/iterm2/iterm2-properties.d.ts +135 -0
  19. package/dist/iterm2/iterm2-sequences.d.ts +96 -0
  20. package/dist/iterm2.d.ts +58 -0
  21. package/dist/iterm2.js +1 -0
  22. package/dist/mode.d.ts +726 -0
  23. package/dist/mode.js +1 -0
  24. package/dist/mouse.d.ts +230 -0
  25. package/dist/mouse.js +1 -0
  26. package/dist/packem_shared/IT2_AUTO-BYrffRAq.js +1 -0
  27. package/dist/packem_shared/ITerm2File-C88DBJC-.js +1 -0
  28. package/dist/packem_shared/constants-D12jy2Zh.js +1 -0
  29. package/dist/packem_shared/cursor-nxpKt8Tn.js +1 -0
  30. package/dist/packem_shared/resetProgressBar-BtBbpWCM.js +1 -0
  31. package/dist/packem_shared/restoreCursor-CHy0jZuu.js +2 -0
  32. package/dist/passthrough.d.ts +77 -0
  33. package/dist/passthrough.js +1 -0
  34. package/dist/progress.d.ts +41 -0
  35. package/dist/reset.d.ts +26 -0
  36. package/dist/reset.js +1 -0
  37. package/dist/screen.d.ts +234 -0
  38. package/dist/screen.js +1 -0
  39. package/dist/scroll.d.ts +67 -0
  40. package/dist/scroll.js +1 -0
  41. package/dist/status.d.ts +524 -0
  42. package/dist/status.js +1 -0
  43. package/dist/strip.d.ts +23 -0
  44. package/dist/strip.js +1 -0
  45. package/dist/termcap.d.ts +38 -0
  46. package/dist/termcap.js +1 -0
  47. package/dist/title.d.ts +185 -0
  48. package/dist/title.js +1 -0
  49. package/dist/window-ops.d.ts +418 -0
  50. package/dist/window-ops.js +1 -0
  51. package/dist/xterm.d.ts +94 -0
  52. package/dist/xterm.js +1 -0
  53. package/package.json +1 -46
@@ -0,0 +1,94 @@
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.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": "4.0.0-alpha.2",
3
+ "version": "4.0.0-alpha.3",
4
4
  "description": "ANSI escape codes for some terminal swag.",
5
5
  "keywords": [
6
6
  "alternative-screen",
@@ -156,56 +156,11 @@
156
156
  "dependencies": {
157
157
  "type-fest": "^5.3.0"
158
158
  },
159
- "devDependencies": {
160
- "@anolilab/eslint-config": "16.4.4",
161
- "@anolilab/prettier-config": "^6.0.8",
162
- "@anolilab/semantic-release-pnpm": "3.2.2",
163
- "@anolilab/semantic-release-preset": "^12.1.2",
164
- "@arethetypeswrong/cli": "^0.18.2",
165
- "@secretlint/secretlint-rule-preset-recommend": "^11.2.5",
166
- "@total-typescript/ts-reset": "^0.6.1",
167
- "@types/node": "24.10.1",
168
- "@visulima/colorize": "2.0.0-alpha.2",
169
- "@visulima/packem": "2.0.0-alpha.40",
170
- "@visulima/path": "3.0.0-alpha.2",
171
- "@vitest/coverage-v8": "^4.0.15",
172
- "@vitest/ui": "^4.0.15",
173
- "ansi-regex": "^6.2.2",
174
- "conventional-changelog-conventionalcommits": "9.1.0",
175
- "esbuild": "0.27.1",
176
- "eslint": "9.39.1",
177
- "jiti": "^2.6.1",
178
- "prettier": "^3.7.4",
179
- "publint": "^0.3.15",
180
- "restore-cursor": "^5.1.0",
181
- "rimraf": "6.1.2",
182
- "secretlint": "11.2.5",
183
- "semantic-release": "^25.0.2",
184
- "typescript": "5.9.3",
185
- "vitest": "^4.0.15"
186
- },
187
159
  "engines": {
188
160
  "node": ">=22.13 <=25.x"
189
161
  },
190
162
  "publishConfig": {
191
163
  "access": "public",
192
164
  "provenance": true
193
- },
194
- "scripts": {
195
- "build": "packem build --development",
196
- "build:prod": "packem build --production",
197
- "clean": "rimraf node_modules dist .eslintcache",
198
- "dev": "pnpm run build --watch",
199
- "lint:attw": "attw --pack",
200
- "lint:eslint": "eslint . --cache --concurrency auto",
201
- "lint:eslint:fix": "eslint . --cache --concurrency auto --fix",
202
- "lint:package-json": "publint --strict",
203
- "lint:prettier": "prettier --config=.prettierrc.cjs --check .",
204
- "lint:prettier:fix": "prettier --config=.prettierrc.cjs --write .",
205
- "lint:types": "tsc --noEmit",
206
- "test": "vitest run",
207
- "test:coverage": "vitest run --coverage",
208
- "test:ui": "vitest --ui --coverage.enabled=true",
209
- "test:watch": "vitest"
210
165
  }
211
166
  }