mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-05-02 00:07:23 +08:00
chore(): cleanup return values
Addresses https://github.com/driftyco/ionic-native/issues/38.
This commit is contained in:
+36
-112
@@ -181,14 +181,7 @@ export class BLE {
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
static scan(services:string[], seconds:number) {
|
||||
// This Observable is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Observable, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Observable<any>(observer => {});
|
||||
}
|
||||
static scan(services: string[], seconds: number): Observable<any> { return }
|
||||
|
||||
/**
|
||||
* Scan and discover BLE peripherals until `stopScan` is called.
|
||||
@@ -211,14 +204,7 @@ export class BLE {
|
||||
clearFunction: 'stopScan',
|
||||
clearWithArgs: true
|
||||
})
|
||||
static startScan(services:string[]){
|
||||
// This Observable is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Observable, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Observable<any>(observer => {});
|
||||
};
|
||||
static startScan(services: string[]): Observable<any> { return }
|
||||
|
||||
/**
|
||||
* Stop a scan started by `startScan`.
|
||||
@@ -235,14 +221,7 @@ export class BLE {
|
||||
* @return returns a Promise.
|
||||
*/
|
||||
@Cordova()
|
||||
static stopScan(){
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise<any>((res, rej) => {});
|
||||
};
|
||||
static stopScan(): Promise<any> { return }
|
||||
|
||||
/**
|
||||
* Connect to a peripheral.
|
||||
@@ -263,14 +242,7 @@ export class BLE {
|
||||
clearFunction: 'disconnect',
|
||||
clearWithArgs: true
|
||||
})
|
||||
static connect(deviceId:string){
|
||||
// This Observable is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Observable, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Observable<any>(observer => {});
|
||||
};
|
||||
static connect(deviceId: string): Observable<any> { return }
|
||||
|
||||
/**
|
||||
* Disconnect from a peripheral.
|
||||
@@ -284,14 +256,7 @@ export class BLE {
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
static disconnect(deviceId:string) {
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise<any>((res, rej) => {});
|
||||
};
|
||||
static disconnect(deviceId: string): Promise<any> { return }
|
||||
|
||||
/**
|
||||
* Read the value of a characteristic.
|
||||
@@ -302,14 +267,11 @@ export class BLE {
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
static read(deviceId:string, serviceUUID:string, characteristicUUID:string){
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise<any>((res, rej) => {});
|
||||
};
|
||||
static read(
|
||||
deviceId: string,
|
||||
serviceUUID: string,
|
||||
characteristicUUID: string
|
||||
): Promise<any> { return };
|
||||
|
||||
/**
|
||||
* Write the value of a characteristic.
|
||||
@@ -340,14 +302,12 @@ export class BLE {
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
static write(deviceId:string, serviceUUID:string, characteristicUUID:string, value:ArrayBuffer){
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise<any>((res, rej) => {});
|
||||
};
|
||||
static write(
|
||||
deviceId: string,
|
||||
serviceUUID: string,
|
||||
characteristicUUID: string,
|
||||
value: ArrayBuffer
|
||||
): Promise<any> { return }
|
||||
|
||||
/**
|
||||
* Write the value of a characteristic without waiting for confirmation from the peripheral.
|
||||
@@ -359,14 +319,12 @@ export class BLE {
|
||||
* @return Returns a Promise
|
||||
*/
|
||||
@Cordova()
|
||||
static writeWithoutResponse(deviceId:string, serviceUUID:string, characteristicUUID:string, value:ArrayBuffer){
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise<any>((res, rej) => {});
|
||||
};
|
||||
static writeWithoutResponse(
|
||||
deviceId: string,
|
||||
serviceUUID: string,
|
||||
characteristicUUID: string,
|
||||
value: ArrayBuffer
|
||||
): Promise<any> { return }
|
||||
|
||||
/**
|
||||
* Register to be notified when the value of a characteristic changes.
|
||||
@@ -388,14 +346,11 @@ export class BLE {
|
||||
clearFunction: 'stopNotification',
|
||||
clearWithArgs: true
|
||||
})
|
||||
static startNotification(deviceId:string, serviceUUID:string, characteristicUUID:string){
|
||||
// This Observable is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Observable, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Observable<any>(observer => {});
|
||||
};
|
||||
static startNotification(
|
||||
deviceId: string,
|
||||
serviceUUID: string,
|
||||
characteristicUUID: string
|
||||
): Observable<any> { return }
|
||||
|
||||
/**
|
||||
* Stop being notified when the value of a characteristic changes.
|
||||
@@ -406,14 +361,11 @@ export class BLE {
|
||||
* @return Returns a Promise.
|
||||
*/
|
||||
@Cordova()
|
||||
static stopNotification(deviceId:string, serviceUUID:string, characteristicUUID:string){
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise<any>((res, rej) => {});
|
||||
};
|
||||
static stopNotification(
|
||||
deviceId: string,
|
||||
serviceUUID: string,
|
||||
characteristicUUID: string
|
||||
): Promise<any> { return }
|
||||
|
||||
/**
|
||||
* Report the connection status.
|
||||
@@ -429,14 +381,7 @@ export class BLE {
|
||||
* @return Returns a Promise.
|
||||
*/
|
||||
@Cordova()
|
||||
static isConnected(deviceId:string){
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise<any>((res, rej) => {});
|
||||
}
|
||||
static isConnected(deviceId: string): Promise<any> { return }
|
||||
|
||||
/**
|
||||
* Report if bluetooth is enabled.
|
||||
@@ -451,14 +396,7 @@ export class BLE {
|
||||
* @return Returns a Promise.
|
||||
*/
|
||||
@Cordova()
|
||||
static isEnabled(){
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise<any>((res, rej) => {});
|
||||
}
|
||||
static isEnabled(): Promise<any> { return }
|
||||
|
||||
/**
|
||||
* Open System Bluetooth settings (Android only).
|
||||
@@ -466,14 +404,7 @@ export class BLE {
|
||||
* @return Returns a Promise.
|
||||
*/
|
||||
@Cordova()
|
||||
static showBluetoothSettings(){
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise<any>((res, rej) => {});
|
||||
}
|
||||
static showBluetoothSettings(): Promise<any> { return }
|
||||
|
||||
/**
|
||||
* Enable Bluetooth on the device (Android only).
|
||||
@@ -481,12 +412,5 @@ export class BLE {
|
||||
* @return Returns a Promise.
|
||||
*/
|
||||
@Cordova()
|
||||
static enable(){
|
||||
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||
// knows that the correct return type is Promise, because there's no way
|
||||
// for it to know the return type from a decorator.
|
||||
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||
return new Promise<any>((res, rej) => {});
|
||||
}
|
||||
static enable(): Promise<any> { return }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user