diff --git a/types/custom-command.d.ts b/types/custom-command.d.ts index 4a03b4905..b36e14f60 100644 --- a/types/custom-command.d.ts +++ b/types/custom-command.d.ts @@ -1,3 +1,7 @@ +import {CommandInstance} from './index'; + +export interface CustomCommandInstance extends CommandInstance {} + export interface NightwatchCustomCommandsModel { /** * Define a custom command diff --git a/types/index.d.ts b/types/index.d.ts index b5addc082..ae6509297 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1221,7 +1221,7 @@ export interface CommandInstance { httpRequest(options: HttpRequestOptions): Promise; toString(): string; - complete(...args: unknown[]): void; // test the args are working fine. + complete(...args: unknown[]): void; } export interface CreateClientParams { diff --git a/types/tests/customCommands.test-d.ts b/types/tests/customCommands.test-d.ts index efc2bec5a..670938479 100644 --- a/types/tests/customCommands.test-d.ts +++ b/types/tests/customCommands.test-d.ts @@ -1,8 +1,8 @@ import {expectType} from 'tsd'; -import {CommandInstance, NightwatchCallbackResult, NightwatchCustomCommandsModel} from '..'; +import {CustomCommandInstance, NightwatchCallbackResult, NightwatchCustomCommandsModel} from '..'; export class AngularCommand implements NightwatchCustomCommandsModel { - async command(this: CommandInstance, listName: string, cb = function(r: T) {return r}) { + async command(this: CustomCommandInstance, listName: string, cb = function(r: T) {return r}) { // Script to be executed in the browser const script = function(listName: string) { // executed in the browser context