ResolveOptionType
typetype ResolveOptionType = InferChoice<T> extends never
? InferCoerce<T, BaseType<T>>
: T extends { type: "array" }
? InferChoice<T>[]
: InferChoice<T>;Resolve a single option config to its final type.
Priority: choices > coerce > base type
For array options, choices narrow the element type rather than replacing
the entire type. e.g. { type: 'array', items: 'string', choices: ['a', 'b'] as const }
resolves to ('a' | 'b')[], not 'a' | 'b'.