Declare the type:
type User = {
id: number
name: string
}
const parseUser = object<User>({
id: parseNumber,
name: parseString,
})
...or infer the type:
const parseUser = object({
id: parseNumber,
name: parseString,
})
type User = Infer<typeof parseUser>