Created
January 14, 2023 17:47
-
-
Save andreypopp/e8eb9f44eb4af4ee646ca9a708e21df2 to your computer and use it in GitHub Desktop.
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
type CmdArgsResult<C> = C extends Cmd<[], null, infer _O, infer _C> | |
? [] | |
: C extends Cmd<infer A, null, infer _O, infer _C> | |
? [...{ [K in keyof A]: ArgResult<A[K]> }] | |
: C extends Cmd<[], infer RA, infer _O, infer _C> | |
? WithArgRestResult<[], RA> | |
: C extends Cmd<infer A, infer RA, infer _O, infer _C> | |
? WithArgRestResult<[...{ [K in keyof A]: ArgResult<A[K]> }], RA> | |
: never; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment