Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
fix(element): Fix typing of ElementFinder.then
Browse files Browse the repository at this point in the history
  • Loading branch information
massimocode committed Dec 16, 2016
1 parent 76cb4b4 commit 6a59293
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,9 @@ export class ElementArrayFinder extends WebdriverWebElement {
export class ElementFinder extends WebdriverWebElement {
parentElementArrayFinder: ElementArrayFinder;
elementArrayFinder_: ElementArrayFinder;
then: (fn: Function, errorFn?: Function) => wdpromise.Promise<any> = null;
then?:
(fn: (value: any) => any | wdpromise.IThenable<any>,
errorFn?: (error: any) => any) => wdpromise.Promise<any> = null;

constructor(public browser_: ProtractorBrowser, elementArrayFinder: ElementArrayFinder) {
super();
Expand All @@ -806,7 +808,7 @@ export class ElementFinder extends WebdriverWebElement {
if (this.parentElementArrayFinder.actionResults_) {
// Access the underlying actionResult of ElementFinder.
this.then =
(fn: (value: any) => {} | wdpromise.IThenable<{}>, errorFn?: (error: any) => any) => {
(fn: (value: any) => any | wdpromise.IThenable<any>, errorFn?: (error: any) => any) => {
return this.elementArrayFinder_.then((actionResults: any) => {
if (!fn) {
return actionResults[0];
Expand Down

0 comments on commit 6a59293

Please sign in to comment.