From 3da30f09115a591f71d71f5fc4f1f71c696c102d Mon Sep 17 00:00:00 2001 From: Luke Libraro Date: Thu, 1 Jun 2017 13:02:20 -0500 Subject: [PATCH] changes based on feedback --- types/noble/index.d.ts | 12 ++++-------- types/noble/noble-tests.ts | 8 ++++---- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/types/noble/index.d.ts b/types/noble/index.d.ts index e5fa57caa8..4f2b5f0b7c 100644 --- a/types/noble/index.d.ts +++ b/types/noble/index.d.ts @@ -11,14 +11,10 @@ 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 startScanning(callback?: (error?: Error) => void): void; +export declare function startScanning(serviceUUIDs: string[], callback?: (error?: Error) => void): void; +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 2a2324fd33..5cba50632a 100644 --- a/types/noble/noble-tests.ts +++ b/types/noble/noble-tests.ts @@ -4,18 +4,18 @@ import noble = require("noble"); function test_startScanning(): void { "use strict"; noble.startScanning(); - noble.startScanning(function(err: any) {}); + noble.startScanning((err: Error) => {}); noble.startScanning(["0x180d"]); - noble.startScanning(["0x180d"], function(err: any) {}); + noble.startScanning(["0x180d"], (err: Error) => {}); noble.startScanning(["0x180d"], true); - noble.startScanning(["0x180d"], true, function(err: any) {}); + noble.startScanning(["0x180d"], true, (err: Error) => {}); } test_startScanning(); function test_stopScanning(): void { "use strict"; noble.stopScanning(); - noble.stopScanning(function(err: any) {}); + noble.stopScanning(() => {}); } test_stopScanning();