[READ-ONLY] Mirror of https://github.com/bombshell-dev/clack. Effortlessly build beautiful command-line apps bomb.sh/docs/clack/basics/getting-started
cli command-line command-line-app node prompt prompts

fix: weaken internal group types to strengthen return/onCancel types master

This changes a few things. First of all, trying to infer `T` while defining `T` currently doesn't work unless there's a member without the `results` arg. This is a known limitation that may or may not be fixed in typescript one day. Until that happens, if ever, this dumbs down the type of `results` to be a `Record<PropertyKey, unknown>`. This means _within a function_ you lose strong typing, but the return type will now always be correct. Secondly, `T` is actually the resulting already-awaited shape. This means we do not need `Awaited<T[K]>` since `T[K]` is already the awaited type. For example: ```ts type ActualType = { foo: number; bar: number; }; group<ActualType>({ foo: () => Promise.resolve(303), bar: () => Promise.resolve(808) }); ``` You can see the `ActualType` never needed `Awaited<T>` on each type since it is already the final result.


+3 -7
1 changed file