borisyankov/DefinitelyTyped — pull request #743 by butlersoftware (2013-07-04 03:17:56+00:00)
Title: Corrected Type Heirarchy

Alright so this is a big one, but it needed to happen.

### Primary concerns addressed:
* Type hierarchy not properly represented -- polymorphism not possible.
* Core type member definitions deviating from reality
* No test suite for generic features

### Solutions:
#### 1. Inheritance
Core types have been rewritten with proper inheritance. Previously it was difficult to do polymorphic hotness such as...
```javascript
function getSomething(): KnockoutSubscribable {
if (something) {
return ko.computed(...);
} else {
return ko.observable(...);
}
}
```
...which is valid at runtime.

Also, a bunch of redundant code was eliminated like in the case of `KnockoutObservableArray extends KnockoutObservable`.

#### 2. KnockoutSubscribable?
This guy was missing out-rite, the obvious restructuring ensued.

During these rewrites, member inclusion was judged by referencing the runtime output of the current knockout.js release (so it should be darn near perfect!).

#### 4. New tests for generics, old tests unmodified.
All of this new stuff compiles cleanly against the old tests with absolutely no changes.

#### * Other notes
* This pull only includes major updates to the core types. I've written the whole thing out, however there isn't much of test suite against the other stuff. I'm holding it out for now to make sure I don't mess anybody up.
* There's some weird stuff happening in `KnockoutObservableArray`. For some reason that single interface will only inherit from one type at a time, so all of the `.fn` members are duplicated. Maybe this is an outstanding bug in TypeScript, or maybe I've been awake too long to see what's happening :-O.