From f4ce0bb7385792632874db65f1365894be38c55d Mon Sep 17 00:00:00 2001 From: Yash Ladha Date: Thu, 23 Jan 2020 19:02:58 +0530 Subject: [PATCH 1/2] Type fixes for the callback function --- index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 93d3a78..5d07d3a 100644 --- a/index.d.ts +++ b/index.d.ts @@ -20,8 +20,8 @@ declare module 'browserstack-local' { } class Local { - start(options: Partial, callback: () => void): void + start(options: Partial, callback: (error: Error | undefined) => void): void isRunning(): boolean stop(callback: () => void): void } -} \ No newline at end of file +} From 8176750afb2f1dab5b4f393f577bd5fa399395c4 Mon Sep 17 00:00:00 2001 From: Yash Ladha Date: Fri, 24 Jan 2020 10:52:59 +0530 Subject: [PATCH 2/2] Refactored type --- index.d.ts | 42 +++++++++++++++++++++--------------------- package.json | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/index.d.ts b/index.d.ts index 5d07d3a..6f1a3d6 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,27 +1,27 @@ -declare module 'browserstack-local' { +declare module "browserstack-local" { interface Options { - key: string - verbose: boolean - force: boolean - only: string - onlyAutomate: boolean - forceLocal: boolean - localIdentifier: string - folder: string - proxyHost: string - proxyPort: string - proxyUser: string - proxyPass: string - forceProxy: boolean - logFile: string - parallelRuns: string - binarypath: string - [key: string]: string | boolean + key: string; + verbose: boolean; + force: boolean; + only: string; + onlyAutomate: boolean; + forceLocal: boolean; + localIdentifier: string; + folder: string; + proxyHost: string; + proxyPort: string; + proxyUser: string; + proxyPass: string; + forceProxy: boolean; + logFile: string; + parallelRuns: string; + binarypath: string; + [key: string]: string | boolean; } class Local { - start(options: Partial, callback: (error: Error | undefined) => void): void - isRunning(): boolean - stop(callback: () => void): void + start(options: Partial, callback: (error?: Error) => void): void; + isRunning(): boolean; + stop(callback: () => void): void; } } diff --git a/package.json b/package.json index 8161273..ded8400 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "browserstack-local", - "version": "1.4.4", + "version": "1.4.5", "description": "Nodejs bindings for BrowserStack Local", "engine": "^0.10.44", "main": "index.js",