@springfield/ham-radio-api 0.13.0 → 0.15.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.
@@ -0,0 +1,6 @@
1
+ declare const brand: unique symbol;
2
+ export type Brand<T, TBrand extends string> = T & {
3
+ [brand]: TBrand;
4
+ };
5
+ export {};
6
+ //# sourceMappingURL=brand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brand.d.ts","sourceRoot":"","sources":["../src/brand.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,EAAE,OAAO,MAAM,CAAC;AAEnC,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,MAAM,SAAS,MAAM,IAAI,CAAC,GAAG;IAAE,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC"}
package/dist/brand.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=brand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brand.js","sourceRoot":"","sources":["../src/brand.ts"],"names":[],"mappings":""}
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export * from './radio/channel.js';
4
4
  export * from './radio/connection.js';
5
5
  export * from './radio/driver.js';
6
6
  export * from './radio/manufacturer.js';
7
+ export * from './radio/memory.js';
7
8
  export * from './radio/model.js';
8
9
  export * from './radio/module.js';
9
10
  export * from './radio/program.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AAEnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iBAAiB,CAAC;AAEhC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AAEnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iBAAiB,CAAC;AAEhC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAA"}
package/dist/index.js CHANGED
@@ -20,6 +20,7 @@ __exportStar(require("./radio/channel.js"), exports);
20
20
  __exportStar(require("./radio/connection.js"), exports);
21
21
  __exportStar(require("./radio/driver.js"), exports);
22
22
  __exportStar(require("./radio/manufacturer.js"), exports);
23
+ __exportStar(require("./radio/memory.js"), exports);
23
24
  __exportStar(require("./radio/model.js"), exports);
24
25
  __exportStar(require("./radio/module.js"), exports);
