joulescope_driver 1.9.4 → 1.11.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/index.js CHANGED
@@ -14,8 +14,11 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- const addon = require('node-gyp-build')(__dirname);
18
17
 
18
+ const path = require('path')
19
+ const nodeGypBuild = require('node-gyp-build')
20
+
21
+ const addon = nodeGypBuild(path.dirname(require.resolve('joulescope_driver/package.json')))
19
22
 
20
23
  class JoulescopeDriver {
21
24
  constructor() {
@@ -0,0 +1,42 @@
1
+ declare module 'joulescope_driver' {
2
+
3
+ export interface Value {
4
+ data: number[]
5
+ decimate_factor: number
6
+ field_id: number
7
+ index: number
8
+ sample_id: number
9
+ sample_rate: number
10
+ time_map: {
11
+ offset_time: number
12
+ offset_counter: number
13
+ counter_rate: number
14
+ }
15
+ utc: number
16
+ }
17
+
18
+ class JoulescopeDriver {
19
+ constructor()
20
+
21
+ publish(topic: string, value: any, timeout?: number): void
22
+
23
+ query(topic: string, timeout?: number): any
24
+
25
+ finalize(): void
26
+
27
+ device_paths(timeout?: number): string[]
28
+
29
+ open(topic: string, mode?: number): void
30
+
31
+ close(topic: string): void
32
+
33
+ subscribe(
34
+ topic: string,
35
+ flags: number,
36
+ fn: (topic: string, value: Value) => void,
37
+ timeout?: number
38
+ ): () => void
39
+ }
40
+
41
+ export default JoulescopeDriver
42
+ }
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "joulescope_driver",
3
- "version": "1.9.4",
3
+ "version": "1.11.0",
4
4
  "description": "Interface with Joulescopes using node.js and Electron",
5
5
  "keywords": [
6
6
  "Joulescope",
7
7
  "Jetperch"
8
8
  ],
9
9
  "main": "./index.js",
10
+ "types": "./joulescope_driver.d.ts",
10
11
  "scripts": {
11
12
  "install": "node-gyp-build",
12
13
  "test": "node --napi-modules ./test/test_binding.js",