diff --git a/types/noble/index.d.ts b/types/noble/index.d.ts index 4e293993f7..e5fa57caa8 100644 --- a/types/noble/index.d.ts +++ b/types/noble/index.d.ts @@ -1,6 +1,9 @@ // Type definitions for noble // Project: https://github.com/sandeepmistry/noble -// Definitions by: Seon-Wook Park , Hans Bakker , Shantanu Bhadoria +// Definitions by: Seon-Wook Park +// Hans Bakker +// Shantanu Bhadoria +// Luke Libraro // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -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; diff --git a/types/noble/noble-tests.ts b/types/noble/noble-tests.ts index 9c3f403944..2a2324fd33 100644 --- a/types/noble/noble-tests.ts +++ b/types/noble/noble-tests.ts @@ -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(); diff --git a/types/noble/tsconfig.json b/types/noble/tsconfig.json index 5821c4f99e..9b75c82d95 100644 --- a/types/noble/tsconfig.json +++ b/types/noble/tsconfig.json @@ -19,4 +19,4 @@ "index.d.ts", "noble-tests.ts" ] -} \ No newline at end of file +}