Skip to content

Commit

Permalink
fix(types): Fix types for TS 2.0 (angular#4072)
Browse files Browse the repository at this point in the history
  • Loading branch information
heathkit authored Feb 7, 2017
1 parent 3edd62e commit 0ad2381
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/debugger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ export class DebugHelper {
let execFn_ = () => {
// Run code through vm so that we can maintain a local scope which is
// isolated from the rest of the execution.
let res;
let res: wdpromise.Promise<any>;
try {
res = vm_.runInContext(code, sandbox);
} catch (e) {
res = 'Error while evaluating command: ' + e;
res = wdpromise.when('Error while evaluating command: ' + e);
}
if (!wdpromise.isPromise(res)) {
res = wdpromise.when(res);
Expand Down
6 changes: 3 additions & 3 deletions lib/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let clientSideScripts = require('./clientsidescripts');
let logger = new Logger('element');

export class WebdriverWebElement {}
export interface WebdriverWebElement extends WebElement {}
export interface WebdriverWebElement extends WebElement { [key: string]: any; }

let WEB_ELEMENT_FUNCTIONS = [
'click', 'sendKeys', 'getTagName', 'getCssValue', 'getAttribute', 'getText', 'getSize',
Expand Down Expand Up @@ -88,7 +88,7 @@ export class ElementArrayFinder extends WebdriverWebElement {

// TODO(juliemr): might it be easier to combine this with our docs and just
// wrap each one explicity with its own documentation?
WEB_ELEMENT_FUNCTIONS.forEach((fnName: keyof WebdriverWebElement) => {
WEB_ELEMENT_FUNCTIONS.forEach((fnName: string) => {
this[fnName] = (...args: any[]) => {
let actionFn = (webElem: any) => {
return webElem[fnName].apply(webElem, args);
Expand Down Expand Up @@ -867,7 +867,7 @@ export class ElementFinder extends WebdriverWebElement {
this.browser_, getWebElements, elementArrayFinder.locator(),
elementArrayFinder.actionResults_);

WEB_ELEMENT_FUNCTIONS.forEach((fnName: keyof WebdriverWebElement) => {
WEB_ELEMENT_FUNCTIONS.forEach((fnName: string) => {
(this)[fnName] = (...args: any[]) => {
return (this.elementArrayFinder_)[fnName]
.apply(this.elementArrayFinder_, args)
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ export class Plugins {
*/
private safeCallPluginFun(
pluginObj: ProtractorPlugin, funName: string, args: any[], promiseType: PromiseType,
failReturnVal: any) {
failReturnVal: any): q.Promise<any>|Promise<any>|webdriver.promise.Promise<any> {
const resolver = (done: (result: any) => void) => {
const logError = (e: any) => {
if (this.resultsReported) {
Expand Down

0 comments on commit 0ad2381

Please sign in to comment.