StandardSchemaLike
A Standard Schema v1 object: the ~standard member that every conforming library provides.
A Standard Schema v1 object: the ~standard member that every conforming library provides.
Import#
ts
import type { StandardSchemaLike } from "@shadow-js/router";
Signature#
ts
interface StandardSchemaLike<Input = unknown, Output = Input> {
readonly "~standard": {
readonly version: 1;
readonly vendor: string;
readonly validate: (
value: unknown,
) => StandardSchemaLikeResult<Output> | Promise<StandardSchemaLikeResult<Output>>;
/** Inference only: the types of the schema. Never read at runtime. */
readonly types?: { readonly input: Input; readonly output: Output } | undefined;
};
}
Members#
| Name | Type | Description |
|---|---|---|
Input |
Input = unknown |
|
Output |
Output = Input |
|
~standard |
readonly "~standard": { readonly version: 1; readonly vendor: string; readonly validate: ( value: unknown, ) => StandardSchemaLikeResult<Output> | Promise<StandardSchemaLikeResult<Output>>; /** Inference only: the types of the schema. Never read at runtime. */ readonly types?: { readonly input: Input; readonly output: Output } | undefined; } |