diff --git a/packages/prompts/src/index.ts b/packages/prompts/src/index.ts index d10f34c..3b342dd 100644 --- a/packages/prompts/src/index.ts +++ b/packages/prompts/src/index.ts @@ -654,15 +654,19 @@ export type PromptGroupAwaitedReturn = { export interface PromptGroupOptions { /** - * Control how the group can be canceld - * if one of the prompts is canceld. + * Control how the group can be canceled + * if one of the prompts is canceled. */ - onCancel?: (opts: { results: Partial> }) => void; + onCancel?: (opts: { results: Prettify>> }) => void; } +type Prettify = { + [P in keyof T]: T[P]; +} & {}; + export type PromptGroup = { [P in keyof T]: (opts: { - results: Partial>; + results: Prettify>>>; }) => void | Promise; }; @@ -673,7 +677,7 @@ export type PromptGroup = { export const group = async ( prompts: PromptGroup, opts?: PromptGroupOptions -): Promise> => { +): Promise>> => { const results = {} as any; const promptNames = Object.keys(prompts);