Have this method in a Protractor
page object test:
public navigateTo = (): Promise<any> => {
return browser.get('https://material.angular.io/');
};
Want to define the type that is returned i.e. Promise<any>
.
Should I import the jasmine
promise? Or the webdriver
promise?
import * as webdriver from "selenium-webdriver";
import Promise = webdriver.promise.Promise;
or
import Promise = jasmine.Promise;
I'm confused about why I need to specify an implementation of promise. Can I specify an interface for Promise
?
edit: What I really wanted to do was:
npm install --save-dev @types/es6-promise
This gave me the Promise<any>
type.
Relevant Question: How to use Typescript with native ES6 Promises