diff --git a/types/noble/index.d.ts b/types/noble/index.d.ts index 4e293993f7..94ba4f8922 100644 --- a/types/noble/index.d.ts +++ b/types/noble/index.d.ts @@ -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; diff --git a/types/noble/noble-tests.ts b/types/noble/noble-tests.ts index 9c3f403944..2f985d2888 100644 --- a/types/noble/noble-tests.ts +++ b/types/noble/noble-tests.ts @@ -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();