mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Added noble callback function signatures
This commit is contained in:
Vendored
+8
-1
@@ -1,6 +1,9 @@
|
||||
// Type definitions for noble
|
||||
// Project: https://github.com/sandeepmistry/noble
|
||||
// Definitions by: Seon-Wook Park <https://github.com/swook>, Hans Bakker <https://github.com/wind-rider>, Shantanu Bhadoria <https://github.com/shantanubhadoria>
|
||||
// Definitions by: Seon-Wook Park <https://github.com/swook>
|
||||
// Hans Bakker <https://github.com/wind-rider>
|
||||
// Shantanu Bhadoria <https://github.com/shantanubhadoria>
|
||||
// Luke Libraro <https://github.com/lukel99>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -9,9 +12,13 @@
|
||||
import events = require("events");
|
||||
|
||||
export declare function startScanning(): void;
|
||||
export declare function startScanning(callback: Function): void;
|
||||
export declare function startScanning(serviceUUIDs: string[]): void;
|
||||
export declare function startScanning(serviceUUIDs: string[], callback: Function): void;
|
||||
export declare function startScanning(serviceUUIDs: string[], allowDuplicates: boolean): void;
|
||||
export declare function startScanning(serviceUUIDs: string[], allowDuplicates: boolean, callback: Function): void;
|
||||
export declare function stopScanning(): void;
|
||||
export declare function stopScanning(callback: Function): void;
|
||||
|
||||
export declare function on(event: string, listener: Function): events.EventEmitter;
|
||||
export declare function on(event: "stateChange", listener: (state: string) => void): events.EventEmitter;
|
||||
|
||||
@@ -4,14 +4,18 @@ import noble = require("noble");
|
||||
function test_startScanning(): void {
|
||||
"use strict";
|
||||
noble.startScanning();
|
||||
noble.startScanning(function(err: any) {});
|
||||
noble.startScanning(["0x180d"]);
|
||||
noble.startScanning(["0x180d"], function(err: any) {});
|
||||
noble.startScanning(["0x180d"], true);
|
||||
noble.startScanning(["0x180d"], true, function(err: any) {});
|
||||
}
|
||||
test_startScanning();
|
||||
|
||||
function test_stopScanning(): void {
|
||||
"use strict";
|
||||
noble.stopScanning();
|
||||
noble.stopScanning(function(err: any) {});
|
||||
}
|
||||
test_stopScanning();
|
||||
|
||||
|
||||
@@ -19,4 +19,4 @@
|
||||
"index.d.ts",
|
||||
"noble-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user