I have this code in callback many places :
return new Promise<Result> (
(resolve : (Result ) =>void,reject: ( any) =>void) =>{
.......
});
I thought I will create an interface for this long type :
interface callback<T> {
resolve : (value? :T ) =>void;
reject : (error? : any) =>void;
}
But I cannot use it in place like :
return new Promise<Result> (
( c : Callback<Result> ) = > {
......
}
TS complains that Callback is not a resolve: Result => void.
How can I make it work?