Skip to content
Client
Server

Reference / @open-music-sdk/validate / tSchema

Interface: tSchema<T> ​

Defined in: runtime.ts:61

A generated validator: Standard Schema, answering at once, plus the raw check it is built from.

Extends ​

Type Parameters ​

T ​

T

Properties ​

~standard ​

ts
readonly ~standard: Omit<{
  types?: {
     input: unknown;
     output: T;
  };
  validate: (value) => 
     | tResult<T>
    | Promise<tResult<T>>;
  vendor: string;
  version: 1;
}, "validate"> & object;

Defined in: runtime.ts:63

As the standard's, with a validate that answers at once: its result never needs awaiting.

Type Declaration ​

validate ​
ts
readonly validate: (value) => tResult<T>;

Validates a value and answers at once: the value as a T, or everything wrong with it.

Parameters ​
value ​

unknown

Returns ​

tResult<T>

Overrides ​

tStandardSchemaV1.~standard


check ​

ts
readonly check: tCheck;

Defined in: runtime.ts:68

The check itself, to call with a path and an issue list of your own, or to build another check from.

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