There are 2 edits here:
1. Remove unnecessarily overridden methods in ElementFinder (they are defined in IThenable).
2. Change the parameterized type in IThenable to 'any' to account for things like ElementFinder.evaluate() which may return primitive values.
The webdriver promises were recently made generic (that whole commit is actually pretty impressive!) but I think the definitions for the then methods are slightly incorrect. Looking at the original jsdoc (which I assume was imported from the original closure annotations) some edits appear to be necessary:
1. The return type of the success callback should match the returned promise's generic type.
2. The success callback can return a promise that will automatically be unwrapped.
I also made some other housekeeping edits:
* removed @param type information and @template since TypeScript puts type annotations directly in the code
* my editor removes trailing whitespace and adds a newline at the EOF
Once TypeScript 1.4 is out, these definitions can likely be simplified by using union types.
I choose to go with a more relaxed definition (versus specifying the exact options allowed for each event type) because it would have required duplicating event definitions from lib.d.ts (the properties of the events in lib.d.ts are all mandatory whereas they would be optional in this usage).
This wasn't quite right and the 'develop' branch of the TypeScript compiler no longer accepted the hacky typing. This should be the correct typing according to information from the TS team here:
https://typescript.codeplex.com/workitem/132
The 'develop' version of the TypeScript compiler requires all generics to be fully specified. I believe these arrays should all be numbers: http://momentjs.com/docs/#/parsing/array/
The 'develop' TypeScript compiler is pickier about generics being fully specified. In this case, 3 arrays could be more specific about the type of elements.
The beta compiler is smarter about detecting inconsistencies:
jquery.d.ts(192,11): error TS2189: Interface 'JQueryEventObject' cannot simultaneously extend types 'BaseJQueryEventObject' and 'JQueryInputEventObject':
Types of property 'metaKey' of types 'BaseJQueryEventObject' and 'JQueryInputEventObject' are not identical.
Documentation seems to indicate 'boolean' is correct: http://api.jquery.com/event.metaKey/
* the type of elements in the array returned by pluck have no correlation to the type of elements in the source array - they actually relate to the values of the provided property name
* bind wasn't working for a function typed as "Function". In our use case, we call _.throttle() then use the result in _.bind().
* the hash function passed into memoize may take multiple arguments