Closed
Description
Hi all,
I was hoping that typescript could support interface extending generic types like the following example:
interface IHttpPromise<T extends {}> extends T{
$resolved: boolean;
$error: boolean;
}
interface IHttpPost {
<T extends {}>(actionUrl: string, postData: any): IHttpPromise<T>;
}
The use case is that an http request is initiated and the IHttpPost method returns an object which gets populated when the request completes. In angular this pattern is being used by the $resource service (see definitelyTyped IResource declaration here).
Is this feasible?
Thanks in advance,
Andreas
PS: I have seen this issue in codeplex but couldn't find it here.