Type Alias: InferType<T>
InferType<
T> =TextendsObjectValidator<any, infer U> ?U:never
Defined in: projects/shapeshift/src/lib/util-types.ts:114
Infers the type of a schema object given typeof schema.
The schema has to extend ObjectValidator.
Type Parameters
| Type Parameter | 
|---|
| TextendsObjectValidator<any> | 
Example
import { InferType, s } from '@sapphire/shapeshift';
const schema = s.object({
	foo: s.string,
	bar: s.number,
	baz: s.boolean,
	qux: s.bigint,
	quux: s.date
});
type Inferredtype = InferType<typeof schema>;
// Expected type:
// type Inferredtype = {
// 	foo: string;
// 	bar: number;
// 	baz: boolean;
// 	qux: bigint;
// 	quux: Date;
// };