25
26
  __exportStar(require("./radio/program.js"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AAEnC,+DAA6C;AAC7C,qDAAmC;AACnC,wDAAsC;AACtC,oDAAkC;AAClC,0DAAwC;AACxC,mDAAiC;AACjC,oDAAkC;AAClC,qDAAmC;AACnC,gEAA8C;AAC9C,gEAA8C;AAC9C,kDAAgC;AAEhC,qDAAmC;AACnC,wDAAsC;AACtC,qDAAmC;AACnC,0DAAuC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AAEnC,+DAA6C;AAC7C,qDAAmC;AACnC,wDAAsC;AACtC,oDAAkC;AAClC,0DAAwC;AACxC,oDAAkC;AAClC,mDAAiC;AACjC,oDAAkC;AAClC,qDAAmC;AACnC,gEAA8C;AAC9C,gEAA8C;AAC9C,kDAAgC;AAEhC,qDAAmC;AACnC,wDAAsC;AACtC,qDAAmC;AACnC,0DAAuC"}
@@ -1,7 +1,10 @@
1
+ import { RadioMemory } from './memory.js';
1
2
  import { RadioProgram } from './program.js';
2
3
  import { RadioProgressIndicator } from './progress-indicator.js';
3
4
  export interface RadioDriver {
4
- importFromRadio(path: string, progressIndicator: RadioProgressIndicator): Promise<RadioProgram | undefined>;
5
- programRadio(path: string, program: RadioProgram, progressIndicator: RadioProgressIndicator): Promise<void>;
5
+ readRadio(serialPortPath: string, progressIndicator: RadioProgressIndicator): Promise<RadioMemory | undefined>;
6
+ writeRadio(serialPortPath: string, memory: RadioMemory, progressIndicator: RadioProgressIndicator): Promise<void>;
7
+ decodeMemory(memory: RadioMemory): RadioProgram;
8
+ encodeProgram(program: RadioProgram, memory: RadioMemory): RadioMemory;
6
9
  }
7
10
  //# sourceMappingURL=driver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/radio/driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,MAAM,WAAW,WAAW;IAC1B,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,sBAAsB,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC;IAC5G,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7G"}
1
+ {"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/radio/driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,cAAc,EAAE,MAAM,EAAE,iBAAiB,EAAE,sBAAsB,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;IAC/G,UAAU,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,iBAAiB,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElH,YAAY,CAAC,MAAM,EAAE,WAAW,GAAG,YAAY,CAAC;IAChD,aAAa,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,GAAG,WAAW,CAAC;CACxE"}
@@ -0,0 +1,5 @@
1
+ export interface RadioMemory {
2
+ radioModelId: string;
3
+ contents: any;
4
+ }
5
+ //# sourceMappingURL=memory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/radio/memory.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,GAAG,CAAC;CACf"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=memory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/radio/memory.ts"],"names":[],"mappings":""}
@@ -1,4 +1,5 @@
1
1
  export interface RadioModel {
2
+ id: string;
2
3
  moduleId: string;
3
4
  name: string;
4
5
  schema: any;
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/radio/model.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,GAAG,CAAC;CACb"}
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/radio/model.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,GAAG,CAAC;CACb"}
@@ -1,9 +1,13 @@
1
1
  import { RadioChannelReference } from './channel-reference.js';
2
2
  import { RadioChannel } from './channel.js';
3
+ export interface RadioSpecificChannelSettings {
4
+ [setting: string]: number | string | boolean;
5
+ }
3
6
  export interface RadioProgrammedChannel {
4
7
  id?: string;
8
+ radioModelId: string;
5
9
  channelNumber: number;
6
- transmitPower: number;
7
10
  radioChannel: RadioChannel | RadioChannelReference;
11
+ settings?: RadioSpecificChannelSettings;
8
12
  }
9
13
  //# sourceMappingURL=programmed-channel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"programmed-channel.d.ts","sourceRoot":"","sources":["../../src/radio/programmed-channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,WAAW,sBAAsB;IACrC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,YAAY,GAAG,qBAAqB,CAAC;CACpD"}
1
+ {"version":3,"file":"programmed-channel.d.ts","sourceRoot":"","sources":["../../src/radio/programmed-channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,WAAW,4BAA4B;IAC3C,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAC9C;AAED,MAAM,WAAW,sBAAsB;IACrC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,YAAY,GAAG,qBAAqB,CAAC;IACnD,QAAQ,CAAC,EAAE,4BAA4B,CAAC;CACzC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@springfield/ham-radio-api",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
4
  "author": "Bryan Hunt",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,7 +11,7 @@
11
11
  "scripts": {
12
12
  "build": "tsc"
13
13
  },
14
- "packageManager": "yarn@3.4.1",
14
+ "packageManager": "yarn@3.5.0",
15
15
  "devDependencies": {
16
16
  "typescript": "4.9.5"
17
17
  }
package/src/brand.ts ADDED
@@ -0,0 +1,3 @@
1
+ declare const brand: unique symbol;
2
+
3
+ export type Brand<T, TBrand extends string> = T & { [brand]: TBrand };
package/src/index.ts CHANGED
@@ -5,6 +5,7 @@ export * from './radio/channel.js';
5
5
  export * from './radio/connection.js';
6
6
  export * from './radio/driver.js';
7
7
  export * from './radio/manufacturer.js';
8
+ export * from './radio/memory.js';
8
9
  export * from './radio/model.js';
9
10
  export * from './radio/module.js';
10
11
  export * from './radio/program.js';
@@ -1,7 +1,11 @@
1
+ import { RadioMemory } from './memory.js';
1
2
  import { RadioProgram } from './program.js';
2
3
  import { RadioProgressIndicator } from './progress-indicator.js';
3
4
 
4
5
  export interface RadioDriver {
5
- importFromRadio(path: string, progressIndicator: RadioProgressIndicator): Promise<RadioProgram | undefined>;
6
- programRadio(path: string, program: RadioProgram, progressIndicator: RadioProgressIndicator): Promise<void>;
6
+ readRadio(serialPortPath: string, progressIndicator: RadioProgressIndicator): Promise<RadioMemory | undefined>;
7
+ writeRadio(serialPortPath: string, memory: RadioMemory, progressIndicator: RadioProgressIndicator): Promise<void>;
8
+
9
+ decodeMemory(memory: RadioMemory): RadioProgram;
10
+ encodeProgram(program: RadioProgram, memory: RadioMemory): RadioMemory;
7
11
  }
@@ -0,0 +1,4 @@
1
+ export interface RadioMemory {
2
+ radioModelId: string;
3
+ contents: any;
4
+ }
@@ -1,4 +1,5 @@
1
1
  export interface RadioModel {
2
+ id: string;
2
3
  moduleId: string;
3
4
  name: string;
4
5
  schema: any;
@@ -1,9 +1,14 @@
1
1
  import { RadioChannelReference } from './channel-reference.js';
2
2
  import { RadioChannel } from './channel.js';
3
3
 
4
+ export interface RadioSpecificChannelSettings {
5
+ [setting: string]: number | string | boolean;
6
+ }
7
+
4
8
  export interface RadioProgrammedChannel {
5
9
  id?: string;
10
+ radioModelId: string;
6
11
  channelNumber: number;
7
- transmitPower: number;
8
12
  radioChannel: RadioChannel | RadioChannelReference;
13
+ settings?: RadioSpecificChannelSettings;
9
14
  }