@tuidom/testing 0.2.3 → 0.4.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.
@@ -33,6 +33,13 @@ export declare class MockTerminalBackend implements ITerminalBackend {
33
33
  onResize(callback: (size: Size) => void): void;
34
34
  onOscResponse(callback: (code: number, data: string) => void): void;
35
35
  probeKeyboardProtocol(onResult: (supported: boolean) => void): void;
36
+ /**
37
+ * What {@link probeTerminalVersion} reports (XTVERSION payload, e.g. `"iTerm2 3.5.0"`).
38
+ * `undefined` (default) = the terminal didn't answer. Set it before the app probes.
39
+ */
40
+ terminalVersion: string | undefined;
41
+ /** Answers synchronously with {@link terminalVersion} — no terminal round-trip to wait for. */
42
+ probeTerminalVersion(onResult: (nameAndVersion: string | undefined) => void): void;
36
43
  cursorPosition: Point;
37
44
  renderFrame(grid: Grid, cursorPosition: Point): void;
38
45
  getSize(): Size;
@@ -58,6 +58,15 @@ export class MockTerminalBackend {
58
58
  probeKeyboardProtocol(onResult) {
59
59
  this.keyboardProbeCallbacks.push(onResult);
60
60
  }
61
+ /**
62
+ * What {@link probeTerminalVersion} reports (XTVERSION payload, e.g. `"iTerm2 3.5.0"`).
63
+ * `undefined` (default) = the terminal didn't answer. Set it before the app probes.
64
+ */
65
+ terminalVersion = undefined;
66
+ /** Answers synchronously with {@link terminalVersion} — no terminal round-trip to wait for. */
67
+ probeTerminalVersion(onResult) {
68
+ onResult(this.terminalVersion);
69
+ }
61
70
  cursorPosition = new Point(0, 0);
62
71
  renderFrame(grid, cursorPosition) {
63
72
  for (let y = 0; y < grid.height && y < this.size.height; y++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuidom/testing",
3
- "version": "0.2.3",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "description": "Experimental terminal UI DOM — test harness: TestApp, renderElement, expectScreen, mock terminal backend. API is unstable.",
6
6
  "license": "MIT",
@@ -28,7 +28,7 @@
28
28
  "./*": "./dist/*.js"
29
29
  },
30
30
  "dependencies": {
31
- "@tuidom/core": "0.2.3",
32
- "@tuidom/elements": "0.2.3"
31
+ "@tuidom/core": "0.4.0",
32
+ "@tuidom/elements": "0.4.0"
33
33
  }
34
34
  }