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> = {
654
654
655
655
export interface PromptGroupOptions < T > {
656
656
/**
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 .
659
659
*/
660
- onCancel ?: ( opts : { results : Partial < PromptGroupAwaitedReturn < T > > } ) => void ;
660
+ onCancel ?: ( opts : { results : Prettify < Partial < PromptGroupAwaitedReturn < T > > > } ) => void ;
661
661
}
662
662
663
+ type Prettify < T > = {
664
+ [ P in keyof T ] : T [ P ] ;
665
+ } & { } ;
666
+
663
667
export type PromptGroup < T > = {
664
668
[ P in keyof T ] : ( opts : {
665
- results : Partial < PromptGroupAwaitedReturn < T > > ;
669
+ results : Prettify < Partial < PromptGroupAwaitedReturn < Omit < T , P > > > > ;
666
670
} ) => void | Promise < T [ P ] | void > ;
667
671
} ;
668
672
@@ -673,7 +677,7 @@ export type PromptGroup<T> = {
673
677
export const group = async < T > (
674
678
prompts : PromptGroup < T > ,
675
679
opts ?: PromptGroupOptions < T >
676
- ) : Promise < PromptGroupAwaitedReturn < T > > => {
680
+ ) : Promise < Prettify < PromptGroupAwaitedReturn < T > > > => {
677
681
const results = { } as any ;
678
682
const promptNames = Object . keys ( prompts ) ;
679
683
You can’t perform that action at this time.
0 commit comments