@psdk/device-webusb 0.2.34 → 0.2.36
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/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +7 -7
- package/package.json +3 -3
package/build/index.d.ts
CHANGED
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAmB,WAAW,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAmB,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAEjF,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsB;IAC9C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IAEvC,OAAO,CAAC,KAAK,CAAkB;IAC/B,OAAO,CAAC,MAAM,CAAC,CAAM;gBAEF,OAAO,EAAE;QAC1B;;WAEG;QACH,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;QAC7B;;WAEG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB;;WAEG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB;;WAEG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB;WAYa,UAAU,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM;WAIxC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,MAAM;IAIlD,OAAO,IAAI,OAAO,CAAC,eAAe,CAAC;YA4BlC,eAAe;CAgD9B;AAED,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,OAAO,CAAC,EAAE;QACpB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB;;WAEG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;WAKa,GAAG,IAAI,iBAAiB;IAItC,IAAI,UAAU,IAAI,MAAM,CAEvB;CACF;AAED,qBAAa,YAAY;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;gBAEP,OAAO,EAAE;QAC1B;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;QACjB;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;CAIF"}
|
package/build/index.js
CHANGED
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.DeviceFilter = exports.WebusbReadOptions = exports.Webusb = void 0;
|
|
13
|
-
const
|
|
13
|
+
const frame_father_1 = require("@psdk/frame-father");
|
|
14
14
|
class Webusb {
|
|
15
15
|
constructor(options) {
|
|
16
16
|
var _a, _b, _c, _d;
|
|
@@ -20,7 +20,7 @@ class Webusb {
|
|
|
20
20
|
this.filters = options.filters;
|
|
21
21
|
this.configuration = (_a = options.configuration) !== null && _a !== void 0 ? _a : 1;
|
|
22
22
|
this.interface = (_b = options.interface) !== null && _b !== void 0 ? _b : 0;
|
|
23
|
-
this.state =
|
|
23
|
+
this.state = frame_father_1.ConnectionState.DISCONNECTED;
|
|
24
24
|
this.readEndpoint = (_c = options.readEndpoint) !== null && _c !== void 0 ? _c : 2;
|
|
25
25
|
this.writeEndpoint = (_d = options.writeEndpoint) !== null && _d !== void 0 ? _d : 2;
|
|
26
26
|
}
|
|
@@ -45,14 +45,14 @@ class Webusb {
|
|
|
45
45
|
yield device.open();
|
|
46
46
|
yield device.selectConfiguration(this.configuration);
|
|
47
47
|
yield device.claimInterface(device.configuration.interfaces[this.interface].interfaceNumber);
|
|
48
|
-
this.state =
|
|
48
|
+
this.state = frame_father_1.ConnectionState.CONNECTED;
|
|
49
49
|
// @ts-ignore
|
|
50
50
|
navigator.usb.addEventListener('connect', e => {
|
|
51
|
-
this.state =
|
|
51
|
+
this.state = frame_father_1.ConnectionState.CONNECTED;
|
|
52
52
|
});
|
|
53
53
|
// @ts-ignore
|
|
54
54
|
navigator.usb.addEventListener('disconnect', e => {
|
|
55
|
-
this.state =
|
|
55
|
+
this.state = frame_father_1.ConnectionState.DISCONNECTED;
|
|
56
56
|
});
|
|
57
57
|
this.device = device;
|
|
58
58
|
return yield this.connectedDevice();
|
|
@@ -68,7 +68,7 @@ class Webusb {
|
|
|
68
68
|
connectionState() {
|
|
69
69
|
const device = _device();
|
|
70
70
|
if (!device.opened) {
|
|
71
|
-
return
|
|
71
|
+
return frame_father_1.ConnectionState.DISCONNECTED;
|
|
72
72
|
}
|
|
73
73
|
return _connectionState();
|
|
74
74
|
}
|
|
@@ -111,7 +111,7 @@ class Webusb {
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
exports.Webusb = Webusb;
|
|
114
|
-
class WebusbReadOptions extends
|
|
114
|
+
class WebusbReadOptions extends frame_father_1.ReadOptions {
|
|
115
115
|
constructor(options) {
|
|
116
116
|
var _a;
|
|
117
117
|
super(options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@psdk/device-webusb",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.36",
|
|
4
4
|
"description": "psdk",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"webpack-cli": "^4.9.2"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@psdk/frame": "0.2.
|
|
45
|
+
"@psdk/frame-father": "0.2.36"
|
|
46
46
|
},
|
|
47
47
|
"files": [
|
|
48
48
|
"build",
|
|
49
49
|
"!build/browser/psdk*"
|
|
50
50
|
],
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "5ea4eaf5051669a70fb46b4304097265bbb104b1"
|
|
52
52
|
}
|