Added noble callback function signatures

This commit is contained in:
Luke Libraro
2017-06-01 12:25:28 -05:00
parent ea7b301f5d
commit 4d2f91fcce
3 changed files with 13 additions and 2 deletions
+8 -1
View File
@@ -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
View File
@@ -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();
+1 -1
View File
@@ -19,4 +19,4 @@
"index.d.ts",
"noble-tests.ts"
]
}
}