Skip to content

Commit

Permalink
Set default type for Request
Browse files Browse the repository at this point in the history
  • Loading branch information
aryzing committed Feb 27, 2024
1 parent 52544c4 commit d9ce234
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/request/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface Requests {
export type Return<Method> = Method extends keyof Requests ? Requests[Method]['result'] : unknown;
export type Params<Method> = Method extends keyof Requests ? Requests[Method]['params'] : unknown;

export type Request = <Method extends keyof Requests>(
export type Request<Method extends keyof Requests = keyof Requests> = (
requestMethod: Method,
params: Params<Method>
) => Promise<Return<Method>>;
Expand Down

0 comments on commit d9ce234

Please sign in to comment.