-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScriptAn idea for TypeScript
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.
nicolo-ribaudo, nevir, efokschaner, oferh, idiotWu and 59 moreSalvatorePreviti, luketanner, motss, ackvf and lazarljubenovic
Metadata
Metadata
Assignees
Labels
Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScriptAn idea for TypeScript