File tree 1 file changed +9
-10
lines changed
1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -21,22 +21,21 @@ export type TPeripheral = {
21
21
identifier : string ;
22
22
name : string ;
23
23
} & (
24
- | {
25
- connectionState : 'discovered' | 'connecting' | 'connected' ;
26
- }
27
- | {
28
- connectionState : 'error' ;
29
- connectionError : string ;
30
- }
24
+ {
25
+ connectionState : 'discovered' | 'connecting' | 'connected' ;
26
+ } | {
27
+ connectionState : 'error' ;
28
+ connectionError : string ;
29
+ }
31
30
) ;
32
31
33
- export type TState = {
32
+ type TBluetoothState = {
34
33
bluetoothAvailable : boolean ;
35
34
scanning : boolean ;
36
35
peripherals : TPeripheral [ ] ;
37
36
} ;
38
37
39
- export const getState = ( ) : Promise < TState > => {
38
+ export const getState = ( ) : Promise < TBluetoothState > => {
40
39
return apiGet ( 'bluetooth/state' ) ;
41
40
} ;
42
41
@@ -45,7 +44,7 @@ export const connect = (identifier: string): Promise<void> => {
45
44
} ;
46
45
47
46
export const syncState = (
48
- cb : ( state : TState ) => void
47
+ cb : ( state : TBluetoothState ) => void
49
48
) : TUnsubscribe => {
50
49
return subscribeEndpoint ( 'bluetooth/state' , cb ) ;
51
50
} ;
You can’t perform that action at this time.
0 commit comments