mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 21:40:21 +00:00
[noble] add missing noble.removeListener functions and noble.state variable
This commit is contained in:
committed by
Michal Lower
parent
acc37d8b9d
commit
f8f7d97487
Vendored
+9
@@ -5,6 +5,7 @@
|
||||
// Shantanu Bhadoria <https://github.com/shantanubhadoria>
|
||||
// Luke Libraro <https://github.com/lukel99>
|
||||
// Dan Chao <https://github.com/bioball>
|
||||
// Michal Lower <https://github.com/keton>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -23,6 +24,14 @@ export declare function on(event: "scanStart", listener: () => void): events.Eve
|
||||
export declare function on(event: "scanStop", listener: () => void): events.EventEmitter;
|
||||
export declare function on(event: "discover", listener: (peripheral: Peripheral) => void): events.EventEmitter;
|
||||
|
||||
export declare function removeListener(event: string, listener: Function): events.EventEmitter;
|
||||
export declare function removeListener(event: "stateChange", listener: (state: string) => void): events.EventEmitter;
|
||||
export declare function removeListener(event: "scanStart", listener: () => void): events.EventEmitter;
|
||||
export declare function removeListener(event: "scanStop", listener: () => void): events.EventEmitter;
|
||||
export declare function removeListener(event: "discover", listener: (peripheral: Peripheral) => void): events.EventEmitter;
|
||||
|
||||
export declare var state:string;
|
||||
|
||||
export declare class Peripheral extends events.EventEmitter {
|
||||
id: string;
|
||||
uuid: string;
|
||||
|
||||
@@ -27,6 +27,14 @@ noble.on("discover", (peripheral: noble.Peripheral): void => {
|
||||
peripheral.disconnect((): void => {});
|
||||
});
|
||||
|
||||
noble.removeListener("stateChange", (state: string): void => {});
|
||||
noble.removeListener("scanStart", (): void => {});
|
||||
noble.removeListener("scanStop", (): void => {});
|
||||
noble.removeListener("discover", (peripheral: noble.Peripheral): void => {
|
||||
peripheral.connect((error: string): void => {});
|
||||
peripheral.disconnect((): void => {});
|
||||
});
|
||||
|
||||
var peripheral: noble.Peripheral = new noble.Peripheral();
|
||||
peripheral.uuid = "12ad4e81";
|
||||
peripheral.advertisement = {
|
||||
|
||||
Reference in New Issue
Block a user