@springfield/ham-radio-api 18.2.0 → 18.3.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.
@@ -125,4 +125,23 @@ export interface RadioCatWriteStep {
125
125
  catWrite: RadioCatMemoryConfig;
126
126
  }
127
127
  export type RadioProtocolStep = RadioExchange | RadioReadStep | RadioWriteStep | RadioCatReadStep | RadioCatWriteStep;
128
+ /**
129
+ * Exchange-only protocol steps (`send`, `expect`, `setBaudRate`, `delay`, `timeout`).
130
+ * Used for {@link RadioOnError} cleanup lists, which must not include read, write, or CAT loop steps.
131
+ */
132
+ export type RadioProtocolExchangeStep = RadioExchange;
133
+ /**
134
+ * Optional cleanup exchanges keyed by memory operation. The driver runs the matching list
135
+ * best-effort after a protocol step fails or the user cancels; it is not run on success and is
136
+ * skipped when the serial port is already closed.
137
+ *
138
+ * @example Kenwood TH-D74 clone exit at the post-switch baud:
139
+ * ```json
140
+ * [{ "setBaudRate": 57600 }, { "send": ["E"] }]
141
+ * ```
142
+ */
143
+ export interface RadioOnError {
144
+ readMemory?: RadioProtocolExchangeStep[];
145
+ writeMemory?: RadioProtocolExchangeStep[];
146
+ }
128
147
  //# sourceMappingURL=protocol.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/radio/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,cAAc,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,cAAc,EAAE,GAAG,gBAAgB,GAA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AC/B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,oBAAoB,CAAC;CAChC;AAED,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,aAAa,GAAG,cAAc,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;AAEtH;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,aAAa,CAAC;AAEtD;;;;;;;;;GASG;AACH,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,yBAAyB,EAAE,CAAC;IACzC,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAC;CAC3C"}
@@ -1,7 +1,7 @@
1
1
  import type { RadioId } from "./id.js";
2
2
  import type { RadioMemoryConfig } from "./memory-config.js";
3
3
  import type { RadioMemoryMap } from "./memory-map.js";
4
- import type { RadioProtocolStep } from "./protocol.js";
4
+ import type { RadioOnError, RadioProtocolStep } from "./protocol.js";
5
5
  import type { RadioSchema } from "./schema.js";
6
6
  import type { RadioDialogMessage } from "./dialog-message.js";
7
7
  import type { RadioSerialConfig } from "./serial-config.js";
@@ -22,6 +22,15 @@ export interface Radio {
22
22
  serialConfig: RadioSerialConfig;
23
23
  readMemory: RadioProtocolStep[];
24
24
  writeMemory: RadioProtocolStep[];
25
+ /**
26
+ * Optional cleanup exchanges after a failed or cancelled read/write. Not run on success;
27
+ * skipped when the port is closed. Each list may only contain exchange steps (`send`,
28
+ * `expect`, `setBaudRate`, `delay`, `timeout`), not read/write/CAT loops.
29
+ *
30
+ * @example Kenwood TH-D74 clone exit at the post-switch baud:
31
+ * `[{ setBaudRate: 57600 }, { send: ['E'] }]`
32
+ */
33
+ onError?: RadioOnError;
25
34
  /**
26
35
  * Optional JSON memory-map for radio-wide settings decode/encode.
27
36
  * May be an inline map or a path/$ref resolved by the registry/module.
@@ -1 +1 @@
1
- {"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../src/radio/radio.ts"],"names":[],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AE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,OAAO,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC;;OAEG;IACH,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,cAAc,EAAE,WAAW,CAAC;IAC5B,YAAY,EAAE,iBAAiB,CAAC;IAChC,YAAY,EAAE,iBAAiB,CAAC;IAChC,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@springfield/ham-radio-api",
3
- "version": "18.2.0",
3
+ "version": "18.3.0",
4
4
  "author": "Bryan Hunt",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -39,12 +39,12 @@
39
39
  "@semantic-release/github": "12.0.10",
40
40
  "@semantic-release/npm": "13.2.0",
41
41
  "husky": "9.1.7",
42
- "oxfmt": "^0.71.0",
43
- "oxlint": "1.86.0",
42
+ "oxfmt": "^0.73.0",
43
+ "oxlint": "1.88.0",
44
44
  "semantic-release": "25.0.9",
45
45
  "typescript": "7.0.2",
46
- "vite": "^8.3.2",
47
- "vitest": "^5.0.3"
46
+ "vite": "^8.3.4",
47
+ "vitest": "^5.0.5"
48
48
  },
49
49
  "resolutions": {
50
50
  "conventional-changelog-conventionalcommits": "9.3.1"
@@ -137,3 +137,24 @@ export interface RadioCatWriteStep {
137
137
  }
138
138
 
139
139
  export type RadioProtocolStep = RadioExchange | RadioReadStep | RadioWriteStep | RadioCatReadStep | RadioCatWriteStep;
140
+
141
+ /**
142
+ * Exchange-only protocol steps (`send`, `expect`, `setBaudRate`, `delay`, `timeout`).
143
+ * Used for {@link RadioOnError} cleanup lists, which must not include read, write, or CAT loop steps.
144
+ */
145
+ export type RadioProtocolExchangeStep = RadioExchange;
146
+
147
+ /**
148
+ * Optional cleanup exchanges keyed by memory operation. The driver runs the matching list
149
+ * best-effort after a protocol step fails or the user cancels; it is not run on success and is
150
+ * skipped when the serial port is already closed.
151
+ *
152
+ * @example Kenwood TH-D74 clone exit at the post-switch baud:
153
+ * ```json
154
+ * [{ "setBaudRate": 57600 }, { "send": ["E"] }]
155
+ * ```
156
+ */
157
+ export interface RadioOnError {
158
+ readMemory?: RadioProtocolExchangeStep[];
159
+ writeMemory?: RadioProtocolExchangeStep[];
160
+ }
@@ -1,7 +1,7 @@
1
1
  import type { RadioId } from "./id.js";
2
2
  import type { RadioMemoryConfig } from "./memory-config.js";
3
3
  import type { RadioMemoryMap } from "./memory-map.js";
4
- import type { RadioProtocolStep } from "./protocol.js";
4
+ import type { RadioOnError, RadioProtocolStep } from "./protocol.js";
5
5
  import type { RadioSchema } from "./schema.js";
6
6
  import type { RadioDialogMessage } from "./dialog-message.js";
7
7
  import type { RadioSerialConfig } from "./serial-config.js";
@@ -23,6 +23,15 @@ export interface Radio {
23
23
  serialConfig: RadioSerialConfig;
24
24
  readMemory: RadioProtocolStep[];
25
25
  writeMemory: RadioProtocolStep[];
26
+ /**
27
+ * Optional cleanup exchanges after a failed or cancelled read/write. Not run on success;
28
+ * skipped when the port is closed. Each list may only contain exchange steps (`send`,
29
+ * `expect`, `setBaudRate`, `delay`, `timeout`), not read/write/CAT loops.
30
+ *
31
+ * @example Kenwood TH-D74 clone exit at the post-switch baud:
32
+ * `[{ setBaudRate: 57600 }, { send: ['E'] }]`
33
+ */
34
+ onError?: RadioOnError;
26
35
  /**
27
36
  * Optional JSON memory-map for radio-wide settings decode/encode.
28
37
  * May be an inline map or a path/$ref resolved by the registry/module.