AAI SDK
    Preparing search index...

    Interface StandardSchemaV1<Input, Output>

    The Standard Schema V1 interface, inlined as the spec recommends (it is a types-only contract). A Zod, ArkType, or Valibot schema all satisfy it.

    interface StandardSchemaV1<Input = unknown, Output = Input> {
        "~standard": {
            types?: { input: Input; output: Output };
            validate: (
                value: unknown,
            ) => StandardSchemaResult<Output> | Promise<StandardSchemaResult<Output>>;
            vendor: string;
            version: 1;
        };
    }

    Type Parameters

    • Input = unknown

      The type the schema accepts for validation.

    • Output = Input

      The type validation produces.

    Index
    "~standard": {
        types?: { input: Input; output: Output };
        validate: (
            value: unknown,
        ) => StandardSchemaResult<Output> | Promise<StandardSchemaResult<Output>>;
        vendor: string;
        version: 1;
    }

    The Standard Schema properties object.

    Type Declaration

    • Optional Readonlytypes?: { input: Input; output: Output }

      Inferred types, when the vendor exposes them.

    • Readonlyvalidate: (
          value: unknown,
      ) => StandardSchemaResult<Output> | Promise<StandardSchemaResult<Output>>

      Validate value, returning the typed value or issues.

    • Readonlyvendor: string

      The vendor name, e.g. "zod", "arktype", "valibot".

    • Readonlyversion: 1

      The version of the standard implemented (always 1).