mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-02 00:00:04 +00:00
Merge pull request #17750 from bioball/fix-noble-typings
noble: add subscribe and unsubscribe methods to peripherals
This commit is contained in:
3
types/noble/index.d.ts
vendored
3
types/noble/index.d.ts
vendored
@@ -4,6 +4,7 @@
|
||||
// Hans Bakker <https://github.com/wind-rider>
|
||||
// Shantanu Bhadoria <https://github.com/shantanubhadoria>
|
||||
// Luke Libraro <https://github.com/lukel99>
|
||||
// Dan Chao <https://github.com/bioball>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -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;
|
||||
|
||||
@@ -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 = "";
|
||||
|
||||
Reference in New Issue
Block a user