Picklist schema interface.

interface PicklistSchema<
    TOptions extends PicklistOptions,
    TMessage extends ErrorMessage<PicklistIssue> | undefined,
> {
    "~run": (
        dataset: UnknownDataset,
        config: Config<BaseIssue<unknown>>,
    ) => OutputDataset<TOptions[number], PicklistIssue>;
    "~standard": StandardProps<TOptions[number], TOptions[number]>;
    "~types"?: {
        input: TOptions[number];
        issue: PicklistIssue;
        output: TOptions[number];
    };
    async: false;
    expects: string;
    kind: "schema";
    message: TMessage;
    options: TOptions;
    reference: {
        <const TOptions extends PicklistOptions>(
            options: TOptions,
        ): PicklistSchema<TOptions, undefined>;
        <
            const TOptions extends PicklistOptions,
            const TMessage extends undefined | ErrorMessage<PicklistIssue>,
        >(
            options: TOptions,
            message: TMessage,
        ): PicklistSchema<TOptions, TMessage>;
    };
    type: "picklist";
}

Type Parameters

Hierarchy (View Summary)

Properties

"~run": (
    dataset: UnknownDataset,
    config: Config<BaseIssue<unknown>>,
) => OutputDataset<TOptions[number], PicklistIssue>

Parses unknown input values.

Type declaration

"~standard": StandardProps<TOptions[number], TOptions[number]>

The Standard Schema properties.

"~types"?: {
    input: TOptions[number];
    issue: PicklistIssue;
    output: TOptions[number];
}

The input, output and issue type.

async: false

Whether it's async.

expects: string

The expected property.

kind: "schema"

The object kind.

message: TMessage

The error message.

options: TOptions

The picklist options.

reference: {
    <const TOptions extends PicklistOptions>(
        options: TOptions,
    ): PicklistSchema<TOptions, undefined>;
    <
        const TOptions extends PicklistOptions,
        const TMessage extends undefined | ErrorMessage<PicklistIssue>,
    >(
        options: TOptions,
        message: TMessage,
    ): PicklistSchema<TOptions, TMessage>;
}

The schema reference.

Type declaration

type: "picklist"

The schema type.