Reference / @open-music-sdk/validate / tStandardSchemaV1
Interface: tStandardSchemaV1<Input, Output>
Defined in: runtime.ts:30
Standard Schema v1 (https://standardschema.dev), as any library that takes a validator reads one. The interface is structural, so it is declared here and not taken from a package.
Extended by
Type Parameters
Input
Input = unknown
Output
Output = Input
Properties
~standard
readonly ~standard: object;Defined in: runtime.ts:32
The one property the standard asks for, named so that it collides with nothing of a schema's own.
types?
readonly optional types?: object;Type-level only, so that Input and Output can be inferred from a schema. Never set at runtime.
types.input
readonly input: Input;What the validator takes.
types.output
readonly output: Output;What a value that passes is.
validate
readonly validate: (value) =>
| tResult<Output>
| Promise<tResult<Output>>;Validates a value. The standard lets a validator answer later; every one here answers at once.
Parameters
value
unknown
Returns
| tResult<Output> | Promise<tResult<Output>>
vendor
readonly vendor: string;Who made the validator: open-music-sdk for every one here.
version
readonly version: 1;The version of the standard this follows.