From 65701d7b2b3d60b309a7acd2fda6c10d2a77aec1 Mon Sep 17 00:00:00 2001 From: Pablo Moleri Date: Wed, 18 Jan 2017 14:03:23 -0300 Subject: [PATCH 1/2] Fix getLocation return type Also renamed GeoLocation type because it was being merged with Location type. --- webdriverio/index.d.ts | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/webdriverio/index.d.ts b/webdriverio/index.d.ts index fbc6925fa9..f033ec2bfc 100644 --- a/webdriverio/index.d.ts +++ b/webdriverio/index.d.ts @@ -352,36 +352,37 @@ declare namespace WebdriverIO { ): Client

; getHTML

(includeSelectorTag: boolean): Client

; - getLocation(selector?: string): Size; - getLocation(selector: string, axis: string): number; - getLocation(axis: string): number; + getLocation(selector?: string): Location; + getLocation(selector: string, axis: Axis): number; + getLocation(axis: Axis): number; getLocation

(selector?: string): Client

; getLocation

( selector: string, - axis: string + axis: Axis ): Client

; - getLocation

(axis: string): Client

; + getLocation

(axis: Axis): Client

; - getLocationInView(selector: string): Size; - getLocationInView(selector: string): Size[]; - getLocationInView(): Size; - getLocationInView(): Size[]; + getLocationInView(selector: string): Location; + getLocationInView(selector: string): Location[]; + getLocationInView(): Location; + getLocationInView(): Location[]; getLocationInView( selector: string, - axis: string + axis: Axis ): number; getLocationInView( selector: string, - axis: string + axis: Axis ): number[]; - getLocationInView(axis: string): number; - getLocationInView(axis: string): number[]; + getLocationInView(axis: Axis): number; + getLocationInView(axis: Axis): number[]; getLocationInView

(selector?: string): Client

; getLocationInView

( selector: string, - axis: string + axis: Axis ): Client

; - getLocationInView

(axis: string): Client

; + getLocationInView

(axis: Axis): Client

; + getSource(): Client; getSource

(): Client

; @@ -428,7 +429,7 @@ declare namespace WebdriverIO { value: any; } - export interface Location { + export interface GeoLocation { latitude: number; longitude: number; altitude: number; @@ -983,6 +984,8 @@ declare namespace WebdriverIO { switchTab

(windowHandle?: string): Client

; } + export type Axis = "x" | "y"; + export interface Options { protocol: string; waitforTimeout: number; From b2af2d23e5c0ff1f2e74390f6d93752a6631d594 Mon Sep 17 00:00:00 2001 From: Pablo Moleri Date: Wed, 25 Jan 2017 10:29:43 -0300 Subject: [PATCH 2/2] Move getLocation "Axis" overloads before string ones --- webdriverio/index.d.ts | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/webdriverio/index.d.ts b/webdriverio/index.d.ts index f033ec2bfc..b79b17e98d 100644 --- a/webdriverio/index.d.ts +++ b/webdriverio/index.d.ts @@ -352,37 +352,22 @@ declare namespace WebdriverIO { ): Client

; getHTML

(includeSelectorTag: boolean): Client

; - getLocation(selector?: string): Location; - getLocation(selector: string, axis: Axis): number; getLocation(axis: Axis): number; - getLocation

(selector?: string): Client

; - getLocation

( - selector: string, - axis: Axis - ): Client

; getLocation

(axis: Axis): Client

; + getLocation(selector?: string): Location; + getLocation

(selector?: string): Client

; + getLocation(selector: string, axis: Axis): number; + getLocation

(selector: string, axis: Axis): Client

; - getLocationInView(selector: string): Location; - getLocationInView(selector: string): Location[]; - getLocationInView(): Location; - getLocationInView(): Location[]; - getLocationInView( - selector: string, - axis: Axis - ): number; - getLocationInView( - selector: string, - axis: Axis - ): number[]; getLocationInView(axis: Axis): number; getLocationInView(axis: Axis): number[]; - getLocationInView

(selector?: string): Client

; - getLocationInView

( - selector: string, - axis: Axis - ): Client

; getLocationInView

(axis: Axis): Client

; - + getLocationInView(selector?: string): Location; + getLocationInView(selector?: string): Location[]; + getLocationInView

(selector?: string): Client

; + getLocationInView(selector: string, axis: Axis): number; + getLocationInView(selector: string, axis: Axis): number[]; + getLocationInView

(selector: string, axis: Axis): Client

; getSource(): Client; getSource

(): Client

;