Skip to content
Client
Server

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 ​

ts
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? ​

ts
readonly optional types?: object;

Type-level only, so that Input and Output can be inferred from a schema. Never set at runtime.

types.input ​
ts
readonly input: Input;

What the validator takes.

types.output ​
ts
readonly output: Output;

What a value that passes is.

validate ​

ts
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 ​

ts
readonly vendor: string;

Who made the validator: open-music-sdk for every one here.

version ​

ts
readonly version: 1;

The version of the standard this follows.

MIT licensed. Not affiliated with, endorsed by, or sponsored by Apple Inc. Apple Music and MusicKit are trademarks of Apple Inc.