String schema interface.

interface StringSchema<TMessage extends ErrorMessage<StringIssue> | undefined> {
    "~run": (
        dataset: UnknownDataset,
        config: Config<BaseIssue<unknown>>,
    ) => OutputDataset<string, StringIssue>;
    "~standard": StandardProps<string, string>;
    "~types"?: { input: string; issue: StringIssue; output: string };
    async: false;
    expects: "string";
    kind: "schema";
    message: TMessage;
    reference: {
        (): StringSchema<undefined>;
        <const TMessage extends undefined | ErrorMessage<StringIssue>>(
            message: TMessage,
        ): StringSchema<TMessage>;
    };
    type: "string";
}

Type Parameters

Hierarchy (View Summary)

Properties

"~run": (
    dataset: UnknownDataset,
    config: Config<BaseIssue<unknown>>,
) => OutputDataset<string, StringIssue>

Parses unknown input values.

Type declaration

"~standard": StandardProps<string, string>

The Standard Schema properties.

"~types"?: { input: string; issue: StringIssue; output: string }

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.

reference: {
    (): StringSchema<undefined>;
    <const TMessage extends undefined | ErrorMessage<StringIssue>>(
        message: TMessage,
    ): StringSchema<TMessage>;
}

The schema reference.

Type declaration

type: "string"

The schema type.