{"action":"opened","issue":{"url":"https://api.github.com/repos/angular/protractor/issues/3696","repository_url":"https://api.github.com/repos/angular/protractor","labels_url":"https://api.github.com/repos/angular/protractor/issues/3696/labels{/name}","comments_url":"https://api.github.com/repos/angular/protractor/issues/3696/comments","events_url":"https://api.github.com/repos/angular/protractor/issues/3696/events","html_url":"https://github.com/angular/protractor/issues/3696","id":187078229,"number":3696,"title":"Erronous then function signature definition ElementArrayFinder","user":{"login":"AbdoulayeKarimTraore","id":15995390,"avatar_url":"https://avatars.githubusercontent.com/u/15995390?v=3","gravatar_id":"","url":"https://api.github.com/users/AbdoulayeKarimTraore","html_url":"https://github.com/AbdoulayeKarimTraore","followers_url":"https://api.github.com/users/AbdoulayeKarimTraore/followers","following_url":"https://api.github.com/users/AbdoulayeKarimTraore/following{/other_user}","gists_url":"https://api.github.com/users/AbdoulayeKarimTraore/gists{/gist_id}","starred_url":"https://api.github.com/users/AbdoulayeKarimTraore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AbdoulayeKarimTraore/subscriptions","organizations_url":"https://api.github.com/users/AbdoulayeKarimTraore/orgs","repos_url":"https://api.github.com/users/AbdoulayeKarimTraore/repos","events_url":"https://api.github.com/users/AbdoulayeKarimTraore/events{/privacy}","received_events_url":"https://api.github.com/users/AbdoulayeKarimTraore/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-03T14:39:42Z","updated_at":"2016-11-03T14:39:42Z","closed_at":null,"body":"When trying to use the **.then** function available for and ElementArrayFinder by passing a callback in which I don't return anything, the typescript compiler signals it as an error, and the output is\r\ntype (value: any) => void is not assignable to parameter of type '(value: any= => {} | IThenable <{}>'\r\nbelow a test function take from the documentation that will replicate the problem. \r\n`  static test(): void {\r\n    element.all(by.css('.items li')).then( (arr) => {\r\n      console.log('test');\r\n    });\r\n  }\r\n`\r\nFor me the problem comes from the type definition in lib/element.ts line 482 and 483 instead of \r\n`then(fn?: (value: any) => {} | wdpromise.IThenable<{}>, errorFn?: (error: any) => any):\r\n      wdpromise.Promise<any[]>`\r\nit should be \r\n`then(fn?: (value: any) => **void** | {} | wdpromise.IThenable<{}>, errorFn?: (error: any) => any):\r\n      wdpromise.Promise<**any**>`\r\nsince what is returned by the callback passed in the .then may or may not be an array.\r\n\r\n- TypeScript Version: `2.0.3`\r\n- Node Version: `6.9.1`\r\n- Protractor Version: `4.0.10`\r\n- Angular Version: `1.5.0`"}}
{"actor":{"display_login":"AbdoulayeKarimTraore"}}