InferChoice

type
type InferChoice = T extends { choices: readonly (infer C)[] }
  ? C
  : T extends { choices: () => readonly (infer C)[] }
  ? C
  : never;

Infer the choice type from an option config.
Choices can be an array (including readonly) or a function returning an array.