mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-04-13 00:00:10 +08:00
Merge in v5 code
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
/**
|
||||
@@ -50,7 +50,9 @@ export class BluetoothSerial extends IonicNativePlugin {
|
||||
observable: true,
|
||||
clearFunction: 'disconnect'
|
||||
})
|
||||
connect(macAddress_or_uuid: string): Observable<any> { return; }
|
||||
connect(macAddress_or_uuid: string): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Connect insecurely to a Bluetooth device
|
||||
@@ -62,14 +64,18 @@ export class BluetoothSerial extends IonicNativePlugin {
|
||||
observable: true,
|
||||
clearFunction: 'disconnect'
|
||||
})
|
||||
connectInsecure(macAddress: string): Observable<any> { return; }
|
||||
connectInsecure(macAddress: string): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disconnect from the connected device
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
disconnect(): Promise<any> { return; }
|
||||
disconnect(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes data to the serial port
|
||||
@@ -79,7 +85,9 @@ export class BluetoothSerial extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
write(data: any): Promise<any> { return; }
|
||||
write(data: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the number of bytes of data available
|
||||
@@ -87,7 +95,10 @@ export class BluetoothSerial extends IonicNativePlugin {
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
}) available(): Promise<any> { return; }
|
||||
})
|
||||
available(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads data from the buffer
|
||||
@@ -96,7 +107,9 @@ export class BluetoothSerial extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
read(): Promise<any> { return; }
|
||||
read(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads data from the buffer until it reaches a delimiter
|
||||
@@ -106,7 +119,9 @@ export class BluetoothSerial extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
readUntil(delimiter: string): Promise<any> { return; }
|
||||
readUntil(delimiter: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to be notified when data is received
|
||||
@@ -118,7 +133,9 @@ export class BluetoothSerial extends IonicNativePlugin {
|
||||
observable: true,
|
||||
clearFunction: 'unsubscribe'
|
||||
})
|
||||
subscribe(delimiter: string): Observable<any> { return; }
|
||||
subscribe(delimiter: string): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to be notified when data is received
|
||||
@@ -129,7 +146,9 @@ export class BluetoothSerial extends IonicNativePlugin {
|
||||
observable: true,
|
||||
clearFunction: 'unsubscribeRawData'
|
||||
})
|
||||
subscribeRawData(): Observable<any> { return; }
|
||||
subscribeRawData(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears data in buffer
|
||||
@@ -138,7 +157,9 @@ export class BluetoothSerial extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
clear(): Promise<any> { return; }
|
||||
clear(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists bonded devices
|
||||
@@ -147,7 +168,9 @@ export class BluetoothSerial extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
list(): Promise<any> { return; }
|
||||
list(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reports if bluetooth is enabled
|
||||
@@ -156,7 +179,9 @@ export class BluetoothSerial extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
isEnabled(): Promise<any> { return; }
|
||||
isEnabled(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reports the connection status
|
||||
@@ -165,7 +190,9 @@ export class BluetoothSerial extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
isConnected(): Promise<any> { return; }
|
||||
isConnected(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads the RSSI from the connected peripheral
|
||||
@@ -174,7 +201,9 @@ export class BluetoothSerial extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
readRSSI(): Promise<any> { return; }
|
||||
readRSSI(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the Bluetooth settings on the device
|
||||
@@ -183,7 +212,9 @@ export class BluetoothSerial extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
showBluetoothSettings(): Promise<any> { return; }
|
||||
showBluetoothSettings(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable Bluetooth on the device
|
||||
@@ -192,7 +223,9 @@ export class BluetoothSerial extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
enable(): Promise<any> { return; }
|
||||
enable(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Discover unpaired devices
|
||||
@@ -201,7 +234,9 @@ export class BluetoothSerial extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS', 'Windows Phone']
|
||||
})
|
||||
discoverUnpaired(): Promise<any> { return; }
|
||||
discoverUnpaired(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to be notified on Bluetooth device discovery. Discovery process must be initiated with the `discoverUnpaired` function.
|
||||
@@ -212,7 +247,9 @@ export class BluetoothSerial extends IonicNativePlugin {
|
||||
observable: true,
|
||||
clearFunction: 'clearDeviceDiscoveredListener'
|
||||
})
|
||||
setDeviceDiscoveredListener(): Observable<any> { return; }
|
||||
setDeviceDiscoveredListener(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the human readable device name that is broadcasted to other devices
|
||||
@@ -222,7 +259,8 @@ export class BluetoothSerial extends IonicNativePlugin {
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
setName(newName: string): void { }
|
||||
setName(newName: string): void {
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes the device discoverable by other devices
|
||||
@@ -232,6 +270,7 @@ export class BluetoothSerial extends IonicNativePlugin {
|
||||
platforms: ['Android'],
|
||||
sync: true
|
||||
})
|
||||
setDiscoverable(discoverableDuration: number): void { }
|
||||
setDiscoverable(discoverableDuration: number): void {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user