Core
Infer
Infers the parsed output type of a struct, as an alias of the internal output brand.
@defjs/core · Type
Signature
type Infer<T> = StructOutput<T>;
The type a successful parse produces. Use Infer<typeof User> for the decoded value of a struct, and StructInput for the accepted input type. A type that is not a struct yields never.
const User = struct.object({ id: struct.number(), name: struct.string() });
type User = Infer<typeof User>; // { id: number; name: string }