-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: endpoint response types,
GetResponseTypeFromEndpointMethod
an…
…d `GetResponseDataTypeFromEndpointMethod` helpers (#34) Co-authored-by: Martin Kemp <me+github@martinke.mp>
- Loading branch information
Showing
11 changed files
with
32,390 additions
and
3,444 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8,133 changes: 7,453 additions & 680 deletions
8,133
scripts/update-endpoints/generated/endpoints.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
type Unwrap<T> = T extends Promise<infer U> ? U : T; | ||
type AnyFunction = (...args) => any; | ||
|
||
export type GetResponseTypeFromEndpointMethod<T extends AnyFunction> = Unwrap< | ||
ReturnType<T> | ||
>; | ||
export type GetResponseDataTypeFromEndpointMethod< | ||
T extends AnyFunction | ||
> = Unwrap<ReturnType<T>>["data"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.