TypeScript
Utilities
Describe
Describetype User = {
id: number
name: string
}
const User: Describe<User> = object({
id: string(), // This mistake will fail to pass type checking!
name: string(),
})Infer
InferLast updated
Describetype User = {
id: number
name: string
}
const User: Describe<User> = object({
id: string(), // This mistake will fail to pass type checking!
name: string(),
})InferLast updated
const User = object({
id: number(),
name: string(),
})
type User = Infer<typeof User>
// type User = {
// id: number
// name: string
// }