@springfield/ham-radio-api 15.0.0 → 16.1.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## [16.1.0](https://gitlab.com/springfield-ham-radio/app/ham-radio-api/compare/v16.0.0...v16.1.0) (2025-06-23)
2
+
3
+
4
+ ### Features
5
+
6
+ * add loglayer dependency and enhance radio module exports ([a8e5363](https://gitlab.com/springfield-ham-radio/app/ham-radio-api/commit/a8e5363f6ac40a0c2cb9fb4495d241776400cef9))
7
+
8
+ ## [16.0.0](https://gitlab.com/springfield-ham-radio/app/ham-radio-api/compare/v15.0.0...v16.0.0) (2025-06-23)
9
+
10
+
11
+ ### ⚠ BREAKING CHANGES
12
+
13
+ * enhance RadioReceiveStep and Radio interface
14
+
15
+ ### Features
16
+
17
+ * enhance RadioReceiveStep and Radio interface ([1bb62f2](https://gitlab.com/springfield-ham-radio/app/ham-radio-api/commit/1bb62f2ec7cffc7cc64c27fe1884c0027a0bf9c0))
18
+
1
19
  ## [15.0.0](https://gitlab.com/springfield-ham-radio/app/ham-radio-api/compare/v14.0.0...v15.0.0) (2025-06-20)
2
20
 
3
21
 
package/dist/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export * from './branded-types/wavelength.js';
10
10
  export * from './license/class.js';
11
11
  export * from './radio/channel.js';
12
12
  export * from './radio/codec.js';
13
+ export * from './radio/codec-factory.js';
13
14
  export * from './radio/connection.js';
14
15
  export * from './radio/ctcss.js';
15
16
  export * from './radio/dcs.js';
@@ -27,8 +28,10 @@ export * from './radio/protocol.js';
27
28
  export * from './radio/radio.js';
28
29
  export * from './radio/schema.js';
29
30
  export * from './radio/serial-config.js';
31
+ export * from './radio/shared-components.js';
30
32
  export * from './radio/settings.js';
31
33
  export * from './radio/tone.js';
34
+ export * from './radio/validation.js';
32
35
  export * from './spectrum/band.js';
33
36
  export * from './spectrum/channel.js';
34
37
  export * from './spectrum/mode.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,0CAA0C,CAAC;AACzD,cAAc,+BAA+B,CAAC;AAE9C,cAAc,oBAAoB,CAAC;AAEnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,0CAA0C,CAAC;AACzD,cAAc,+BAA+B,CAAC;AAE9C,cAAc,oBAAoB,CAAC;AAEnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC"}
package/dist/index.js CHANGED
@@ -10,6 +10,7 @@ export * from './branded-types/wavelength.js';
10
10
  export * from './license/class.js';
11
11
  export * from './radio/channel.js';
12
12
  export * from './radio/codec.js';
13
+ export * from './radio/codec-factory.js';
13
14
  export * from './radio/connection.js';
14
15
  export * from './radio/ctcss.js';
15
16
  export * from './radio/dcs.js';
@@ -27,8 +28,10 @@ export * from './radio/protocol.js';
27
28
  export * from './radio/radio.js';
28
29
  export * from './radio/schema.js';
29
30
  export * from './radio/serial-config.js';
31
+ export * from './radio/shared-components.js';
30
32
  export * from './radio/settings.js';
31
33
  export * from './radio/tone.js';
34
+ export * from './radio/validation.js';
32
35
  export * from './spectrum/band.js';
33
36
  export * from './spectrum/channel.js';
34
37
  export * from './spectrum/mode.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,0CAA0C,CAAC;AACzD,cAAc,+BAA+B,CAAC;AAE9C,cAAc,oBAAoB,CAAC;AAEnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,0CAA0C,CAAC;AACzD,cAAc,+BAA+B,CAAC;AAE9C,cAAc,oBAAoB,CAAC;AAEnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { ILogLayer } from 'loglayer';
2
+ import type { RadioCodec } from './codec.js';
3
+ import type { RadioModelId } from '../branded-types/radio-model-id.js';
4
+ /**
5
+ * Factory interface for creating radio codecs
6
+ *
7
+ * This interface provides a standardized way for radio modules to create
8
+ * codec instances that can encode/decode radio memory data.
9
+ */
10
+ export interface CodecFactory {
11
+ /**
12
+ * Creates a codec instance for a specific radio model
13
+ *
14
+ * @param modelId - The radio model identifier
15
+ * @param config - Configuration object for the codec
16
+ * @param logger - Logger instance for the codec
17
+ * @returns Promise that resolves to a RadioCodec instance
18
+ */
19
+ createCodec(modelId: RadioModelId, config: Record<string, unknown>, logger: ILogLayer): Promise<RadioCodec>;
20
+ }
21
+ //# sourceMappingURL=codec-factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-factory.d.ts","sourceRoot":"","sources":["../../src/radio/codec-factory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAEvE;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;;OAOG;IACH,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CAC7G"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=codec-factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-factory.js","sourceRoot":"","sources":["../../src/radio/codec-factory.ts"],"names":[],"mappings":""}
@@ -36,8 +36,13 @@ export interface RadioSendStep {
36
36
  }
37
37
  export interface RadioReceiveStep {
38
38
  receive: {
39
- type: string;
39
+ type: 'exact' | 'variable' | 'pattern' | 'any';
40
+ value?: number;
40
41
  length: number;
42
+ pattern?: (string | number | {
43
+ field: string;
44
+ size: number;
45
+ })[];
41
46
  description?: string;
42
47
  };
43
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/radio/protocol.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wB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C9B,CAAC;QACF,QAAQ,EAAE;YACR,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;YAC1B,OAAO,EAAE,mBAAmB,CAAC;SAC9B,CAAC;QACF,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAED,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE;QACZ,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;QAC1B,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,mBAAmB,CAAC;QAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;KACxB,CAAC;CACH;AAED,MAAM,MAAM,iBAAiB,GAAG,oBAAoB,GAAG,aAAa,GAAG,gBAAgB,GAAG,oBAAoB,GAAG,qBAAqB,GAAG,oBAAoB,CAAC"}
@@ -5,6 +5,8 @@ import type { RadioSchema } from './schema.js';
5
5
  import type { RadioSerialConfig } from './serial-config.js';
6
6
  export interface Radio {
7
7
  id: RadioId;
8
+ version: string;
9
+ description: string;
8
10
  settingsSchema: RadioSchema;
9
11
  memoryConfig: RadioMemoryConfig;
10
12
  serialConfig: RadioSerialConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../src/radio/radio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,OAAO,CAAC;IACZ,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;CAClC"}
1
+ {"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../src/radio/radio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,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,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;CAClC"}
@@ -0,0 +1,40 @@
1
+ import type { RadioCodec } from './codec.js';
2
+ /**
3
+ * Interface for managing shared components across radio models
4
+ *
5
+ * This interface provides a standardized way for radio modules to share
6
+ * common components like schemas, protocols, and codecs.
7
+ */
8
+ export interface SharedComponentManager {
9
+ /**
10
+ * Load a shared schema from a file path
11
+ *
12
+ * @param schemaPath - Path to the schema file
13
+ * @returns Promise that resolves to the schema object
14
+ */
15
+ loadSchema(schemaPath: string): Promise<Record<string, unknown>>;
16
+ /**
17
+ * Load a shared protocol from a file path
18
+ *
19
+ * @param protocolPath - Path to the protocol file
20
+ * @returns Promise that resolves to the protocol object
21
+ */
22
+ loadProtocol(protocolPath: string): Promise<Record<string, unknown>>;
23
+ /**
24
+ * Load a shared codec from a file path
25
+ *
26
+ * @param codecPath - Path to the codec module
27
+ * @param config - Configuration for the codec
28
+ * @returns Promise that resolves to a RadioCodec instance
29
+ */
30
+ loadCodec(codecPath: string, config: Record<string, unknown>): Promise<RadioCodec>;
31
+ /**
32
+ * Resolve a component reference relative to a base path
33
+ *
34
+ * @param reference - The reference to resolve
35
+ * @param basePath - The base path for resolution
36
+ * @returns The resolved absolute path
37
+ */
38
+ resolveReference(reference: string, basePath: string): string;
39
+ }
40
+ //# sourceMappingURL=shared-components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared-components.d.ts","sourceRoot":"","sources":["../../src/radio/shared-components.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAEjE;;;;;OAKG;IACH,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAErE;;;;;;OAMG;IACH,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAEnF;;;;;;OAMG;IACH,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;CAC/D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=shared-components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared-components.js","sourceRoot":"","sources":["../../src/radio/shared-components.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Result of a validation operation
3
+ *
4
+ * This interface provides a standardized way to return validation results
5
+ * across different parts of the radio system.
6
+ */
7
+ export interface ValidationResult {
8
+ /**
9
+ * Whether the validation passed
10
+ */
11
+ isValid: boolean;
12
+ /**
13
+ * List of validation errors
14
+ */
15
+ errors: string[];
16
+ /**
17
+ * List of validation warnings
18
+ */
19
+ warnings: string[];
20
+ }
21
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/radio/validation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/radio/validation.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@springfield/ham-radio-api",
3
- "version": "15.0.0",
3
+ "version": "16.1.0",
4
4
  "author": "Bryan Hunt",
5
5
  "packageManager": "yarn@4.9.2",
6
6
  "main": "dist/index.js",
@@ -55,12 +55,13 @@
55
55
  "@semantic-release/git": "10.0.1",
56
56
  "@semantic-release/gitlab": "13.2.6",
57
57
  "husky": "9.1.7",
58
- "oxlint": "^1.2.0",
58
+ "oxlint": "1.2.0",
59
59
  "semantic-release": "23.1.1",
60
60
  "semantic-release-yarn": "3.0.2",
61
61
  "typescript": "5.8.3"
62
62
  },
63
63
  "dependencies": {
64
+ "loglayer": "^6.4.3",
64
65
  "ts-brand": "^0.2.0"
65
66
  }
66
67
  }
package/src/index.ts CHANGED
@@ -12,6 +12,7 @@ export * from './license/class.js';
12
12
 
13
13
  export * from './radio/channel.js';
14
14
  export * from './radio/codec.js';
15
+ export * from './radio/codec-factory.js';
15
16
  export * from './radio/connection.js';
16
17
  export * from './radio/ctcss.js';
17
18
  export * from './radio/dcs.js';
@@ -29,8 +30,10 @@ export * from './radio/protocol.js';
29
30
  export * from './radio/radio.js';
30
31
  export * from './radio/schema.js';
31
32
  export * from './radio/serial-config.js';
33
+ export * from './radio/shared-components.js';
32
34
  export * from './radio/settings.js';
33
35
  export * from './radio/tone.js';
36
+ export * from './radio/validation.js';
34
37
 
35
38
  export * from './spectrum/band.js';
36
39
  export * from './spectrum/channel.js';
@@ -0,0 +1,22 @@
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';
5
+
6
+ /**
7
+ * Factory interface for creating radio codecs
8
+ *
9
+ * This interface provides a standardized way for radio modules to create
10
+ * codec instances that can encode/decode radio memory data.
11
+ */
12
+ export interface CodecFactory {
13
+ /**
14
+ * Creates a codec instance for a specific radio model
15
+ *
16
+ * @param modelId - The radio model identifier
17
+ * @param config - Configuration object for the codec
18
+ * @param logger - Logger instance for the codec
19
+ * @returns Promise that resolves to a RadioCodec instance
20
+ */
21
+ createCodec(modelId: RadioModelId, config: Record<string, unknown>, logger: ILogLayer): Promise<RadioCodec>;
22
+ }
@@ -40,8 +40,10 @@ export interface RadioSendStep {
40
40
 
41
41
  export interface RadioReceiveStep {
42
42
  receive: {
43
- type: string;
43
+ type: 'exact' | 'variable' | 'pattern' | 'any';
44
+ value?: number;
44
45
  length: number;
46
+ pattern?: (string | number | { field: string; size: number })[];
45
47
  description?: string;
46
48
  };
47
49
  }
@@ -6,6 +6,8 @@ import type { RadioSerialConfig } from './serial-config.js';
6
6
 
7
7
  export interface Radio {
8
8
  id: RadioId;
9
+ version: string;
10
+ description: string;
9
11
  settingsSchema: RadioSchema;
10
12
  memoryConfig: RadioMemoryConfig;
11
13
  serialConfig: RadioSerialConfig;
@@ -0,0 +1,44 @@
1
+ // oxlint-disable consistent-indexed-object-style
2
+ import type { RadioCodec } from './codec.js';
3
+
4
+ /**
5
+ * Interface for managing shared components across radio models
6
+ *
7
+ * This interface provides a standardized way for radio modules to share
8
+ * common components like schemas, protocols, and codecs.
9
+ */
10
+ export interface SharedComponentManager {
11
+ /**
12
+ * Load a shared schema from a file path
13
+ *
14
+ * @param schemaPath - Path to the schema file
15
+ * @returns Promise that resolves to the schema object
16
+ */
17
+ loadSchema(schemaPath: string): Promise<Record<string, unknown>>;
18
+
19
+ /**
20
+ * Load a shared protocol from a file path
21
+ *
22
+ * @param protocolPath - Path to the protocol file
23
+ * @returns Promise that resolves to the protocol object
24
+ */
25
+ loadProtocol(protocolPath: string): Promise<Record<string, unknown>>;
26
+
27
+ /**
28
+ * Load a shared codec from a file path
29
+ *
30
+ * @param codecPath - Path to the codec module
31
+ * @param config - Configuration for the codec
32
+ * @returns Promise that resolves to a RadioCodec instance
33
+ */
34
+ loadCodec(codecPath: string, config: Record<string, unknown>): Promise<RadioCodec>;
35
+
36
+ /**
37
+ * Resolve a component reference relative to a base path
38
+ *
39
+ * @param reference - The reference to resolve
40
+ * @param basePath - The base path for resolution
41
+ * @returns The resolved absolute path
42
+ */
43
+ resolveReference(reference: string, basePath: string): string;
44
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Result of a validation operation
3
+ *
4
+ * This interface provides a standardized way to return validation results
5
+ * across different parts of the radio system.
6
+ */
7
+ export interface ValidationResult {
8
+ /**
9
+ * Whether the validation passed
10
+ */
11
+ isValid: boolean;
12
+
13
+ /**
14
+ * List of validation errors
15
+ */
16
+ errors: string[];
17
+
18
+ /**
19
+ * List of validation warnings
20
+ */
21
+ warnings: string[];
22
+ }