import { type ImmutableArray } from "../util/array.js"; import type { SchemaOptions } from "./Schema.js"; import { Schema } from "./Schema.js"; export type ChoiceOptions = ImmutableArray | { readonly [KK in K]: unknown; }; export type ChoiceOption = readonly [K, unknown]; /** Get the options for a choice field as an array. */ export declare function getChoiceEntries(options: ChoiceOptions): ImmutableArray>; /** Get the keys for a choice field as an array. */ export declare function getChoiceKeys(options: ChoiceOptions): ImmutableArray; /** Get the options for a choice field as an array. */ export declare function isOption(options: ChoiceOptions, option: string): option is K; /** Allowed options for `ChoiceSchema` */ export interface ChoiceSchemaOptions extends Omit { /** Specify correct options using a dictionary of entries. */ readonly options: ChoiceOptions; /** Default option for the value. */ readonly value?: K; } /** Choose from an allowed set of values. */ export declare class ChoiceSchema extends Schema implements Iterable> { readonly value: K; readonly options: ChoiceOptions; constructor({ one, title, placeholder, options, value, ...rest }: ChoiceSchemaOptions); validate(unsafeValue?: unknown): K; [Symbol.iterator](): Iterator>; keys(): ImmutableArray; entries(): ImmutableArray>; } /** Choose from an allowed set of values. */ export declare function CHOICE(options: ChoiceOptions): ChoiceSchema;