File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -654,15 +654,19 @@ export type PromptGroupAwaitedReturn<T> = {
654654
655655export interface PromptGroupOptions < T > {
656656 /**
657- * Control how the group can be canceld
658- * if one of the prompts is canceld .
657+ * Control how the group can be canceled
658+ * if one of the prompts is canceled .
659659 */
660- onCancel ?: ( opts : { results : Partial < PromptGroupAwaitedReturn < T > > } ) => void ;
660+ onCancel ?: ( opts : { results : Prettify < Partial < PromptGroupAwaitedReturn < T > > > } ) => void ;
661661}
662662
663+ type Prettify < T > = {
664+ [ P in keyof T ] : T [ P ] ;
665+ } & { } ;
666+
663667export type PromptGroup < T > = {
664668 [ P in keyof T ] : ( opts : {
665- results : Partial < PromptGroupAwaitedReturn < T > > ;
669+ results : Prettify < Partial < PromptGroupAwaitedReturn < Omit < T , P > > > > ;
666670 } ) => void | Promise < T [ P ] | void > ;
667671} ;
668672
@@ -673,7 +677,7 @@ export type PromptGroup<T> = {
673677export const group = async < T > (
674678 prompts : PromptGroup < T > ,
675679 opts ?: PromptGroupOptions < T >
676- ) : Promise < PromptGroupAwaitedReturn < T > > => {
680+ ) : Promise < Prettify < PromptGroupAwaitedReturn < T > > > => {
677681 const results = { } as any ;
678682 const promptNames = Object . keys ( prompts ) ;
679683
You can’t perform that action at this time.
0 commit comments