refactor(bluetoothSerial):

This commit is contained in:
Guille 2016-07-08 00:39:05 +02:00
parent ca845d6b98
commit a0529ef0ed

View File

@ -1,5 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
import {Observable} from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
/** /**
* @name Bluetooth Serial * @name Bluetooth Serial
@ -42,7 +42,7 @@ export class BluetoothSerial {
observable: true, observable: true,
clearFunction: 'disconnect' 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 * Connect insecurely to a Bluetooth device
@ -54,7 +54,7 @@ export class BluetoothSerial {
observable: true, observable: true,
clearFunction: 'disconnect' clearFunction: 'disconnect'
}) })
static connectInsecure (macAddress: string): Observable<any> {return; } static connectInsecure(macAddress: string): Observable<any> { return; }
/** /**
* Writes data to the serial port * Writes data to the serial port
@ -64,7 +64,7 @@ export class BluetoothSerial {
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] 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 * Gets the number of bytes of data available
@ -72,7 +72,7 @@ export class BluetoothSerial {
*/ */
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] platforms: ['Android', 'iOS', 'Windows Phone']
}) static available (): Promise<any> {return; } }) static available(): Promise<any> { return; }
/** /**
* Reads data from the buffer * Reads data from the buffer
@ -81,7 +81,7 @@ export class BluetoothSerial {
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] 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 * Reads data from the buffer until it reaches a delimiter
@ -91,7 +91,7 @@ export class BluetoothSerial {
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] 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 * Subscribe to be notified when data is received
@ -103,7 +103,7 @@ export class BluetoothSerial {
observable: true, observable: true,
clearFunction: 'unsubscribe' clearFunction: 'unsubscribe'
}) })
static subscribe (delimiter: string): Observable<any> {return; } static subscribe(delimiter: string): Observable<any> { return; }
/** /**
* Subscribe to be notified when data is received * Subscribe to be notified when data is received
@ -114,7 +114,7 @@ export class BluetoothSerial {
observable: true, observable: true,
clearFunction: 'unsubscribeRawData' clearFunction: 'unsubscribeRawData'
}) })
static subscribeRawData (): Observable<any> {return; } static subscribeRawData(): Observable<any> { return; }
/** /**
* Clears data in buffer * Clears data in buffer
@ -123,7 +123,7 @@ export class BluetoothSerial {
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] platforms: ['Android', 'iOS', 'Windows Phone']
}) })
static clear (): Promise<any> {return; } static clear(): Promise<any> { return; }
/** /**
* Lists bonded devices * Lists bonded devices
@ -132,7 +132,7 @@ export class BluetoothSerial {
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] platforms: ['Android', 'iOS', 'Windows Phone']
}) })
static list (): Promise<any> {return; } static list(): Promise<any> { return; }
/** /**
* Reports if bluetooth is enabled * Reports if bluetooth is enabled
@ -141,7 +141,7 @@ export class BluetoothSerial {
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] platforms: ['Android', 'iOS', 'Windows Phone']
}) })
static isEnabled (): Promise<any> {return; } static isEnabled(): Promise<any> { return; }
/** /**
* Reports the connection status * Reports the connection status
@ -150,7 +150,7 @@ export class BluetoothSerial {
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] platforms: ['Android', 'iOS', 'Windows Phone']
}) })
static isConnected (): Promise<any> {return; } static isConnected(): Promise<any> { return; }
/** /**
* Reads the RSSI from the connected peripheral * Reads the RSSI from the connected peripheral
@ -159,7 +159,7 @@ export class BluetoothSerial {
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] platforms: ['Android', 'iOS', 'Windows Phone']
}) })
static readRSSI (): Promise<any> {return; } static readRSSI(): Promise<any> { return; }
/** /**
* Show the Bluetooth settings on the device * Show the Bluetooth settings on the device
@ -168,7 +168,7 @@ export class BluetoothSerial {
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] platforms: ['Android', 'iOS', 'Windows Phone']
}) })
static showBluetoothSettings (): Promise<any> {return; } static showBluetoothSettings(): Promise<any> { return; }
/** /**
* Enable Bluetooth on the device * Enable Bluetooth on the device
@ -177,7 +177,7 @@ export class BluetoothSerial {
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] platforms: ['Android', 'iOS', 'Windows Phone']
}) })
static enable (): Promise<any> {return; } static enable(): Promise<any> { return; }
/** /**
* Discover unpaired devices * Discover unpaired devices
@ -186,7 +186,7 @@ export class BluetoothSerial {
@Cordova({ @Cordova({
platforms: ['Android', 'iOS', 'Windows Phone'] 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. * 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, observable: true,
clearFunction: 'clearDeviceDiscoveredListener' clearFunction: 'clearDeviceDiscoveredListener'
}) })
static setDeviceDiscoveredListener (): Observable<any> {return; } static setDeviceDiscoveredListener(): Observable<any> { return; }
/** /**
* Sets the human readable device name that is broadcasted to other devices * Sets the human readable device name that is broadcasted to other devices
@ -207,7 +207,7 @@ export class BluetoothSerial {
platforms: ['Android'], platforms: ['Android'],
sync: true sync: true
}) })
static setName (newName: string): void {} static setName(newName: string): void { }
/** /**
* Makes the device discoverable by other devices * Makes the device discoverable by other devices
@ -217,5 +217,5 @@ export class BluetoothSerial {
platforms: ['Android'], platforms: ['Android'],
sync: true sync: true
}) })
static setDiscoverable (discoverableDuration: number): void {} static setDiscoverable(discoverableDuration: number): void { }
} }