mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-19 16:52:53 +08:00
refactor(bluetoothSerial):
This commit is contained in:
parent
ca845d6b98
commit
a0529ef0ed
@ -1,5 +1,5 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Cordova, Plugin } from './plugin';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
* @name Bluetooth Serial
|
||||
@ -42,7 +42,7 @@ export class BluetoothSerial {
|
||||
observable: true,
|
||||
clearFunction: 'disconnect'
|
||||
})
|
||||
static connect (macAddress_or_uuid: string): Observable<any> {return; }
|
||||
static connect(macAddress_or_uuid: string): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Connect insecurely to a Bluetooth device
|
||||
@ -54,7 +54,7 @@ export class BluetoothSerial {
|
||||
observable: true,
|
||||
clearFunction: 'disconnect'
|
||||
})
|
||||
static connectInsecure (macAddress: string): Observable<any> {return; }
|
||||
static connectInsecure(macAddress: string): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Writes data to the serial port
|
||||
@ -64,7 +64,7 @@ export class BluetoothSerial {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static write (data: any): Promise<any> {return; }
|
||||
static write(data: any): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Gets the number of bytes of data available
|
||||
@ -72,7 +72,7 @@ export class BluetoothSerial {
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
}) static available (): Promise<any> {return; }
|
||||
}) static available(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Reads data from the buffer
|
||||
@ -81,7 +81,7 @@ export class BluetoothSerial {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static read (): Promise<any> {return; }
|
||||
static read(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Reads data from the buffer until it reaches a delimiter
|
||||
@ -91,7 +91,7 @@ export class BluetoothSerial {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static readUntil (delimiter: string): Promise<any> {return; }
|
||||
static readUntil(delimiter: string): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Subscribe to be notified when data is received
|
||||
@ -103,7 +103,7 @@ export class BluetoothSerial {
|
||||
observable: true,
|
||||
clearFunction: 'unsubscribe'
|
||||
})
|
||||
static subscribe (delimiter: string): Observable<any> {return; }
|
||||
static subscribe(delimiter: string): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Subscribe to be notified when data is received
|
||||
@ -114,7 +114,7 @@ export class BluetoothSerial {
|
||||
observable: true,
|
||||
clearFunction: 'unsubscribeRawData'
|
||||
})
|
||||
static subscribeRawData (): Observable<any> {return; }
|
||||
static subscribeRawData(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Clears data in buffer
|
||||
@ -123,7 +123,7 @@ export class BluetoothSerial {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static clear (): Promise<any> {return; }
|
||||
static clear(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Lists bonded devices
|
||||
@ -132,7 +132,7 @@ export class BluetoothSerial {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static list (): Promise<any> {return; }
|
||||
static list(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Reports if bluetooth is enabled
|
||||
@ -141,7 +141,7 @@ export class BluetoothSerial {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static isEnabled (): Promise<any> {return; }
|
||||
static isEnabled(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Reports the connection status
|
||||
@ -150,7 +150,7 @@ export class BluetoothSerial {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static isConnected (): Promise<any> {return; }
|
||||
static isConnected(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Reads the RSSI from the connected peripheral
|
||||
@ -159,7 +159,7 @@ export class BluetoothSerial {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static readRSSI (): Promise<any> {return; }
|
||||
static readRSSI(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Show the Bluetooth settings on the device
|
||||
@ -168,7 +168,7 @@ export class BluetoothSerial {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static showBluetoothSettings (): Promise<any> {return; }
|
||||
static showBluetoothSettings(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Enable Bluetooth on the device
|
||||
@ -177,7 +177,7 @@ export class BluetoothSerial {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static enable (): Promise<any> {return; }
|
||||
static enable(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Discover unpaired devices
|
||||
@ -186,7 +186,7 @@ export class BluetoothSerial {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
static discoverUnpaired (): Promise<any> {return; }
|
||||
static discoverUnpaired(): Promise<any> { return; }
|
||||
|
||||
/**
|
||||
* Subscribe to be notified on Bluetooth device discovery. Discovery process must be initiated with the `discoverUnpaired` function.
|
||||
@ -197,7 +197,7 @@ export class BluetoothSerial {
|
||||
observable: true,
|
||||
clearFunction: 'clearDeviceDiscoveredListener'
|
||||
})
|
||||
static setDeviceDiscoveredListener (): Observable<any> {return; }
|
||||
static setDeviceDiscoveredListener(): Observable<any> { return; }
|
||||
|
||||
/**
|
||||
* Sets the human readable device name that is broadcasted to other devices
|
||||
@ -207,7 +207,7 @@ export class BluetoothSerial {
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
static setName (newName: string): void {}
|
||||
static setName(newName: string): void { }
|
||||
|
||||
/**
|
||||
* Makes the device discoverable by other devices
|
||||
@ -217,5 +217,5 @@ export class BluetoothSerial {
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
static setDiscoverable (discoverableDuration: number): void {}
|
||||
static setDiscoverable(discoverableDuration: number): void { }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user