跳转到内容

@freenotes/web-runtime


@freenotes/web-runtime / StandardSchemaV1

Interface: StandardSchemaV1<TInput, TOutput> ​

Defined in: src/http/types.ts:82

Structural subset of Standard Schema V1 used by HTTP contracts.

Schema libraries such as Zod can be passed directly without becoming a runtime dependency of web-runtime.

Type Parameters ​

TInput ​

TInput = unknown

TOutput ​

TOutput = TInput

Properties ​

~standard ​

readonly ~standard: object

Defined in: src/http/types.ts:83

types? ​

readonly optional types?: object

types.input ​

readonly input: TInput

types.output ​

readonly output: TOutput

validate ​

readonly validate: (value, options?) => MaybePromise<{ issues?: undefined; value: TOutput; } | { issues: readonly StandardSchemaIssue[]; }>

Parameters ​
value ​

unknown

options? ​

StandardSchemaOptions

Returns ​

MaybePromise<{ issues?: undefined; value: TOutput; } | { issues: readonly StandardSchemaIssue[]; }>

vendor ​

readonly vendor: string

version ​

readonly version: 1

让基础能力保持简单,让业务开发更加专注。