Need help with type hinting a function that accepts a trpc client router
interface CreateModelProps<GetResult> {
name: string,
procedures: DecoratedProcedureRecord<{
read: BuildProcedure<"query", any, any>
create: BuildProcedure<"mutation", any, any>,
update: BuildProcedure<"mutation", any, any>,
delete: BuildProcedure<"mutation", any, any>,
}, any>,
}
interface CreateModelProps<GetResult> {
name: string,
procedures: DecoratedProcedureRecord<{
read: BuildProcedure<"query", any, any>
create: BuildProcedure<"mutation", any, any>,
update: BuildProcedure<"mutation", any, any>,
delete: BuildProcedure<"mutation", any, any>,
}, any>,
}
Type 'DecoratedProcedureRecord<{ hello: BuildProcedure<"query", { _config: RootConfig<{ ctx: { session: Session | null; prisma: PrismaClient<PrismaClientOptions, never, DefaultArgs>; }; meta: object; errorShape: { ...; }; transformer: typeof SuperJSON; }>; ... 5 more ...; _output_out: unique symbol; }, { ...; }>; getAll: ...' is missing the following properties from type 'DecoratedProcedureRecord<{ read: BuildProcedure<"query", any, any>; create: BuildProcedure<"mutation", any, any>; update: BuildProcedure<"mutation", any, any>; delete: BuildProcedure<...>; }, any, "">': read, create, update, deletets(2739)
models.tsx(155, 5): The expected type comes from property 'procedures' which is declared here on type 'CreateModelProps<{ tags: { id: string; name: string; }[]; } & { id: string; name: string; content: string; }>'
Type 'DecoratedProcedureRecord<{ hello: BuildProcedure<"query", { _config: RootConfig<{ ctx: { session: Session | null; prisma: PrismaClient<PrismaClientOptions, never, DefaultArgs>; }; meta: object; errorShape: { ...; }; transformer: typeof SuperJSON; }>; ... 5 more ...; _output_out: unique symbol; }, { ...; }>; getAll: ...' is missing the following properties from type 'DecoratedProcedureRecord<{ read: BuildProcedure<"query", any, any>; create: BuildProcedure<"mutation", any, any>; update: BuildProcedure<"mutation", any, any>; delete: BuildProcedure<...>; }, any, "">': read, create, update, deletets(2739)
models.tsx(155, 5): The expected type comes from property 'procedures' which is declared here on type 'CreateModelProps<{ tags: { id: string; name: string; }[]; } & { id: string; name: string; content: string; }>'
0 Replies