diff --git a/types/noble/index.d.ts b/types/noble/index.d.ts index 4f2b5f0b7c..d62b0609a8 100644 --- a/types/noble/index.d.ts +++ b/types/noble/index.d.ts @@ -4,6 +4,7 @@ // Hans Bakker // Shantanu Bhadoria // Luke Libraro +// Dan Chao // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -88,6 +89,8 @@ export declare class Characteristic extends events.EventEmitter { notify(notify: boolean, callback?: (error: string) => void): void; discoverDescriptors(callback?: (error: string, descriptors: Descriptor[]) => void): void; toString(): string; + subscribe(callback?: (error: string) => void): void; + unsubscribe(callback?: (error: string) => void): void; on(event: string, listener: Function): this; on(event: string, option: boolean, listener: Function): this; diff --git a/types/noble/noble-tests.ts b/types/noble/noble-tests.ts index baa65c5662..c790f2deb0 100644 --- a/types/noble/noble-tests.ts +++ b/types/noble/noble-tests.ts @@ -87,6 +87,10 @@ characteristic.on("write", true, (error: string): void => {}); characteristic.on("broadcast", (state: string): void => {}); characteristic.on("notify", (state: string): void => {}); characteristic.on("descriptorsDiscover", (descriptors: noble.Descriptor[]): void => {}); +characteristic.subscribe(); +characteristic.subscribe((error: string) => {}); +characteristic.unsubscribe(); +characteristic.unsubscribe((error: string) => {}); var descriptor: noble.Descriptor = new noble.Descriptor(); descriptor.uuid = "";