UNPKG

308 BTypeScriptView Raw
1type Unwrap<T> = T extends Promise<infer U> ? U : T;
2type AnyFunction = (...args: any[]) => any;
3export type GetResponseTypeFromEndpointMethod<T extends AnyFunction> = Unwrap<ReturnType<T>>;
4export type GetResponseDataTypeFromEndpointMethod<T extends AnyFunction> = Unwrap<ReturnType<T>>["data"];
5export {};