Merge pull request #16532 from yaeda/update-noble

[types/noble] Add global namespace and option to some apis
This commit is contained in:
Nathan Shively-Sanders
2017-06-01 15:31:28 -07:00
committed by GitHub
2 changed files with 6 additions and 4 deletions

View File

@@ -8,10 +8,10 @@
import events = require("events");
export declare function startScanning(): void;
export declare function startScanning(serviceUUIDs: string[]): void;
export declare function startScanning(serviceUUIDs: string[], allowDuplicates: boolean): void;
export declare function stopScanning(): void;
export as namespace noble;
export declare function startScanning(serviceUUIDs?: string[], allowDuplicates?: boolean, callback?: (error: Error) => void): void;
export declare function stopScanning(callback?: () => void): void;
export declare function on(event: string, listener: Function): events.EventEmitter;
export declare function on(event: "stateChange", listener: (state: string) => void): events.EventEmitter;

View File

@@ -6,12 +6,14 @@ function test_startScanning(): void {
noble.startScanning();
noble.startScanning(["0x180d"]);
noble.startScanning(["0x180d"], true);
noble.startScanning(["0x180d"], true, (error: Error): void => {});
}
test_startScanning();
function test_stopScanning(): void {
"use strict";
noble.stopScanning();
noble.stopScanning((): void => {});
}
test_stopScanning();