1+ /** [Standard Schema](https://github.com/standard-schema/standard-schema) v1 surface (types only). */
2+ export type StandardSchemaV1Issue = {
3+ readonly message : string ;
4+ readonly path ?: ReadonlyArray < PropertyKey | {
5+ readonly key : PropertyKey ;
6+ } > | undefined ;
7+ } ;
8+ export type StandardSchemaV1SuccessResult < OutputType > = {
9+ readonly value : OutputType ;
10+ readonly issues ?: undefined ;
11+ } ;
12+ export type StandardSchemaV1FailureResult = {
13+ readonly issues : readonly StandardSchemaV1Issue [ ] ;
14+ readonly value ?: undefined ;
15+ } ;
16+ export type StandardSchemaV1Result < OutputType > = StandardSchemaV1SuccessResult < OutputType > | StandardSchemaV1FailureResult ;
17+ export type StandardSchemaV1Types < InputType , OutputType > = {
18+ readonly input : InputType ;
19+ readonly output : OutputType ;
20+ } ;
21+ export type StandardSchemaV1Options = {
22+ readonly libraryOptions ?: Readonly < Record < string , unknown > > | undefined ;
23+ } ;
24+ export type StandardSchemaV1 < InputType = unknown , OutputType = InputType > = {
25+ readonly "~standard" : {
26+ readonly version : 1 ;
27+ readonly vendor : string ;
28+ readonly validate : ( value : unknown , options ?: StandardSchemaV1Options ) => StandardSchemaV1Result < OutputType > | Promise < StandardSchemaV1Result < OutputType > > ;
29+ readonly types ?: StandardSchemaV1Types < InputType , OutputType > | undefined ;
30+ } ;
31+ } ;
32+ export type StandardSchemaV1InferOutput < Schema extends StandardSchemaV1 > = Schema [ "~standard" ] extends {
33+ readonly types : StandardSchemaV1Types < unknown , infer OutputType > ;
34+ } ? OutputType : Extract < Awaited < ReturnType < Schema [ "~standard" ] [ "validate" ] > > , StandardSchemaV1SuccessResult < unknown > > extends StandardSchemaV1SuccessResult < infer OutputType > ? OutputType : unknown ;
35+ //# sourceMappingURL=standardSchema.d.ts.map
0 commit comments