Skip to content

Commit

Permalink
fix(bluetooth-le): use correct return types (#4411)
Browse files Browse the repository at this point in the history
  • Loading branch information
NunoSav committed Nov 4, 2022
1 parent ef499ed commit 2d347e4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/@awesome-cordova-plugins/plugins/bluetooth-le/index.ts
Expand Up @@ -535,10 +535,10 @@ export class BluetoothLE extends AwesomeCordovaNativePlugin {
* Retrieved paired Bluetooth LE devices. In iOS, devices that are "paired" to will not return during a normal scan.
* Callback is "instant" compared to a scan.
* @param {{ services: string[] }} An array of service IDs to filter the retrieval by. If no service IDs are specified, no devices will be returned.
* @returns {Promise<{ devices: DeviceInfo[] }>}
* @returns {Promise<DeviceInfo[]>}
*/
@Cordova({ callbackOrder: 'reverse' })
retrieveConnected(params?: { services?: string[] }): Promise<{ devices: DeviceInfo[] }> {
retrieveConnected(params?: { services?: string[] }): Promise<DeviceInfo[]> {
return;
}

Expand All @@ -548,7 +548,7 @@ export class BluetoothLE extends AwesomeCordovaNativePlugin {
* Bond with a device.
* The device doesn't need to be connected to initiate bonding. Android support only.
* @param {{ address: string }} params The address/identifier provided by the scan's return object
* @returns {(Observable<{ status: DeviceInfo }>)}
* @returns {(Observable<DeviceInfo>)}
* success:
* The first success callback should always return with status == bonding.
* If the bond is created, the callback will return again with status == bonded.
Expand All @@ -557,7 +557,7 @@ export class BluetoothLE extends AwesomeCordovaNativePlugin {
* The callback that will be triggered when the bond operation fails
*/
@Cordova({ callbackOrder: 'reverse', observable: true })
bond(params: { address: string }): Observable<{ status: DeviceInfo }> {
bond(params: { address: string }): Observable<DeviceInfo> {
return;
}

Expand All @@ -566,12 +566,12 @@ export class BluetoothLE extends AwesomeCordovaNativePlugin {
* @param params.address
* Unbond with a device. The device doesn't need to be connected to initiate bonding. Android support only.
* @param {{address: string}} params The address/identifier
* @returns {Promise<{ status: DeviceInfo }>}
* @returns {Promise<DeviceInfo>}
* success: The success callback should always return with status == unbonded, that is passed with device object
* error: The callback that will be triggered when the unbond operation fails
*/
@Cordova({ callbackOrder: 'reverse' })
unbond(params: { address: string }): Promise<{ status: DeviceInfo }> {
unbond(params: { address: string }): Promise<DeviceInfo> {
return;
}

Expand All @@ -582,7 +582,7 @@ export class BluetoothLE extends AwesomeCordovaNativePlugin {
* @param connectError The callback that will be triggered when the connect operation fails
* @param params The connection params
* @param {ConnectionParams} params
* @returns {(Observable<{ status: DeviceInfo }>)}
* @returns {(Observable<DeviceInfo>)}
* success: device object with status
* error: The callback that will be triggered when the unbond operation fails
*/
Expand Down Expand Up @@ -670,21 +670,21 @@ export class BluetoothLE extends AwesomeCordovaNativePlugin {
* Discover the service's characteristics.
* Not providing an array of characteristics will return all characteristics and take longer to discover. iOS support only.
* @param {CharacteristicParams} params Characteristic params
* @returns {Promise<{ characteristics: Characteristics }>} The service id and an Array of characteristics
* @returns {Promise<Characteristics>} The service id and an Array of characteristics
*/
@Cordova({ callbackOrder: 'reverse' })
characteristics(params: CharacteristicParams): Promise<{ characteristics: Characteristics }> {
characteristics(params: CharacteristicParams): Promise<Characteristics> {
return;
}

/**
* @name descriptors (iOS)
* Discover the characteristic's descriptors. iOS support only.
* @param {DescriptorParams} params
* @returns {Promise<{ descriptors: Descriptors }>}
* @returns {Promise<Descriptors>}
*/
@Cordova({ callbackOrder: 'reverse' })
descriptors(params: DescriptorParams): Promise<{ descriptors: Descriptors }> {
descriptors(params: DescriptorParams): Promise<Descriptors> {
return;
}

Expand Down

0 comments on commit 2d347e4

Please sign in to comment.