usb 1.9.1 → 2.0.1
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/.eslintignore +4 -0
- package/.eslintrc.json +87 -0
- package/.gitattributes +1 -0
- package/.vscode/launch.json +15 -0
- package/.vscode/tasks.json +23 -0
- package/CHANGELOG.md +13 -0
- package/README.md +400 -175
- package/dist/index.d.ts +17 -0
- package/dist/index.js +133 -0
- package/dist/index.js.map +1 -0
- package/dist/usb/bindings.d.ts +253 -0
- package/dist/usb/bindings.js +10 -0
- package/dist/usb/bindings.js.map +1 -0
- package/dist/usb/capability.d.ts +14 -0
- package/dist/usb/capability.js +18 -0
- package/dist/usb/capability.js.map +1 -0
- package/dist/usb/descriptors.d.ts +129 -0
- package/dist/usb/descriptors.js +3 -0
- package/dist/usb/descriptors.js.map +1 -0
- package/dist/usb/device.d.ts +94 -0
- package/dist/usb/device.js +300 -0
- package/dist/usb/device.js.map +1 -0
- package/dist/usb/endpoint.d.ts +91 -0
- package/dist/usb/endpoint.js +236 -0
- package/dist/usb/endpoint.js.map +1 -0
- package/dist/usb/index.d.ts +25 -0
- package/dist/usb/index.js +116 -0
- package/dist/usb/index.js.map +1 -0
- package/dist/usb/interface.d.ts +78 -0
- package/dist/usb/interface.js +137 -0
- package/dist/usb/interface.js.map +1 -0
- package/dist/webusb/index.d.ts +56 -0
- package/dist/webusb/index.js +412 -0
- package/dist/webusb/index.js.map +1 -0
- package/dist/webusb/mutex.d.ts +22 -0
- package/dist/webusb/mutex.js +89 -0
- package/dist/webusb/mutex.js.map +1 -0
- package/dist/webusb/webusb-device.d.ts +49 -0
- package/dist/webusb/webusb-device.js +888 -0
- package/dist/webusb/webusb-device.js.map +1 -0
- package/package.json +28 -15
- package/prebuilds/android-arm/node.napi.armv7.node +0 -0
- package/prebuilds/android-arm64/node.napi.armv8.node +0 -0
- package/prebuilds/darwin-x64+arm64/node.napi.node +0 -0
- package/prebuilds/linux-arm/node.napi.armv6.node +0 -0
- package/prebuilds/linux-arm/node.napi.armv7.node +0 -0
- package/prebuilds/linux-arm64/node.napi.armv8.node +0 -0
- package/prebuilds/linux-ia32/node.napi.node +0 -0
- package/prebuilds/linux-x64/node.napi.glibc.node +0 -0
- package/prebuilds/linux-x64/node.napi.musl.node +0 -0
- package/prebuilds/win32-ia32/node.napi.node +0 -0
- package/prebuilds/win32-x64/node.napi.node +0 -0
- package/src/device.cc +6 -6
- package/test/usb.coffee +13 -7
- package/test/webusb.coffee +189 -0
- package/tsc/index.ts +67 -0
- package/tsc/usb/bindings.ts +304 -0
- package/tsc/usb/capability.ts +22 -0
- package/tsc/usb/descriptors.ts +180 -0
- package/tsc/usb/device.ts +325 -0
- package/tsc/usb/endpoint.ts +228 -0
- package/tsc/usb/index.ts +111 -0
- package/tsc/usb/interface.ts +172 -0
- package/tsc/webusb/index.ts +363 -0
- package/tsc/webusb/mutex.ts +38 -0
- package/tsc/webusb/webusb-device.ts +534 -0
- package/tsconfig.json +17 -0
- package/typedoc.json +9 -0
- package/usb.js +0 -573
package/.eslintignore
ADDED
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"parser": "@typescript-eslint/parser",
|
|
3
|
+
"plugins": [
|
|
4
|
+
"@typescript-eslint"
|
|
5
|
+
],
|
|
6
|
+
"extends": [
|
|
7
|
+
// https://eslint.org/docs/rules/
|
|
8
|
+
"eslint:recommended",
|
|
9
|
+
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin
|
|
10
|
+
"plugin:@typescript-eslint/recommended"
|
|
11
|
+
],
|
|
12
|
+
"rules": {
|
|
13
|
+
"@typescript-eslint/no-empty-interface": [
|
|
14
|
+
"warn"
|
|
15
|
+
],
|
|
16
|
+
"@typescript-eslint/no-this-alias": [
|
|
17
|
+
"warn"
|
|
18
|
+
],
|
|
19
|
+
"@typescript-eslint/no-unused-vars": [
|
|
20
|
+
"warn",
|
|
21
|
+
{
|
|
22
|
+
"argsIgnorePattern": "^_"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"block-spacing": [
|
|
26
|
+
"error",
|
|
27
|
+
"always"
|
|
28
|
+
],
|
|
29
|
+
"brace-style": [
|
|
30
|
+
"error",
|
|
31
|
+
"1tbs",
|
|
32
|
+
{
|
|
33
|
+
"allowSingleLine": true
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"eol-last": [
|
|
37
|
+
"error"
|
|
38
|
+
],
|
|
39
|
+
"indent": [
|
|
40
|
+
"error",
|
|
41
|
+
4,
|
|
42
|
+
{
|
|
43
|
+
"SwitchCase": 1
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"linebreak-style": [
|
|
47
|
+
"error",
|
|
48
|
+
"unix"
|
|
49
|
+
],
|
|
50
|
+
"no-console": [
|
|
51
|
+
"warn"
|
|
52
|
+
],
|
|
53
|
+
"no-constant-condition": [
|
|
54
|
+
"error",
|
|
55
|
+
{
|
|
56
|
+
"checkLoops": false
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"no-trailing-spaces": [
|
|
60
|
+
"error"
|
|
61
|
+
],
|
|
62
|
+
"object-curly-spacing": [
|
|
63
|
+
"error",
|
|
64
|
+
"always"
|
|
65
|
+
],
|
|
66
|
+
"quotes": [
|
|
67
|
+
"error",
|
|
68
|
+
"single"
|
|
69
|
+
],
|
|
70
|
+
"semi": [
|
|
71
|
+
"error",
|
|
72
|
+
"always"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
"env": {
|
|
76
|
+
"commonjs": true,
|
|
77
|
+
"es6": true,
|
|
78
|
+
"node": true
|
|
79
|
+
},
|
|
80
|
+
"parserOptions": {
|
|
81
|
+
"ecmaVersion": 12,
|
|
82
|
+
"sourceType": "module",
|
|
83
|
+
"project": [
|
|
84
|
+
"./tsconfig.json"
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
}
|
package/.gitattributes
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* -text
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
|
3
|
+
// Hover to view descriptions of existing attributes.
|
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"configurations": [
|
|
7
|
+
{
|
|
8
|
+
"name": "Full Test",
|
|
9
|
+
"type": "node-terminal",
|
|
10
|
+
"request": "launch",
|
|
11
|
+
"preLaunchTask": "test",
|
|
12
|
+
"command": "exit 0",
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tasks": [
|
|
3
|
+
{
|
|
4
|
+
"label": "compile",
|
|
5
|
+
"type": "npm",
|
|
6
|
+
"script": "compile"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"label": "watch",
|
|
10
|
+
"type": "npm",
|
|
11
|
+
"script": "watch",
|
|
12
|
+
"group": {
|
|
13
|
+
"kind": "build",
|
|
14
|
+
"isDefault": true
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"label": "test",
|
|
19
|
+
"type": "npm",
|
|
20
|
+
"script": "full-test"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.0.1] - 2021-12-11
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Added new WebUSB API - [`443`](https://github.com/node-usb/node-usb/pull/443) ([Rob Moran](https://github.com/thegecko))
|
|
7
|
+
- Switched to TypeScript
|
|
8
|
+
- Switched to yarn instead of npm
|
|
9
|
+
- Added docs using Typedoc
|
|
10
|
+
|
|
11
|
+
## [1.9.2] - 2021-12-05
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
- Fixed exit delay and hang by moving queue start/stop to device open/close - [`460`](https://github.com/node-usb/node-usb/pull/460) ([MikeColeGuru](https://github.com/MikeColeGuru))
|
|
15
|
+
|
|
3
16
|
## [1.9.1] - 2021-11-14
|
|
4
17
|
|
|
5
18
|
### Fixed
|