@springfield/ham-radio-api 16.3.3 → 17.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 (83) hide show
  1. package/README.md +14 -2
  2. package/dist/branded-types/frequency.d.ts +2 -2
  3. package/dist/branded-types/frequency.js +1 -1
  4. package/dist/branded-types/license-class-id.d.ts +2 -2
  5. package/dist/branded-types/license-class-id.js +1 -1
  6. package/dist/branded-types/radio-channel-id.d.ts +2 -2
  7. package/dist/branded-types/radio-channel-id.js +1 -1
  8. package/dist/branded-types/radio-model-id.d.ts +2 -2
  9. package/dist/branded-types/radio-model-id.js +1 -1
  10. package/dist/branded-types/radio-module-id.d.ts +2 -2
  11. package/dist/branded-types/radio-module-id.js +1 -1
  12. package/dist/branded-types/spectrum-band-id.d.ts +2 -2
  13. package/dist/branded-types/spectrum-band-id.js +1 -1
  14. package/dist/branded-types/spectrum-mode-id.d.ts +2 -2
  15. package/dist/branded-types/spectrum-mode-id.js +1 -1
  16. package/dist/branded-types/spectrum-privilege-id.d.ts +2 -2
  17. package/dist/branded-types/spectrum-privilege-id.js +1 -1
  18. package/dist/branded-types/wavelength.d.ts +2 -2
  19. package/dist/branded-types/wavelength.js +1 -1
  20. package/dist/index.d.ts +38 -38
  21. package/dist/index.js +38 -38
  22. package/dist/license/class.d.ts +1 -1
  23. package/dist/radio/channel.d.ts +3 -3
  24. package/dist/radio/codec-factory.d.ts +3 -3
  25. package/dist/radio/codec.d.ts +2 -2
  26. package/dist/radio/connection.d.ts +1 -1
  27. package/dist/radio/driver-provider.d.ts +3 -3
  28. package/dist/radio/driver.d.ts +2 -2
  29. package/dist/radio/id.d.ts +1 -1
  30. package/dist/radio/memory-config.d.ts +2 -2
  31. package/dist/radio/memory-segment.d.ts +1 -0
  32. package/dist/radio/memory-segment.d.ts.map +1 -1
  33. package/dist/radio/memory.d.ts +1 -1
  34. package/dist/radio/module.d.ts +2 -2
  35. package/dist/radio/program.d.ts +2 -2
  36. package/dist/radio/programmed-channel.d.ts +2 -2
  37. package/dist/radio/protocol.d.ts +60 -71
  38. package/dist/radio/protocol.d.ts.map +1 -1
  39. package/dist/radio/radio.d.ts +5 -5
  40. package/dist/radio/schema.d.ts +1 -1
  41. package/dist/radio/serial-config.d.ts +1 -1
  42. package/dist/radio/shared-components.d.ts +1 -1
  43. package/dist/radio/tone.d.ts +2 -2
  44. package/dist/spectrum/band.d.ts +5 -5
  45. package/dist/spectrum/channel.d.ts +1 -1
  46. package/dist/spectrum/mode.d.ts +1 -1
  47. package/dist/spectrum/privilege.d.ts +5 -5
  48. package/package.json +38 -29
  49. package/src/branded-types/frequency.ts +2 -2
  50. package/src/branded-types/license-class-id.ts +2 -2
  51. package/src/branded-types/radio-channel-id.ts +2 -2
  52. package/src/branded-types/radio-model-id.ts +2 -2
  53. package/src/branded-types/radio-module-id.ts +2 -2
  54. package/src/branded-types/spectrum-band-id.ts +2 -2
  55. package/src/branded-types/spectrum-mode-id.ts +2 -2
  56. package/src/branded-types/spectrum-privilege-id.ts +2 -2
  57. package/src/branded-types/wavelength.ts +2 -2
  58. package/src/index.ts +38 -38
  59. package/src/license/class.ts +1 -1
  60. package/src/radio/channel.ts +3 -3
  61. package/src/radio/codec-factory.ts +3 -3
  62. package/src/radio/codec.ts +2 -2
  63. package/src/radio/connection.ts +1 -1
  64. package/src/radio/driver-provider.ts +3 -3
  65. package/src/radio/driver.ts +2 -2
  66. package/src/radio/id.ts +1 -1
  67. package/src/radio/memory-config.ts +2 -2
  68. package/src/radio/memory-segment.ts +1 -0
  69. package/src/radio/memory.ts +1 -1
  70. package/src/radio/module.ts +2 -2
  71. package/src/radio/program.ts +2 -2
  72. package/src/radio/programmed-channel.ts +2 -2
  73. package/src/radio/protocol.ts +62 -70
  74. package/src/radio/radio.ts +5 -5
  75. package/src/radio/schema.ts +1 -1
  76. package/src/radio/serial-config.ts +1 -1
  77. package/src/radio/shared-components.ts +1 -1
  78. package/src/radio/tone.ts +2 -2
  79. package/src/spectrum/band.ts +5 -5
  80. package/src/spectrum/channel.ts +1 -1
  81. package/src/spectrum/mode.ts +1 -1
  82. package/src/spectrum/privilege.ts +5 -5
  83. package/CHANGELOG.md +0 -279
