I have a Typescript class which includes a generic which needs to extend another class and implement an interface. Here is an example
interface IHasImage {
imageUrl():string;
}
class Model {
}
class View<T extends Model & IHasImage> {
}
This is the sort of syntax I have seen elsewhere but is there a way of doing this in Typescript?
edit: Try pasting the following in to the playground:http://www.typescriptlang.org/Playground
...[removed edit 1 code]
edit 2: Answer and reasoning
(I apologise, the first example had a few flaws!) I have marked the correct answer below, although it probably needs a few pointers as outlined in this github issue (https://github.com/Microsoft/TypeScript/issues/1885)
Given the following code you can see the methodology works.

The only other thing to say is that trying to implement the interface from a class that does not extend the base class also fails. However because Typescript checking is based on the structure of the object, it will succeed if you manually add the name property to the class.

This is also why it succeeds with the ModelCorrect which extends but doesn't implements.
