Metadata associated with the Zod type definition. You can extend the interface to add whatever information you need. Notice for label, description, mobx-zod-form itself doesn't use them, but you may build your UI based on them.

interface FormMeta {
    decode: ((input) => any);
    description?: string;
    encode: ((output) => any);
    getInitialOutput: (() => any);
    label?: string;
    safeDecode: ((input, passthrough?) => SafeDecodeResult<unknown, any>);
}

Properties

decode: ((input) => any)

Type declaration

    • (input): any
    • Parameters

      • input: any

      Returns any

Returns

description?: string

The description associated with the field

encode: ((output) => any)

Type declaration

    • (output): any
    • Parameters

      • output: unknown

      Returns any

Returns

getInitialOutput: (() => any)

The initial output for this field. By default, a reasonable default value is given.

Type declaration

    • (): any
    • Returns any

See

TODO: explain initialOutput

Returns

Get the initial output.

label?: string

The label associated with the field.

safeDecode: ((input, passthrough?) => SafeDecodeResult<unknown, any>)

Type declaration

Returns