Core
BuilderInput
Parsed endpoint input that a request builder receives.
@defjs/core · Type
Signature
type BuilderInput<S> = S extends CarriedStruct<infer Inner> ? NullishBuilderInput<S, Inner> : S extends UnionStruct<infer Options> ? BuilderInput<Options[number]> : S extends DiscriminatedUnionStruct<infer Options> ? BuilderInput<Options[number]> : S extends IntersectionStruct<infer Options> ? IntersectBuilderInputs<Options> : S extends RecordStruct<infer Value> ? { [key: string]: BuilderInput<Value> } : S extends TupleStruct<infer Items> ? { [K in keyof Items]: Items[K] extends StructLike< unknown, unknown, boolean > ? BuilderInput<Items[K]> : Items[K]; } : S extends ArrayStruct<infer Item> ? BuilderInput<Item>[] : S extends ObjectStruct<infer Shape> ? { [K in keyof Shape]: BuilderInput<Shape[K]> } & Typed : Infer<S>;
Object nodes are intersected with the internal Typed brand, so they carry the struct that
produced them and alias, Date, and bigint encoding follow the value into
the request. Record entries and tuple items are branded the same way. At
runtime a record container is also tagged when the parsed value is an object,
whether or not it was merged. Array and tuple containers are not. null and
undefined are never tagged. Nullish modifiers recover the struct they
wrapped. Union options are distributed; intersection options are combined.
Any other struct falls back to Infer<S>.
CarriedStruct, NullishBuilderInput, IntersectBuilderInputs, and Typed
are internal helper types.