mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-13 22:40:50 +08:00
Merge pull request #16532 from yaeda/update-noble
[types/noble] Add global namespace and option to some apis
This commit is contained in:
8
types/noble/index.d.ts
vendored
8
types/noble/index.d.ts
vendored
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user