@ya-modbus/driver-types 0.5.1 → 0.7.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 (54) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/cjs/data-types.d.ts.map +1 -0
  3. package/dist/cjs/data-types.js +6 -0
  4. package/dist/cjs/data-types.js.map +1 -0
  5. package/dist/cjs/device-driver.d.ts.map +1 -0
  6. package/dist/cjs/device-driver.js +6 -0
  7. package/dist/cjs/device-driver.js.map +1 -0
  8. package/dist/cjs/index.d.ts.map +1 -0
  9. package/dist/cjs/index.js +15 -0
  10. package/dist/cjs/index.js.map +1 -0
  11. package/dist/cjs/package.json +1 -0
  12. package/dist/cjs/transport.d.ts.map +1 -0
  13. package/dist/cjs/transport.js +9 -0
  14. package/dist/cjs/transport.js.map +1 -0
  15. package/dist/cjs/units.d.ts.map +1 -0
  16. package/dist/cjs/units.js +11 -0
  17. package/dist/cjs/units.js.map +1 -0
  18. package/dist/esm/data-types.d.ts +44 -0
  19. package/dist/esm/data-types.d.ts.map +1 -0
  20. package/dist/{data-types.js.map → esm/data-types.js.map} +1 -1
  21. package/dist/esm/device-driver.d.ts +283 -0
  22. package/dist/esm/device-driver.d.ts.map +1 -0
  23. package/dist/esm/device-driver.js.map +1 -0
  24. package/dist/esm/index.d.ts +11 -0
  25. package/dist/esm/index.d.ts.map +1 -0
  26. package/dist/esm/index.js.map +1 -0
  27. package/dist/esm/package.json +1 -0
  28. package/dist/esm/transport.d.ts +79 -0
  29. package/dist/esm/transport.d.ts.map +1 -0
  30. package/dist/{transport.js.map → esm/transport.js.map} +1 -1
  31. package/dist/esm/units.d.ts +11 -0
  32. package/dist/esm/units.d.ts.map +1 -0
  33. package/dist/esm/units.js.map +1 -0
  34. package/dist/tsconfig.cjs.tsbuildinfo +1 -0
  35. package/dist/tsconfig.esm.tsbuildinfo +1 -0
  36. package/package.json +24 -7
  37. package/dist/data-types.d.ts.map +0 -1
  38. package/dist/device-driver.d.ts.map +0 -1
  39. package/dist/device-driver.js.map +0 -1
  40. package/dist/index.d.ts.map +0 -1
  41. package/dist/index.js.map +0 -1
  42. package/dist/transport.d.ts.map +0 -1
  43. package/dist/units.d.ts.map +0 -1
  44. package/dist/units.js.map +0 -1
  45. /package/dist/{data-types.d.ts → cjs/data-types.d.ts} +0 -0
  46. /package/dist/{device-driver.d.ts → cjs/device-driver.d.ts} +0 -0
  47. /package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
  48. /package/dist/{transport.d.ts → cjs/transport.d.ts} +0 -0
  49. /package/dist/{units.d.ts → cjs/units.d.ts} +0 -0
  50. /package/dist/{data-types.js → esm/data-types.js} +0 -0
  51. /package/dist/{device-driver.js → esm/device-driver.js} +0 -0
  52. /package/dist/{index.js → esm/index.js} +0 -0
  53. /package/dist/{transport.js → esm/transport.js} +0 -0
  54. /package/dist/{units.js → esm/units.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,39 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.7.0](https://github.com/groupsky/ya-modbus/compare/@ya-modbus/driver-types@0.6.0...@ya-modbus/driver-types@0.7.0) (2026-01-11)
7
+
8
+ ### Features
9
+
10
+ - **build:** add dual CommonJS/ESM package support ([#187](https://github.com/groupsky/ya-modbus/issues/187)) ([3d78130](https://github.com/groupsky/ya-modbus/commit/3d781304d42edba335cdc320ba25275f3b4ea6c9))
11
+
12
+ # 0.6.0 (2026-01-04)
13
+
14
+ ### Bug Fixes
15
+
16
+ - enable linting without build and fix monorepo build order ([#129](https://github.com/groupsky/ya-modbus/issues/129)) ([e4ba4fd](https://github.com/groupsky/ya-modbus/commit/e4ba4fdc61c8695c3ab0b9504ef340d19861c599)), closes [#130](https://github.com/groupsky/ya-modbus/issues/130)
17
+ - **release:** bump versions to 0.2.0 to bypass npm 24h block ([#148](https://github.com/groupsky/ya-modbus/issues/148)) ([aa2be6a](https://github.com/groupsky/ya-modbus/commit/aa2be6ae998f4443774b43507e7991601ec3068a))
18
+ - **release:** revert failed release and add missing publishConfig ([#147](https://github.com/groupsky/ya-modbus/issues/147)) ([60ea209](https://github.com/groupsky/ya-modbus/commit/60ea2091cbb350b0f474dc45d3ab33177b050764))
19
+ - **release:** revert failed release and cleanup tags ([#145](https://github.com/groupsky/ya-modbus/issues/145)) ([228ae2b](https://github.com/groupsky/ya-modbus/commit/228ae2b4da0c433e475825d068202efd3f0d3a5a)), closes [#143](https://github.com/groupsky/ya-modbus/issues/143) [#144](https://github.com/groupsky/ya-modbus/issues/144)
20
+ - resolve ESLint configuration and linting errors ([5f98109](https://github.com/groupsky/ya-modbus/commit/5f98109e91e6d2045298404e27dc78c3d6792928))
21
+ - use tsc --build and add composite to all packages ([6001bfa](https://github.com/groupsky/ya-modbus/commit/6001bfa77c6dd87930604b0e7eb6c342991b3988))
22
+
23
+ ### Features
24
+
25
+ - add Dependabot with auto-merge and optimize dependencies ([790b31a](https://github.com/groupsky/ya-modbus/commit/790b31aa3282df56517d6d07052204b65c061cdc))
26
+ - add XYMD1 temperature/humidity sensor driver ([b657fc9](https://github.com/groupsky/ya-modbus/commit/b657fc9d142a1b7dcf0f0d82b53b415b5ed7f51a))
27
+ - **cli:** add driver DEFAULT_CONFIG and SUPPORTED_CONFIG support ([#54](https://github.com/groupsky/ya-modbus/issues/54)) ([a41ddf0](https://github.com/groupsky/ya-modbus/commit/a41ddf0ee439b9ecd5a2e069af9055deb9fc074f)), closes [#51](https://github.com/groupsky/ya-modbus/issues/51) [56-#60](https://github.com/56-/issues/60) [#51](https://github.com/groupsky/ya-modbus/issues/51)
28
+ - **cli:** Add interactive CLI tool for testing Modbus device drivers ([#17](https://github.com/groupsky/ya-modbus/issues/17)) ([41a5083](https://github.com/groupsky/ya-modbus/commit/41a5083d813fa2e75ed14ce7d1b042e56f55e33a))
29
+ - **driver-types:** add standard types for driver DEFAULT_CONFIG and SUPPORTED_CONFIG ([#52](https://github.com/groupsky/ya-modbus/issues/52)) ([c87b809](https://github.com/groupsky/ya-modbus/commit/c87b809dd07a28d645cb073c32f2954a7398a935)), closes [#51](https://github.com/groupsky/ya-modbus/issues/51) [#48](https://github.com/groupsky/ya-modbus/issues/48) [#49](https://github.com/groupsky/ya-modbus/issues/49) [#50](https://github.com/groupsky/ya-modbus/issues/50) [#51](https://github.com/groupsky/ya-modbus/issues/51)
30
+ - **drivers:** add multi-device driver support ([#75](https://github.com/groupsky/ya-modbus/issues/75)) ([d52173b](https://github.com/groupsky/ya-modbus/commit/d52173bdeb02ce54b7048978e404245fecba5efb))
31
+ - **drivers:** add NOARK Ex9EM energy meter driver ([#79](https://github.com/groupsky/ya-modbus/issues/79)) ([c022d43](https://github.com/groupsky/ya-modbus/commit/c022d43096e1e3c067cf0285d706aac46cec1740))
32
+ - **release:** add Lerna-Lite publishing with pre-release support ([#135](https://github.com/groupsky/ya-modbus/issues/135)) ([3db7542](https://github.com/groupsky/ya-modbus/commit/3db7542ddbb7bb150b4deab50d5c96e5d668c852))
33
+ - **transport:** extract transport package for code reusability ([#102](https://github.com/groupsky/ya-modbus/issues/102)) ([aea6946](https://github.com/groupsky/ya-modbus/commit/aea6946b40f502ff630c7a0ec599088899c30a90)), closes [#107](https://github.com/groupsky/ya-modbus/issues/107) [#108](https://github.com/groupsky/ya-modbus/issues/108) [#109](https://github.com/groupsky/ya-modbus/issues/109) [#91](https://github.com/groupsky/ya-modbus/issues/91)
34
+
35
+ ### Reverts
36
+
37
+ - Revert "chore(release): publish packages" ([a6d080d](https://github.com/groupsky/ya-modbus/commit/a6d080deeacf306f4911b6d78eab05dac8bfa7a7))
38
+
6
39
  ## [0.5.1](https://github.com/groupsky/ya-modbus/compare/@ya-modbus/driver-types@0.5.0...@ya-modbus/driver-types@0.5.1) (2026-01-04)
7
40
 
8
41
  **Note:** Version bump only for package @ya-modbus/driver-types
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-types.d.ts","sourceRoot":"","sources":["../../src/data-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEtC;;GAEG;AACH,MAAM,MAAM,QAAQ,GAChB,OAAO,GACP,SAAS,GACT,SAAS,GACT,QAAQ,GACR,WAAW,GACX,MAAM,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,QAAQ,GAChB,SAAS,GACT,QAAQ,GACR,WAAW,CAAA;AAEf;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAA;AAEzC;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,4CAA4C;IAC5C,EAAE,EAAE,MAAM,CAAA;IAEV,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb,gBAAgB;IAChB,IAAI,EAAE,QAAQ,CAAA;IAEd,0BAA0B;IAC1B,IAAI,CAAC,EAAE,IAAI,CAAA;IAEX,uBAAuB;IACvB,QAAQ,CAAC,EAAE,QAAQ,CAAA;IAEnB,yBAAyB;IACzB,MAAM,CAAC,EAAE,UAAU,CAAA;IAEnB,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,CAAA;IAE5C,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * Standard data types and data point definitions
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=data-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-types.js","sourceRoot":"","sources":["../../src/data-types.ts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Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=device-driver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-driver.js","sourceRoot":"","sources":["../../src/device-driver.ts"],"names":[],"mappings":";AAAA;;GAEG"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /**
3
+ * Type definitions for ya-modbus device drivers
4
+ *
5
+ * This package contains TypeScript type definitions with no runtime code.
6
+ * It's designed to be a lightweight dependency for driver packages.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ const tslib_1 = require("tslib");
10
+ // Re-export all types
11
+ tslib_1.__exportStar(require("./device-driver.js"), exports);
12
+ tslib_1.__exportStar(require("./data-types.js"), exports);
13
+ tslib_1.__exportStar(require("./units.js"), exports);
14
+ tslib_1.__exportStar(require("./transport.js"), exports);
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,sBAAsB;AACtB,6DAAkC;AAClC,0DAA+B;AAC/B,qDAA0B;AAC1B,yDAA8B"}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;OAMG;IACH,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAErE;;;;;;OAMG;IACH,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAEnE;;;;;;OAMG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAE1D;;;;;;OAMG;IACH,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAEnE;;;;;OAKG;IACH,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAElE;;;;;OAKG;IACH,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEtE;;;;;OAKG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE/D;;;;;OAKG;IACH,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAElE;;;;;OAKG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACvB"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /**
3
+ * Transport layer interface
4
+ *
5
+ * Abstraction over Modbus RTU/TCP transports.
6
+ * Drivers use this interface to communicate with devices.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ //# sourceMappingURL=transport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport.js","sourceRoot":"","sources":["../../src/transport.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../src/units.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,IAAI,GAEZ,GAAG,GACH,GAAG,GACH,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,KAAK,GACL,KAAK,GACL,MAAM,GACN,IAAI,GACJ,KAAK,GACL,KAAK,GACL,MAAM,GACN,OAAO,GACP,IAAI,GACJ,IAAI,GACJ,GAAG,GAGH,IAAI,GACJ,IAAI,GACJ,GAAG,GAGH,IAAI,GACJ,KAAK,GACL,KAAK,GACL,KAAK,GAGL,KAAK,GACL,OAAO,GACP,MAAM,GAGN,KAAK,GACL,MAAM,GACN,KAAK,GAGL,GAAG,GAGH,GAAG,GACH,KAAK,GACL,GAAG,GAGH,KAAK,GACL,IAAI,CAAA"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ /**
3
+ * Standard units of measurement
4
+ *
5
+ * Canonical unit definitions for device data points.
6
+ * Drivers should use these standard units for interoperability.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ // Note: For custom units not in this list, use the closest standard unit
10
+ // or request addition to this type definition
11
+ //# sourceMappingURL=units.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"units.js","sourceRoot":"","sources":["../../src/units.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAwDH,yEAAyE;AACzE,8CAA8C"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Standard data types and data point definitions
3
+ */
4
+ import type { Unit } from './units.js';
5
+ /**
6
+ * Standard data types for data points
7
+ */
8
+ export type DataType = 'float' | 'integer' | 'boolean' | 'string' | 'timestamp' | 'enum';
9
+ /**
10
+ * Polling type for data points
11
+ */
12
+ export type PollType = 'dynamic' | 'static' | 'on-demand';
13
+ /**
14
+ * Access permissions for data points
15
+ */
16
+ export type AccessMode = 'r' | 'w' | 'rw';
17
+ /**
18
+ * Data point definition (semantic interface)
19
+ */
20
+ export interface DataPoint {
21
+ /** Unique identifier for this data point */
22
+ id: string;
23
+ /** Human-readable name */
24
+ name?: string;
25
+ /** Data type */
26
+ type: DataType;
27
+ /** Unit of measurement */
28
+ unit?: Unit;
29
+ /** Polling behavior */
30
+ pollType?: PollType;
31
+ /** Access permissions */
32
+ access?: AccessMode;
33
+ /** Optional description */
34
+ description?: string;
35
+ /** For enum type: valid values */
36
+ enumValues?: Record<string | number, string>;
37
+ /** Minimum valid value (for numeric types) */
38
+ min?: number;
39
+ /** Maximum valid value (for numeric types) */
40
+ max?: number;
41
+ /** Number of decimal places for display */
42
+ decimals?: number;
43
+ }
44
+ //# sourceMappingURL=data-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-types.d.ts","sourceRoot":"","sources":["../../src/data-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEtC;;GAEG;AACH,MAAM,MAAM,QAAQ,GAChB,OAAO,GACP,SAAS,GACT,SAAS,GACT,QAAQ,GACR,WAAW,GACX,MAAM,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,QAAQ,GAChB,SAAS,GACT,QAAQ,GACR,WAAW,CAAA;AAEf;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAA;AAEzC;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,4CAA4C;IAC5C,EAAE,EAAE,MAAM,CAAA;IAEV,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb,gBAAgB;IAChB,IAAI,EAAE,QAAQ,CAAA;IAEd,0BAA0B;IAC1B,IAAI,CAAC,EAAE,IAAI,CAAA;IAEX,uBAAuB;IACvB,QAAQ,CAAC,EAAE,QAAQ,CAAA;IAEnB,yBAAyB;IACzB,MAAM,CAAC,EAAE,UAAU,CAAA;IAEnB,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,CAAA;IAE5C,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB"}
@@ -1 +1 @@
1
- {"version":3,"file":"data-types.js","sourceRoot":"","sources":["../src/data-types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
1
+ {"version":3,"file":"data-types.js","sourceRoot":"","sources":["../../src/data-types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,283 @@
1
+ /**
2
+ * Core device driver interface
3
+ */
4
+ import type { DataPoint } from './data-types.js';
5
+ import type { Transport } from './transport.js';
6
+ /**
7
+ * Modbus slave/device ID
8
+ *
9
+ * Valid range: 1-247 (0 is broadcast, 248-255 reserved)
10
+ */
11
+ export type SlaveId = number;
12
+ /**
13
+ * Device driver factory function configuration
14
+ */
15
+ export interface DriverConfig {
16
+ /** Device key from driver's DEVICES registry (for multi-device drivers) */
17
+ device?: string;
18
+ /** Modbus transport layer */
19
+ transport: Transport;
20
+ /** Modbus slave ID (1-247) */
21
+ slaveId: SlaveId;
22
+ /** Optional custom poll interval in milliseconds */
23
+ pollInterval?: number;
24
+ }
25
+ /**
26
+ * Device driver interface
27
+ *
28
+ * Drivers are created using factory functions that return objects
29
+ * implementing this interface.
30
+ */
31
+ export interface DeviceDriver {
32
+ /** Unique device name/identifier */
33
+ readonly name: string;
34
+ /** Device manufacturer */
35
+ readonly manufacturer: string;
36
+ /** Device model identifier */
37
+ readonly model: string;
38
+ /** Available data points (semantic interface) */
39
+ readonly dataPoints: ReadonlyArray<DataPoint>;
40
+ /**
41
+ * Read data point value from device
42
+ *
43
+ * @param id - Data point identifier
44
+ * @returns Current value
45
+ */
46
+ readDataPoint(id: string): Promise<unknown>;
47
+ /**
48
+ * Write data point value to device
49
+ *
50
+ * @param id - Data point identifier
51
+ * @param value - Value to write
52
+ */
53
+ writeDataPoint(id: string, value: unknown): Promise<void>;
54
+ /**
55
+ * Read multiple data points atomically
56
+ *
57
+ * @param ids - Data point identifiers
58
+ * @returns Map of data point values
59
+ */
60
+ readDataPoints(ids: string[]): Promise<Record<string, unknown>>;
61
+ /**
62
+ * Optional device initialization
63
+ * Called once after driver creation
64
+ */
65
+ initialize?(): Promise<void>;
66
+ /**
67
+ * Optional cleanup
68
+ * Called when driver is being destroyed
69
+ */
70
+ destroy?(): Promise<void>;
71
+ }
72
+ /**
73
+ * Factory function signature for creating device drivers
74
+ */
75
+ export type CreateDriverFunction = (config: DriverConfig) => Promise<DeviceDriver>;
76
+ /**
77
+ * Serial port parity setting
78
+ */
79
+ export type Parity = 'none' | 'even' | 'odd';
80
+ /**
81
+ * Serial port data bits
82
+ */
83
+ export type DataBits = 7 | 8;
84
+ /**
85
+ * Serial port stop bits
86
+ */
87
+ export type StopBits = 1 | 2;
88
+ /**
89
+ * Serial port baud rate
90
+ *
91
+ * Common values: 2400, 4800, 9600, 14400, 19200, 38400, 57600, 115200
92
+ */
93
+ export type BaudRate = number;
94
+ /**
95
+ * Factory-default serial port configuration for RTU devices
96
+ *
97
+ * Driver packages should export a DEFAULT_CONFIG constant implementing this interface
98
+ * to provide sensible defaults for connecting to factory-default devices.
99
+ *
100
+ * @example
101
+ * ```typescript
102
+ * export const DEFAULT_CONFIG = {
103
+ * baudRate: 9600,
104
+ * parity: 'even',
105
+ * dataBits: 8,
106
+ * stopBits: 1,
107
+ * defaultAddress: 1,
108
+ * } as const satisfies DefaultSerialConfig
109
+ * ```
110
+ */
111
+ export interface DefaultSerialConfig {
112
+ /** Default baud rate (e.g., 9600, 19200) */
113
+ readonly baudRate: BaudRate;
114
+ /** Default parity setting */
115
+ readonly parity: Parity;
116
+ /** Default data bits (7 or 8) */
117
+ readonly dataBits: DataBits;
118
+ /** Default stop bits (1 or 2) */
119
+ readonly stopBits: StopBits;
120
+ /** Default Modbus slave address (1-247) */
121
+ readonly defaultAddress: SlaveId;
122
+ }
123
+ /**
124
+ * Factory-default TCP configuration for Modbus TCP devices
125
+ *
126
+ * @example
127
+ * ```typescript
128
+ * export const DEFAULT_CONFIG = {
129
+ * defaultAddress: 1,
130
+ * defaultPort: 502,
131
+ * } as const satisfies DefaultTCPConfig
132
+ * ```
133
+ */
134
+ export interface DefaultTCPConfig {
135
+ /** Default Modbus unit ID (1-247) */
136
+ readonly defaultAddress: SlaveId;
137
+ /** Default TCP port (typically 502) */
138
+ readonly defaultPort: number;
139
+ }
140
+ /**
141
+ * Union type for default device configuration
142
+ *
143
+ * Drivers should export DEFAULT_CONFIG matching one of these types
144
+ */
145
+ export type DefaultConfig = DefaultSerialConfig | DefaultTCPConfig;
146
+ /**
147
+ * Supported serial port configuration values
148
+ *
149
+ * Serial driver packages should export a SUPPORTED_CONFIG constant implementing this interface
150
+ * to define device-specific serial configuration constraints.
151
+ *
152
+ * All properties are optional - only specify values that are device-specific.
153
+ * Omit properties if your device supports all standard Modbus values for that setting.
154
+ * For example, omit `validParity` if your device supports all parity options (none/even/odd).
155
+ *
156
+ * @example
157
+ * ```typescript
158
+ * import type { SupportedSerialConfig } from '@ya-modbus/driver-types'
159
+ *
160
+ * export const SUPPORTED_CONFIG = {
161
+ * validBaudRates: [9600, 14400, 19200],
162
+ * validParity: ['even', 'none'],
163
+ * validDataBits: [8],
164
+ * validStopBits: [1],
165
+ * validAddressRange: [1, 247],
166
+ * } as const satisfies SupportedSerialConfig
167
+ * ```
168
+ */
169
+ export interface SupportedSerialConfig {
170
+ /**
171
+ * Supported baud rates
172
+ * Common values: 2400, 4800, 9600, 14400, 19200, 38400, 57600, 115200
173
+ */
174
+ readonly validBaudRates?: readonly BaudRate[];
175
+ /**
176
+ * Supported parity settings
177
+ * Values: 'none', 'even', 'odd'
178
+ */
179
+ readonly validParity?: readonly Parity[];
180
+ /**
181
+ * Supported data bits
182
+ * Common values: 7, 8
183
+ */
184
+ readonly validDataBits?: readonly DataBits[];
185
+ /**
186
+ * Supported stop bits
187
+ * Common values: 1, 2
188
+ */
189
+ readonly validStopBits?: readonly StopBits[];
190
+ /**
191
+ * Supported slave address range
192
+ * Typically 1-247 for Modbus
193
+ */
194
+ readonly validAddressRange?: readonly [min: number, max: number];
195
+ }
196
+ /**
197
+ * Supported TCP configuration values
198
+ *
199
+ * TCP driver packages should export a SUPPORTED_CONFIG constant implementing this interface
200
+ * to define device-specific TCP configuration constraints.
201
+ *
202
+ * @example
203
+ * ```typescript
204
+ * import type { SupportedTCPConfig } from '@ya-modbus/driver-types'
205
+ *
206
+ * export const SUPPORTED_CONFIG = {
207
+ * validPorts: [502, 503],
208
+ * validAddressRange: [1, 247],
209
+ * } as const satisfies SupportedTCPConfig
210
+ * ```
211
+ */
212
+ export interface SupportedTCPConfig {
213
+ /**
214
+ * Supported TCP ports
215
+ * Typically [502] for standard Modbus TCP
216
+ */
217
+ readonly validPorts?: readonly number[];
218
+ /**
219
+ * Supported device address range
220
+ * For Modbus TCP, this is the unit ID (typically 1-247)
221
+ */
222
+ readonly validAddressRange?: readonly [min: number, max: number];
223
+ }
224
+ /**
225
+ * Union type for supported device configuration
226
+ *
227
+ * Drivers should export SUPPORTED_CONFIG matching one of these types
228
+ */
229
+ export type SupportedConfig = SupportedSerialConfig | SupportedTCPConfig;
230
+ /**
231
+ * Device metadata for multi-device drivers
232
+ *
233
+ * Contains user-facing information about a supported device.
234
+ * Internal details like register mappings are not exposed here.
235
+ *
236
+ * @example
237
+ * ```typescript
238
+ * const deviceInfo: DeviceInfo = {
239
+ * manufacturer: 'ORNO',
240
+ * model: 'OR-WE-514',
241
+ * description: 'Single-phase energy meter',
242
+ * defaultConfig: { baudRate: 9600, parity: 'even', ... },
243
+ * }
244
+ * ```
245
+ */
246
+ export interface DeviceInfo {
247
+ /** Device manufacturer */
248
+ readonly manufacturer: string;
249
+ /** Device model identifier */
250
+ readonly model: string;
251
+ /** Human-readable device description */
252
+ readonly description?: string;
253
+ /** Device-specific default configuration */
254
+ readonly defaultConfig?: DefaultConfig;
255
+ /** Device-specific supported configuration constraints */
256
+ readonly supportedConfig?: SupportedConfig;
257
+ }
258
+ /**
259
+ * Registry of supported devices for multi-device drivers
260
+ *
261
+ * Maps device keys to their metadata. Device keys are used with the
262
+ * `device` parameter in DriverConfig to select which device to use.
263
+ *
264
+ * **Must contain at least one device.** Empty registries are rejected at runtime.
265
+ *
266
+ * @example
267
+ * ```typescript
268
+ * export const DEVICES = {
269
+ * 'or-we-514': {
270
+ * manufacturer: 'ORNO',
271
+ * model: 'OR-WE-514',
272
+ * description: 'Single-phase energy meter',
273
+ * },
274
+ * 'or-we-516': {
275
+ * manufacturer: 'ORNO',
276
+ * model: 'OR-WE-516',
277
+ * description: 'Three-phase energy meter',
278
+ * },
279
+ * } as const satisfies DeviceRegistry
280
+ * ```
281
+ */
282
+ export type DeviceRegistry = Readonly<Record<string, DeviceInfo>>;
283
+ //# sourceMappingURL=device-driver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-driver.d.ts","sourceRoot":"","sources":["../../src/device-driver.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAA;AAE5B;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,6BAA6B;IAC7B,SAAS,EAAE,SAAS,CAAA;IAEpB,8BAA8B;IAC9B,OAAO,EAAE,OAAO,CAAA;IAEhB,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,oCAAoC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IAErB,0BAA0B;IAC1B,QAAQ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;;;;;;;;;GAeG;AACH,MAAM,WAAW,UAAU;IACzB,0BAA0B;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAE7B,8BAA8B;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IAEtB,wCAAwC;IACxC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAE7B,4CAA4C;IAC5C,QAAQ,CAAC,aAAa,CAAC,EAAE,aAAa,CAAA;IAEtC,0DAA0D;IAC1D,QAAQ,CAAC,eAAe,CAAC,EAAE,eAAe,CAAA;CAC3C;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-driver.js","sourceRoot":"","sources":["../../src/device-driver.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Type definitions for ya-modbus device drivers
3
+ *
4
+ * This package contains TypeScript type definitions with no runtime code.
5
+ * It's designed to be a lightweight dependency for driver packages.
6
+ */
7
+ export * from './device-driver.js';
8
+ export * from './data-types.js';
9
+ export * from './units.js';
10
+ export * from './transport.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,sBAAsB;AACtB,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Transport layer interface
3
+ *
4
+ * Abstraction over Modbus RTU/TCP transports.
5
+ * Drivers use this interface to communicate with devices.
6
+ */
7
+ /**
8
+ * Modbus transport interface
9
+ */
10
+ export interface Transport {
11
+ /**
12
+ * Read holding registers
13
+ *
14
+ * @param address - Starting register address
15
+ * @param count - Number of registers to read
16
+ * @returns Register values as Buffer
17
+ */
18
+ readHoldingRegisters(address: number, count: number): Promise<Buffer>;
19
+ /**
20
+ * Read input registers
21
+ *
22
+ * @param address - Starting register address
23
+ * @param count - Number of registers to read
24
+ * @returns Register values as Buffer
25
+ */
26
+ readInputRegisters(address: number, count: number): Promise<Buffer>;
27
+ /**
28
+ * Read coils
29
+ *
30
+ * @param address - Starting coil address
31
+ * @param count - Number of coils to read
32
+ * @returns Coil values as Buffer
33
+ */
34
+ readCoils(address: number, count: number): Promise<Buffer>;
35
+ /**
36
+ * Read discrete inputs
37
+ *
38
+ * @param address - Starting input address
39
+ * @param count - Number of inputs to read
40
+ * @returns Input values as Buffer
41
+ */
42
+ readDiscreteInputs(address: number, count: number): Promise<Buffer>;
43
+ /**
44
+ * Write single holding register
45
+ *
46
+ * @param address - Register address
47
+ * @param value - Value to write (16-bit)
48
+ */
49
+ writeSingleRegister(address: number, value: number): Promise<void>;
50
+ /**
51
+ * Write multiple holding registers
52
+ *
53
+ * @param address - Starting register address
54
+ * @param values - Register values as Buffer
55
+ */
56
+ writeMultipleRegisters(address: number, values: Buffer): Promise<void>;
57
+ /**
58
+ * Write single coil
59
+ *
60
+ * @param address - Coil address
61
+ * @param value - Value to write (boolean)
62
+ */
63
+ writeSingleCoil(address: number, value: boolean): Promise<void>;
64
+ /**
65
+ * Write multiple coils
66
+ *
67
+ * @param address - Starting coil address
68
+ * @param values - Coil values as Buffer
69
+ */
70
+ writeMultipleCoils(address: number, values: Buffer): Promise<void>;
71
+ /**
72
+ * Close the transport connection
73
+ *
74
+ * Releases resources and allows the process to exit.
75
+ * Should be called when done using the transport.
76
+ */
77
+ close(): Promise<void>;
78
+ }
79
+ //# sourceMappingURL=transport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;OAMG;IACH,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAErE;;;;;;OAMG;IACH,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAEnE;;;;;;OAMG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAE1D;;;;;;OAMG;IACH,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAEnE;;;;;OAKG;IACH,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAElE;;;;;OAKG;IACH,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEtE;;;;;OAKG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE/D;;;;;OAKG;IACH,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAElE;;;;;OAKG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"transport.js","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
1
+ {"version":3,"file":"transport.js","sourceRoot":"","sources":["../../src/transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Standard units of measurement
3
+ *
4
+ * Canonical unit definitions for device data points.
5
+ * Drivers should use these standard units for interoperability.
6
+ */
7
+ /**
8
+ * Standard unit types
9
+ */
10
+ export type Unit = 'V' | 'A' | 'W' | 'kW' | 'VA' | 'kVA' | 'VAr' | 'kVAr' | 'Wh' | 'kWh' | 'MWh' | 'VArh' | 'kVArh' | 'Ah' | 'Hz' | 'Ω' | '°C' | '°F' | 'K' | 'Pa' | 'kPa' | 'bar' | 'psi' | 'L/s' | 'L/min' | 'm³/h' | 'm/s' | 'km/h' | 'rpm' | '%' | 's' | 'min' | 'h' | 'ppm' | 'dB';
11
+ //# sourceMappingURL=units.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../src/units.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,IAAI,GAEZ,GAAG,GACH,GAAG,GACH,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,KAAK,GACL,KAAK,GACL,MAAM,GACN,IAAI,GACJ,KAAK,GACL,KAAK,GACL,MAAM,GACN,OAAO,GACP,IAAI,GACJ,IAAI,GACJ,GAAG,GAGH,IAAI,GACJ,IAAI,GACJ,GAAG,GAGH,IAAI,GACJ,KAAK,GACL,KAAK,GACL,KAAK,GAGL,KAAK,GACL,OAAO,GACP,MAAM,GAGN,KAAK,GACL,MAAM,GACN,KAAK,GAGL,GAAG,GAGH,GAAG,GACH,KAAK,GACL,GAAG,GAGH,KAAK,GACL,IAAI,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"units.js","sourceRoot":"","sources":["../../src/units.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAwDH,yEAAyE;AACzE,8CAA8C"}