Open
Description
With enabling https://www.typescriptlang.org/tsconfig/#isolatedDeclarations, tsc
require to write code with explicit type annotations:
For exmaple:
The case in README.md
const LoginSchema: /* tsc force you write type here, so what should be write here for valibot? */ = v.object({
email: v.pipe(v.string(), v.email()),
password: v.pipe(v.string(), v.minLength(8)),
});
For small schemas, I could just type them there. But I have very big schemas which isn't proper to manually write them.
zod
has a helper type ZodType
to infer schemas from types. So for zod, it could be written as
const LoginSchema: ZodType<{ email: string, passworld: string }> = v.object({
email: v.pipe(v.string(), v.email()),
password: v.pipe(v.string(), v.minLength(8)),
});