@threadplane/coreInterfacev0.0.0

StandardSchemaV1

Unpublished development API. This package is under development and is not available as a published release.

The part of Standard Schema v1 a session reads. Zod, Valibot, ArkType and any other library that implements the standard produce values of this shape, so a session needs no schema dependency of its own.

import type { StandardSchemaV1 } from '@threadplane/core';

Declaration

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

Type parameters

Input
Default: unknown
Output
Default: Input

Members

"~standard"

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