API reference › @evolu/common › Type › InferType
type InferType<A> =
A extends Type<any, infer T, any, any, any, any> ? T : never;
Defined in: packages/common/src/Type.ts:537
Extracts the type from a Type.
Example
const User = object({
name: NonEmptyTrimmedString100,
age: optional(PositiveInt),
});
// Use interface for objects. TypeScript displays the interface name
// instead of expanding all properties.
interface User extends InferType<typeof User> {}