@@ -1,79 +1,68 @@
1
- export interface RadioExactReceivePattern {
2
- type: 'exact';
3
- value: number;
4
- length: number;
1
+ /**
2
+ * A byte in a send or expect array.
3
+ *
4
+ * - number 0–255: literal byte
5
+ * - hex string such as `"0x50"`: literal byte
6
+ * - single-character string such as `"S"`: ASCII opcode
7
+ * - placeholder: `"$address"`, `"$chunkSize"`, `"$length"`, `"$data"`
8
+ */
9
+ export type RadioByteToken = number | string;
10
+ /**
11
+ * Receive any content of a fixed length, such as a radio identifier.
12
+ */
13
+ export interface RadioExpectBytes {
14
+ bytes: number;
5
15
  }
6
- export interface RadioVariableReceivePattern {
7
- type: 'variable';
8
- length: number;
9
- }
10
- export interface RadioPatternReceivePattern {
11
- type: 'pattern';
12
- pattern: (string | number | {
13
- field: string;
14
- size: number;
15
- })[];
16
- dataLength?: number | string;
17
- }
18
- export interface RadioAnyReceivePattern {
19
- type: 'any';
20
- length: number;
21
- }
22
- export type RadioReceivePattern = RadioExactReceivePattern | RadioVariableReceivePattern | RadioPatternReceivePattern | RadioAnyReceivePattern;
23
- export interface RadioSendReceiveStep {
24
- sendReceive: {
25
- send: (string | number)[];
26
- receive: RadioReceivePattern;
27
- timeout?: number;
28
- description?: string;
29
- };
30
- }
31
- export interface RadioSendStep {
32
- send: {
33
- data: (string | number)[];
34
- description?: string;
35
- };
36
- }
37
- export interface RadioReceiveStep {
38
- receive: {
39
- type: 'exact' | 'variable' | 'pattern' | 'any';
40
- value?: number;
41
- length: number;
42
- pattern?: (string | number | {
43
- field: string;
44
- size: number;
45
- })[];
46
- description?: string;
47
- };
48
- }
49
- export interface RadioReadSegmentStep {
50
- readSegment: {
16
+ /**
17
+ * Expected serial reply for an exchange.
18
+ *
19
+ * - token: exact 1-byte match (ACK)
20
+ * - token array: exact multi-byte match, or a framed reply with `$` placeholders
21
+ * - `{ bytes: N }`: any N bytes
22
+ */
23
+ export type RadioExpect = RadioByteToken | RadioByteToken[] | RadioExpectBytes;
24
+ /**
25
+ * One serial exchange: send bytes and/or wait for a reply.
26
+ * At least one of `send` or `expect` must be present.
27
+ */
28
+ export type RadioExchange = {
29
+ description?: string;
30
+ send: RadioByteToken[];
31
+ expect?: RadioExpect;
32
+ timeout?: number;
33
+ } | {
34
+ description?: string;
35
+ send?: RadioByteToken[];
36
+ expect: RadioExpect;
37
+ timeout?: number;
38
+ };
39
+ /**
40
+ * Chunked memory read: repeat an exchange across named segments.
41
+ * `$data` in `expect` is captured into the memory buffer.
42
+ * Optional `ack` is a second exchange after each chunk (for example an ACK).
43
+ */
44
+ export interface RadioReadStep {
45
+ description?: string;
46
+ read: {
51
47
  segments: string[];
52
- startChunk: {
53
- send: (string | number)[];
54
- receive: RadioReceivePattern;
55
- };
56
- endChunk: {
57
- send: (string | number)[];
58
- receive: RadioReceivePattern;
59
- };
60
- description?: string;
48
+ send: RadioByteToken[];
49
+ expect: RadioExpect;
50
+ ack?: RadioExchange;
51
+ timeout?: number;
61
52
  };
62
53
  }
63
- export interface RadioWriteSegmentStep {
64
- writeSegment: {
54
+ /**
55
+ * Chunked memory write: repeat an exchange across named segments.
56
+ * `$data` in `send` emits the current chunk from the memory buffer.
57
+ */
58
+ export interface RadioWriteStep {
59
+ description?: string;
60
+ write: {
65
61
  segments: string[];
66
- send: (string | number)[];
67
- data: string;
68
- receive: RadioReceivePattern;
69
- description?: string;
70
- };
71
- }
72
- export interface RadioSetVariableStep {
73
- setVariable: {
74
- name: string;
75
- value: string | number;
62
+ send: RadioByteToken[];
63
+ expect: RadioExpect;
64
+ timeout?: number;
76
65
  };
77
66
  }
78
- export type RadioProtocolStep = RadioSendReceiveStep | RadioSendStep | RadioReceiveStep | RadioReadSegmentStep | RadioWriteSegmentStep | RadioSetVariableStep;
67
+ export type RadioProtocolStep = RadioExchange | RadioReadStep | RadioWriteStep;
79
68
  //# sourceMappingURL=protocol.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/radio/protocol.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IAC/D,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,KAAK,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,mBAAmB,GAAG,wBAAwB,GAAG,2BAA2B,GAAG,0BAA0B,GAAG,sBAAsB,CAAC;AAE/I,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE;QACX,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;QAC1B,OAAO,EAAE,mBAAmB,CAAC;QAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;QAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE;QACP,IAAI,EAAE,OAAO,GAAG,UAA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- import type { RadioId } from './id.js';
2
- import type { RadioMemoryConfig } from './memory-config.js';
3
- import type { RadioProtocolStep } from './protocol.js';
4
- import type { RadioSchema } from './schema.js';
5
- import type { RadioSerialConfig } from './serial-config.js';
1
+ import type { RadioId } from "./id.js";
2
+ import type { RadioMemoryConfig } from "./memory-config.js";
3
+ import type { RadioProtocolStep } from "./protocol.js";
4
+ import type { RadioSchema } from "./schema.js";
5
+ import type { RadioSerialConfig } from "./serial-config.js";
6
6
  export interface Radio {
7
7
  id: RadioId;
8
8
  version: string;
@@ -1,4 +1,4 @@
1
- import type { RadioModelId } from '../branded-types/radio-model-id.js';
1
+ import type { RadioModelId } from "../branded-types/radio-model-id.js";
2
2
  export interface RadioSchema {
3
3
  model: RadioModelId;
4
4
  settingsSchema: unknown;
@@ -2,6 +2,6 @@ export interface RadioSerialConfig {
2
2
  baudRate: number;
3
3
  dataBits?: 8 | 5 | 6 | 7;
4
4
  stopBits?: 1 | 1.5 | 2;
5
- parity?: 'none' | 'even' | 'odd';
5
+ parity?: "none" | "even" | "odd";
6
6
  }
7
7
  //# sourceMappingURL=serial-config.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { RadioCodec } from './codec.js';
1
+ import type { RadioCodec } from "./codec.js";
2
2
  /**
3
3
  * Interface for managing shared components across radio models
4
4
  *
@@ -1,5 +1,5 @@
1
- import type { CTCSS } from './ctcss.js';
2
- import type { DCS } from './dcs.js';
1
+ import type { CTCSS } from "./ctcss.js";
2
+ import type { DCS } from "./dcs.js";
3
3
  export declare enum RadioToneType {
4
4
  CTCSS = 0,
5
5
  DCS = 1
@@ -1,8 +1,8 @@
1
- import type { Frequency } from '../branded-types/frequency.js';
2
- import type { LicenseClassId } from '../branded-types/license-class-id.js';
3
- import type { SpectrumBandId } from '../branded-types/spectrum-band-id.js';
4
- import type { SpectrumChannel } from './channel.js';
5
- import type { Wavelength } from '../branded-types/wavelength.js';
1
+ import type { Frequency } from "../branded-types/frequency.js";
2
+ import type { LicenseClassId } from "../branded-types/license-class-id.js";
3
+ import type { SpectrumBandId } from "../branded-types/spectrum-band-id.js";
4
+ import type { SpectrumChannel } from "./channel.js";
5
+ import type { Wavelength } from "../branded-types/wavelength.js";
6
6
  export interface SpectrumBand {
7
7
  id: SpectrumBandId;
8
8
  name: string;
@@ -1,4 +1,4 @@
1
- import type { Frequency } from '../branded-types/frequency.js';
1
+ import type { Frequency } from "../branded-types/frequency.js";
2
2
  export interface SpectrumChannel {
3
3
  name: string;
4
4
  frequency: Frequency;
@@ -1,4 +1,4 @@
1
- import type { SpectrumModeId } from '../branded-types/spectrum-mode-id.js';
1
+ import type { SpectrumModeId } from "../branded-types/spectrum-mode-id.js";
2
2
  export interface SpectrumMode {
3
3
  id: SpectrumModeId;
4
4
  name: string;
@@ -1,8 +1,8 @@
1
- import type { Frequency } from '../branded-types/frequency.js';
2
- import type { LicenseClassId } from '../branded-types/license-class-id.js';
3
- import type { SpectrumBandId } from '../branded-types/spectrum-band-id.js';
4
- import type { SpectrumModeId } from '../branded-types/spectrum-mode-id.js';
5
- import type { SpectrumPrivilegeId } from '../branded-types/spectrum-privilege-id.js';
1
+ import type { Frequency } from "../branded-types/frequency.js";
2
+ import type { LicenseClassId } from "../branded-types/license-class-id.js";
3
+ import type { SpectrumBandId } from "../branded-types/spectrum-band-id.js";
4
+ import type { SpectrumModeId } from "../branded-types/spectrum-mode-id.js";
5
+ import type { SpectrumPrivilegeId } from "../branded-types/spectrum-privilege-id.js";
6
6
  export interface SpectrumPrivilege {
7
7
  id: SpectrumPrivilegeId;
8
8
  licenseClassId: LicenseClassId;
package/package.json CHANGED
@@ -1,23 +1,50 @@
1
1
  {
2
2
  "name": "@springfield/ham-radio-api",
3
- "version": "16.3.3",
3
+ "version": "17.0.0",
4
4
  "author": "Bryan Hunt",
5
- "packageManager": "yarn@4.12.0",
6
- "main": "dist/index.js",
7
- "type": "module",
8
- "types": "dist/index.d.ts",
9
5
  "files": [
10
- "src/",
11
- "dist/"
6
+ "dist/",
7
+ "src/"
12
8
  ],
9
+ "type": "module",
10
+ "main": "dist/index.js",
11
+ "types": "dist/index.d.ts",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/springfield-ham-radio/ham-radio-api.git"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
13
19
  "scripts": {
14
20
  "build": "tsc",
15
21
  "commitlint": "commitlint --edit",
22
+ "format": "oxfmt",
16
23
  "lint": "oxlint",
17
24
  "lint:fix": "oxlint --fix --fix-suggestions",
18
25
  "release": "semantic-release",
19
26
  "prepare": "husky"
20
27
  },
28
+ "dependencies": {
29
+ "loglayer": "^8.5.0",
30
+ "ts-brand": "^0.2.0"
31
+ },
32
+ "devDependencies": {
33
+ "@commitlint/cli": "21.2.2",
34
+ "@commitlint/config-conventional": "21.2.2",
35
+ "@semantic-release/changelog": "7.0.0",
36
+ "@semantic-release/git": "11.0.1",
37
+ "@semantic-release/github": "12.0.2",
38
+ "@semantic-release/npm": "13.1.5",
39
+ "husky": "9.1.7",
40
+ "oxfmt": "^0.64.0",
41
+ "oxlint": "1.79.0",
42
+ "semantic-release": "25.0.9",
43
+ "typescript": "7.0.2"
44
+ },
45
+ "resolutions": {
46
+ "conventional-changelog-conventionalcommits": "9.3.1"
47
+ },
21
48
  "release": {
22
49
  "branches": [
23
50
  "main",
@@ -40,28 +67,10 @@
40
67
  }
41
68
  ],
42
69
  "@semantic-release/changelog",
43
- "semantic-release-yarn",
44
- "@semantic-release/gitlab",
70
+ "@semantic-release/npm",
71
+ "@semantic-release/github",
45
72
  "@semantic-release/git"
46
73
  ]
47
74
  },
48
- "publishConfig": {
49
- "access": "public"
50
- },
51
- "devDependencies": {
52
- "@commitlint/cli": "20.2.0",
53
- "@commitlint/config-conventional": "20.2.0",
54
- "@semantic-release/changelog": "6.0.3",
55
- "@semantic-release/git": "10.0.1",
56
- "@semantic-release/gitlab": "13.2.9",
57
- "husky": "9.1.7",
58
- "oxlint": "1.33.0",
59
- "semantic-release": "25.0.2",
60
- "semantic-release-yarn": "3.0.2",
61
- "typescript": "5.9.3"
62
- },
63
- "dependencies": {
64
- "loglayer": "^8.2.0",
65
- "ts-brand": "^0.2.0"
66
- }
67
- }
75
+ "packageManager": "yarn@4.18.0"
76
+ }
@@ -1,4 +1,4 @@
1
- import { type Brand, make } from 'ts-brand';
1
+ import { type Brand, make } from "ts-brand";
2
2
 
3
- export type Frequency = Brand<number, 'frequency'>;
3
+ export type Frequency = Brand<number, "frequency">;
4
4
  export const Frequency = make<Frequency>();
@@ -1,4 +1,4 @@
1
- import { type Brand, make } from 'ts-brand';
1
+ import { type Brand, make } from "ts-brand";
2
2
 
3
- export type LicenseClassId = Brand<string, 'license-class-id'>;
3
+ export type LicenseClassId = Brand<string, "license-class-id">;
4
4
  export const LicenseClassId = make<LicenseClassId>();
@@ -1,4 +1,4 @@
1
- import { type Brand, make } from 'ts-brand';
1
+ import { type Brand, make } from "ts-brand";
2
2
 
3
- export type RadioChannelId = Brand<string, 'radio-channel-id'>;
3
+ export type RadioChannelId = Brand<string, "radio-channel-id">;
4
4
  export const RadioChannelId = make<RadioChannelId>();
@@ -1,4 +1,4 @@
1
- import { type Brand, make } from 'ts-brand';
1
+ import { type Brand, make } from "ts-brand";
2
2
 
3
- export type RadioModelId = Brand<string, 'radio-model-id'>;
3
+ export type RadioModelId = Brand<string, "radio-model-id">;
4
4
  export const RadioModelId = make<RadioModelId>();
@@ -1,4 +1,4 @@
1
- import { type Brand, make } from 'ts-brand';
1
+ import { type Brand, make } from "ts-brand";
2
2
 
3
- export type RadioModuleId = Brand<string, 'radio-module-id'>;
3
+ export type RadioModuleId = Brand<string, "radio-module-id">;
4
4
  export const RadioModuleId = make<RadioModuleId>();
@@ -1,4 +1,4 @@
1
- import { type Brand, make } from 'ts-brand';
1
+ import { type Brand, make } from "ts-brand";
2
2
 
3
- export type SpectrumBandId = Brand<string, 'spectrum-band-id'>;
3
+ export type SpectrumBandId = Brand<string, "spectrum-band-id">;
4
4
  export const SpectrumBandId = make<SpectrumBandId>();
@@ -1,4 +1,4 @@
1
- import { type Brand, make } from 'ts-brand';
1
+ import { type Brand, make } from "ts-brand";
2
2
 
3
- export type SpectrumModeId = Brand<string, 'spectrum-mode-id'>;
3
+ export type SpectrumModeId = Brand<string, "spectrum-mode-id">;
4
4
  export const SpectrumModeId = make<SpectrumModeId>();
@@ -1,4 +1,4 @@
1
- import { type Brand, make } from 'ts-brand';
1
+ import { type Brand, make } from "ts-brand";
2
2
 
3
- export type SpectrumPrivilegeId = Brand<string, 'spectrum-privilege-id'>;
3
+ export type SpectrumPrivilegeId = Brand<string, "spectrum-privilege-id">;
4
4
  export const SpectrumPrivilegeId = make<SpectrumPrivilegeId>();
@@ -1,4 +1,4 @@
1
- import { type Brand, make } from 'ts-brand';
1
+ import { type Brand, make } from "ts-brand";
2
2
 
3
- export type Wavelength = Brand<number, 'wavelength'>;
3
+ export type Wavelength = Brand<number, "wavelength">;
4
4
  export const Wavelength = make<Wavelength>();
package/src/index.ts CHANGED
@@ -1,41 +1,41 @@
1
- export * from './branded-types/frequency.js';
2
- export * from './branded-types/license-class-id.js';
3
- export * from './branded-types/radio-channel-id.js';
4
- export * from './branded-types/radio-model-id.js';
5
- export * from './branded-types/radio-module-id.js';
6
- export * from './branded-types/spectrum-band-id.js';
7
- export * from './branded-types/spectrum-mode-id.js';
8
- export * from './branded-types/spectrum-privilege-id.js';
9
- export * from './branded-types/wavelength.js';
1
+ export * from "./branded-types/frequency.js";
2
+ export * from "./branded-types/license-class-id.js";
3
+ export * from "./branded-types/radio-channel-id.js";
4
+ export * from "./branded-types/radio-model-id.js";
5
+ export * from "./branded-types/radio-module-id.js";
6
+ export * from "./branded-types/spectrum-band-id.js";
7
+ export * from "./branded-types/spectrum-mode-id.js";
8
+ export * from "./branded-types/spectrum-privilege-id.js";
9
+ export * from "./branded-types/wavelength.js";
10
10
 
11
- export * from './license/class.js';
11
+ export * from "./license/class.js";
12
12
 
13
- export * from './radio/channel.js';
14
- export * from './radio/codec.js';
15
- export * from './radio/codec-factory.js';
16
- export * from './radio/connection.js';
17
- export * from './radio/ctcss.js';
18
- export * from './radio/dcs.js';
19
- export * from './radio/driver.js';
20
- export * from './radio/driver-provider.js';
21
- export * from './radio/id.js';
22
- export * from './radio/memory-config.js';
23
- export * from './radio/memory-segment.js';
24
- export * from './radio/memory.js';
25
- export * from './radio/module.js';
26
- export * from './radio/program.js';
27
- export * from './radio/programmed-channel.js';
28
- export * from './radio/progress-indicator.js';
29
- export * from './radio/protocol.js';
30
- export * from './radio/radio.js';
31
- export * from './radio/schema.js';
32
- export * from './radio/serial-config.js';
33
- export * from './radio/shared-components.js';
34
- export * from './radio/settings.js';
35
- export * from './radio/tone.js';
36
- export * from './radio/validation.js';
13
+ export * from "./radio/channel.js";
14
+ export * from "./radio/codec.js";
15
+ export * from "./radio/codec-factory.js";
16
+ export * from "./radio/connection.js";
17
+ export * from "./radio/ctcss.js";
18
+ export * from "./radio/dcs.js";
19
+ export * from "./radio/driver.js";
20
+ export * from "./radio/driver-provider.js";
21
+ export * from "./radio/id.js";
22
+ export * from "./radio/memory-config.js";
23
+ export * from "./radio/memory-segment.js";
24
+ export * from "./radio/memory.js";
25
+ export * from "./radio/module.js";
26
+ export * from "./radio/program.js";
27
+ export * from "./radio/programmed-channel.js";
28
+ export * from "./radio/progress-indicator.js";
29
+ export * from "./radio/protocol.js";
30
+ export * from "./radio/radio.js";
31
+ export * from "./radio/schema.js";
32
+ export * from "./radio/serial-config.js";
33
+ export * from "./radio/shared-components.js";
34
+ export * from "./radio/settings.js";
35
+ export * from "./radio/tone.js";
36
+ export * from "./radio/validation.js";
37
37
 
38
- export * from './spectrum/band.js';
39
- export * from './spectrum/channel.js';
40
- export * from './spectrum/mode.js';
41
- export * from './spectrum/privilege.js';
38
+ export * from "./spectrum/band.js";
39
+ export * from "./spectrum/channel.js";
40
+ export * from "./spectrum/mode.js";
41
+ export * from "./spectrum/privilege.js";
@@ -1,4 +1,4 @@
1
- import type { LicenseClassId } from '../branded-types/license-class-id.js';
1
+ import type { LicenseClassId } from "../branded-types/license-class-id.js";
2
2
 
3
3
  export interface LicenseClass {
4
4
  id: LicenseClassId;
@@ -1,6 +1,6 @@
1
- import type { Frequency } from '../branded-types/frequency.js';
2
- import type { RadioChannelId } from '../branded-types/radio-channel-id.js';
3
- import type { RadioTone } from './tone.js';
1
+ import type { Frequency } from "../branded-types/frequency.js";
2
+ import type { RadioChannelId } from "../branded-types/radio-channel-id.js";
3
+ import type { RadioTone } from "./tone.js";
4
4
 
5
5
  export interface RadioChannel {
6
6
  id?: RadioChannelId;
@@ -1,7 +1,7 @@
1
1
  // oxlint-disable consistent-indexed-object-style
2
- import type { ILogLayer } from 'loglayer';
3
- import type { RadioCodec } from './codec.js';
4
- import type { RadioModelId } from '../branded-types/radio-model-id.js';
2
+ import type { ILogLayer } from "loglayer";
3
+ import type { RadioCodec } from "./codec.js";
4
+ import type { RadioModelId } from "../branded-types/radio-model-id.js";
5
5
 
6
6
  /**
7
7
  * Factory interface for creating radio codecs
@@ -1,5 +1,5 @@
1
- import type { RadioMemory } from './memory.js';
2
- import type { RadioProgram } from './program.js';
1
+ import type { RadioMemory } from "./memory.js";
2
+ import type { RadioProgram } from "./program.js";
3
3
 
4
4
  export interface RadioCodec {
5
5
  decode(memory: RadioMemory): RadioProgram;
@@ -1,4 +1,4 @@
1
- import type { RadioId } from './id.js';
1
+ import type { RadioId } from "./id.js";
2
2
 
3
3
  export interface RadioConnection {
4
4
  serialPortPath: string;
@@ -1,6 +1,6 @@
1
- import type { RadioDriver } from './driver.js';
2
- import type { RadioModelId } from '../branded-types/radio-model-id.js';
3
- import type { RadioModuleId } from '../branded-types/radio-module-id.js';
1
+ import type { RadioDriver } from "./driver.js";
2
+ import type { RadioModelId } from "../branded-types/radio-model-id.js";
3
+ import type { RadioModuleId } from "../branded-types/radio-module-id.js";
4
4
 
5
5
  export interface RadioDriverProvider {
6
6
  getId(): RadioModuleId;
@@ -1,5 +1,5 @@
1
- import type { RadioMemory } from './memory.js';
2
- import type { RadioProgressIndicator } from './progress-indicator.js';
1
+ import type { RadioMemory } from "./memory.js";
2
+ import type { RadioProgressIndicator } from "./progress-indicator.js";
3
3
 
4
4
  export interface RadioDriver {
5
5
  readRadio(serialPortPath: string, progressIndicator: RadioProgressIndicator): Promise<RadioMemory>;
package/src/radio/id.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { RadioModelId } from '../branded-types/radio-model-id.js';
1
+ import type { RadioModelId } from "../branded-types/radio-model-id.js";
2
2
 
3
3
  /**
4
4
  * A unique identifier for a radio.
@@ -1,9 +1,9 @@
1
- import type { RadioMemorySegment } from './memory-segment.js';
1
+ import type { RadioMemorySegment } from "./memory-segment.js";
2
2
 
3
3
  export interface RadioMemoryConfig {
4
4
  chunkSize: number;
5
5
  addressSize: number;
6
- addressEndianness: 'big' | 'little';
6
+ addressEndianness: "big" | "little";
7
7
  segments: {
8
8
  [segmentName: string]: RadioMemorySegment;
9
9
  };
@@ -1,4 +1,5 @@
1
1
  export interface RadioMemorySegment {
2
+ /** Inclusive end of the segment (a range 0–6143 is 6144 bytes). */
2
3
  endAddress: number;
3
4
  startAddress: number;
4
5
  }
@@ -1,4 +1,4 @@
1
- import type { RadioModelId } from '../branded-types/radio-model-id.js';
1
+ import type { RadioModelId } from "../branded-types/radio-model-id.js";
2
2
 
3
3
  export interface RadioMemory {
4
4
  radioModel: RadioModelId;
@@ -1,5 +1,5 @@
1
- import type { Radio } from './radio.js';
2
- import type { RadioModuleId } from '../branded-types/radio-module-id.js';
1
+ import type { Radio } from "./radio.js";
2
+ import type { RadioModuleId } from "../branded-types/radio-module-id.js";
3
3
 
4
4
  export interface RadioModule {
5
5
  getId(): RadioModuleId;
@@ -1,5 +1,5 @@
1
- import type { RadioProgrammedChannel } from './programmed-channel.js';
2
- import type { RadioSettings } from './settings.js';
1
+ import type { RadioProgrammedChannel } from "./programmed-channel.js";
2
+ import type { RadioSettings } from "./settings.js";
3
3
 
4
4
  export interface RadioProgram {
5
5
  settings: RadioSettings;
@@ -1,5 +1,5 @@
1
- import type { RadioChannel } from './channel.js';
2
- import type { RadioSettings } from './settings.js';
1
+ import type { RadioChannel } from "./channel.js";
2
+ import type { RadioSettings } from "./settings.js";
3
3
 
4
4
  export interface RadioProgrammedChannel {
5
5
  channelNumber: number;