Core
StructLike
Minimal structural brand carried by every struct instance.
@defjs/core · Type
Signature
interface StructLike< I = unknown, O = unknown, OO extends boolean = boolean, > { readonly _struct: StructTypes<I, O, OO>; }
Anything with a _struct type payload. _struct holds input and output phantom types: StructInput and Infer read input and output from it, and object structs use optionalOut to decide which output fields may be absent.
_struct exists only in the type system. Structs have no _struct property at runtime, and a plain object with that type is not a valid struct. input and output are the phantom types. optionalOut is true when the third type argument is true, and undefined otherwise.
Members
Prop
Type
_struct StructTypes<I, O, OO>Phantom payload. optionalOut is true only when this struct's output fields may be absent.