• Define field of given string literal union type. Default initial value will be first option received. Accepts string and number values which are present on provided options list.

    requires at least one option to be provided

    Type Parameters

    • Opts extends string

    Parameters

    • firstOption: Opts
    • Rest ...otherOptions: Opts[]

    Returns FieldDecoder<Opts>

    Example

    const Schema = new FormSchemaBuilder()
    .fields({
    x: FormFields.choice("A", "B", "C") // x: "A" | "B" | "C"
    })
    .build()

Generated using TypeDoc