Hello, I am facing an issue with the code below. I am unable to obtain the export type and I am getting an error specifically related to <typeof test>.
const testSchema = (image: ImageFunction) =>
z.object({
title: z.string(),
src: image().refine((img) => img.width >= 1080, {
message: "Error",
}),
});
export type TestFrontmatter = z.infer<typeof testSchema>;
Error:
Type '(image: ImageFunction) => z.ZodObject<{ title: z.ZodString; src: z.ZodEffects<z.ZodObject<{ src: z.ZodString; width: z.ZodNumber; height: z.ZodNumber; format: z.ZodUnion<[z.ZodLiteral<"png">, z.ZodLiteral<"jpg">, z.ZodLiteral<"jpeg">, z.ZodLiteral<...>, z.ZodLiteral<...>, z.ZodLiteral<...>, z.ZodLiteral<...>]>; }, z...' does not satisfy the constraint 'ZodType<any, any, any>'
Would appreciate any help or solutions that you may have. Thank you.