Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.

Commit

Permalink
Fixes flowtype of hw-transport-node-hid
Browse files Browse the repository at this point in the history
  • Loading branch information
gre committed Jun 3, 2019
1 parent 0e71462 commit f8ed6fc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default class TransportNodeHidSingleton extends TransportNodeHidNoEvents
/**
* if path="" is not provided, the library will take the first device
*/
static async open(): Promise<TransportNodeHidSingleton> {
static open(): Promise<TransportNodeHidSingleton> {
if (transportInstance) {
log("hid-verbose", "reusing opened transport instance");
return Promise.resolve(transportInstance);
Expand Down
4 changes: 2 additions & 2 deletions packages/hw-transport-node-hid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ TransportNodeHid.create().then(transport => ...)

##### Parameters

- `observer` **Observer&lt;DescriptorEvent&lt;[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>>**
- `observer` **Observer&lt;DescriptorEvent&lt;[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?>>**

Returns **Subscription**

Expand All @@ -75,4 +75,4 @@ if path="" is not provided, the library will take the first device

##### Parameters

- `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
- `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?**
4 changes: 2 additions & 2 deletions packages/hw-transport-node-hid/src/TransportNodeHid.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class TransportNodeHid extends TransportNodeHidNoEvents {
/**
*/
static listen = (
observer: Observer<DescriptorEvent<string>>
observer: Observer<DescriptorEvent<?string>>
): Subscription => {
let unsubscribed = false;
Promise.resolve(getDevices()).then(devices => {
Expand Down Expand Up @@ -112,7 +112,7 @@ export default class TransportNodeHid extends TransportNodeHidNoEvents {
/**
* if path="" is not provided, the library will take the first device
*/
static async open(path: string) {
static open(path: ?string) {
if (path) {
return Promise.resolve(new TransportNodeHid(new HID.HID(path)));
}
Expand Down

0 comments on commit f8ed6fc

Please sign in to comment.