Skip to content

Commit 6fca112

Browse files
authored
Merge pull request #463 from TheBosZ/master
Update type definitions
2 parents adc8feb + 1aa92d6 commit 6fca112

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

types/index.d.ts

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ declare namespace BluetoothlePlugin {
77
*
88
*/
99
initialize(
10-
initializeResult:(result: { status: boolean }) => void,
10+
initializeResult:(result: { status: 'enabled' | 'disabled' }) => void,
1111
params?: InitParams): void;
1212

1313
/**
@@ -275,7 +275,7 @@ declare namespace BluetoothlePlugin {
275275
*
276276
*/
277277
readDescriptor(
278-
readDescriptorSuccess: (descriptor: Descriptor) => void,
278+
readDescriptorSuccess: (descriptor: DescriptorResult) => void,
279279
readDescriptorError: (error: Error) => void,
280280
params: OperationDescriptorParams): void;
281281

@@ -288,7 +288,7 @@ declare namespace BluetoothlePlugin {
288288
*
289289
*/
290290
writeDescriptor(
291-
writeDescriptorSuccess: (descriptor: Descriptor) => void,
291+
writeDescriptorSuccess: (descriptor: DescriptorResult) => void,
292292
writeDescriptorError: (error: Error) => void,
293293
params: WriteDescriptorParams): void;
294294

@@ -571,13 +571,13 @@ declare namespace BluetoothlePlugin {
571571

572572
/* Available status of device */
573573
type Status = "scanStarted" | "scanStopped" | "scanResult" | "connected" | "disconnected"
574-
| "bonding" | "bonded" | "unbonded" | "closed" | "services" | "discovered"
575-
| "characteristics" | "descriptors" | "read" | "subscribed" | "unsubscribed"
576-
| "subscribedResult" | "written" | "readDescriptor" | "writeDescriptor"
577-
| "rssi" | "mtu" | "connectionPriorityRequested" |"enabled" | "disabled"
578-
| "readRequested" | "writeRequested" | "mtuChanged" | "notifyReady" | "notifySent"
579-
| "serviceAdded" | "serviceRemoved" | "allServicesRemoved" | "advertisingStarted"
580-
| "advertisingStopped" | "responded" | "notified";
574+
| "bonding" | "bonded" | "unbonded" | "closed" | "services" | "discovered"
575+
| "characteristics" | "descriptors" | "read" | "subscribed" | "unsubscribed"
576+
| "subscribedResult" | "written" | "readDescriptor" | "writeDescriptor"
577+
| "rssi" | "mtu" | "connectionPriorityRequested" |"enabled" | "disabled"
578+
| "readRequested" | "writeRequested" | "mtuChanged" | "notifyReady" | "notifySent"
579+
| "serviceAdded" | "serviceRemoved" | "allServicesRemoved" | "advertisingStarted"
580+
| "advertisingStopped" | "responded" | "notified";
581581

582582
/** Avaialable connection priorities */
583583
type ConnectionPriority = "low" | "balanced" | "high";
@@ -771,12 +771,12 @@ declare namespace BluetoothlePlugin {
771771
/** Service's uuid */
772772
uuid: string,
773773
/** Array of characteristics */
774-
characteristics : CharacteristicList[]
774+
characteristics : Characteristic[]
775775
}
776776

777777
interface Characteristic {
778778
/* Array of descriptors */
779-
descriptors?: any,
779+
descriptors?: Descriptor[],
780780
/** Characteristic's uuid */
781781
uuid: string,
782782
/**
@@ -812,17 +812,14 @@ declare namespace BluetoothlePlugin {
812812
writeEncryptionRequired?: boolean
813813
}
814814
}
815-
816-
interface CharacteristicList {
817-
/** Array of cahracteristic objects */
818-
characteristics: Characteristic[],
819-
/** Characteristic's UUID */
820-
uuid: string
815+
816+
interface Descriptor {
817+
uuid: string;
821818
}
822819

823820
interface Device extends DeviceInfo {
824821
/** Device's services */
825-
sercices: Service[]
822+
services: Service[]
826823
}
827824

828825
interface Services extends DeviceInfo {
@@ -855,7 +852,7 @@ declare namespace BluetoothlePlugin {
855852
service: string,
856853
}
857854

858-
interface Descriptor extends OperationResult {
855+
interface DescriptorResult extends OperationResult {
859856
descriptor: string
860857
}
861858

0 commit comments

Comments
 (0)