TypeScript problem

Hello, doing library code, took inspiration from ts-rest and trpc. I have problem, my input and output types are any. How could I make it so that those would be correct? https://tsplay.dev/WJpnlN Here my old version where it worked if it helps: https://tsplay.dev/w86bVm is my problem my Routes type?
export type Routes = Route<AnyZodObject, ZodTypeAny>[];
export type Routes = Route<AnyZodObject, ZodTypeAny>[];
1 Reply
rocawear
rocawearOP2y ago
Also every feedback and suggestion is really appreciated! This is still very alpha version but got stuck now https://tsplay.dev/mbaZ8N this kinda works but cant return array (i know i have type AnyZodObject but had alot of errors when using ZodAnyType) and if i hover my procedure it thinks there is input
{
method: "get",
path: "/todos/getAll",
output: z.object({
id: z.string(),
text: z.string(),
value: z.boolean(),
}),
procedure: () => {
return { id: "1", text: "wasd", value: false };
},
},
{
method: "get",
path: "/todos/getAll",
output: z.object({
id: z.string(),
text: z.string(),
value: z.boolean(),
}),
procedure: () => {
return { id: "1", text: "wasd", value: false };
},
},
Want results from more Discord servers?
Add your server