mini-effect
    Preparing search index...

    Interface VariantSchema<TKey$1, TOptions$1, TMessage>

    Variant schema interface.

    interface VariantSchema<
        TKey$1 extends string,
        TOptions$1 extends VariantOptions<TKey$1>,
        TMessage extends ErrorMessage<VariantIssue> | undefined,
    > {
        "~run": (
            dataset: UnknownDataset,
            config: Config<BaseIssue<unknown>>,
        ) => OutputDataset<
            InferOutput<TOptions$1[number]>,

                | VariantIssue
                | Exclude<
                    InferIssue<TOptions$1[number]>,
                    { type: "object" | "loose_object" | "object_with_rest" },
                >,
        >;
        "~standard": StandardProps<
            InferInput<TOptions$1[number]>,
            InferOutput<TOptions$1[number]>,
        >;
        "~types"?: {
            input: InferInput;
            issue:
                | VariantIssue
                | Exclude<
                    InferIssue<TOptions$1[number]>,
                    { type: "object" | "loose_object" | "object_with_rest" },
                >;
            output: InferOutput;
        };
        async: false;
        expects: "Object";
        key: TKey$1;
        kind: "schema";
        message: TMessage;
        options: TOptions$1;
        reference: {
            <
                const TKey$1 extends string,
                const TOptions$1 extends VariantOptions<TKey$1>,
            >(
                key: TKey$1,
                options: TOptions$1,
            ): VariantSchema<TKey$1, TOptions$1, undefined>;
            <
                const TKey$1 extends string,
                const TOptions$1 extends VariantOptions<TKey$1>,
                const TMessage extends ErrorMessage<VariantIssue> | undefined,
            >(
                key: TKey$1,
                options: TOptions$1,
                message: TMessage,
            ): VariantSchema<TKey$1, TOptions$1, TMessage>;
        };
        type: "variant";
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

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

            | VariantIssue
            | Exclude<
                InferIssue<TOptions$1[number]>,
                { type: "object" | "loose_object" | "object_with_rest" },
            >,
    >

    Parses unknown input values.

    Type Declaration

    "~standard": StandardProps<
        InferInput<TOptions$1[number]>,
        InferOutput<TOptions$1[number]>,
    >

    The Standard Schema properties.

    "~types"?: {
        input: InferInput;
        issue:
            | VariantIssue
            | Exclude<
                InferIssue<TOptions$1[number]>,
                { type: "object" | "loose_object" | "object_with_rest" },
            >;
        output: InferOutput;
    }

    The input, output and issue type.

    async: false

    Whether it's async.

    expects: "Object"

    The expected property.

    key: TKey$1

    The discriminator key.

    kind: "schema"

    The object kind.

    message: TMessage

    The error message.

    options: TOptions$1

    The variant options.

    reference: {
        <
            const TKey$1 extends string,
            const TOptions$1 extends VariantOptions<TKey$1>,
        >(
            key: TKey$1,
            options: TOptions$1,
        ): VariantSchema<TKey$1, TOptions$1, undefined>;
        <
            const TKey$1 extends string,
            const TOptions$1 extends VariantOptions<TKey$1>,
            const TMessage extends ErrorMessage<VariantIssue> | undefined,
        >(
            key: TKey$1,
            options: TOptions$1,
            message: TMessage,
        ): VariantSchema<TKey$1, TOptions$1, TMessage>;
    }

    The schema reference.

    Type Declaration

      • <const TKey$1 extends string, const TOptions$1 extends VariantOptions<TKey$1>>(
            key: TKey$1,
            options: TOptions$1,
        ): VariantSchema<TKey$1, TOptions$1, undefined>
      • Creates a variant schema.

        Type Parameters

        • const TKey$1 extends string
        • const TOptions$1 extends VariantOptions<TKey$1>

        Parameters

        • key: TKey$1

          The discriminator key.

        • options: TOptions$1

          The variant options.

        Returns VariantSchema<TKey$1, TOptions$1, undefined>

        A variant schema.

      • <
            const TKey$1 extends string,
            const TOptions$1 extends VariantOptions<TKey$1>,
            const TMessage extends ErrorMessage<VariantIssue> | undefined,
        >(
            key: TKey$1,
            options: TOptions$1,
            message: TMessage,
        ): VariantSchema<TKey$1, TOptions$1, TMessage>
      • Creates a variant schema.

        Type Parameters

        Parameters

        • key: TKey$1

          The discriminator key.

        • options: TOptions$1

          The variant options.

        • message: TMessage

          The error message.

        Returns VariantSchema<TKey$1, TOptions$1, TMessage>

        An variant schema.

    type: "variant"

    The schema type.