Typing the return type of a Schema constructor
Hi all! I'm just getting into effect and I figured a good way to do it would be to transform some of my existing zod code. And I've ran into something I didn't quite know how to do. I have a simple interface like:
And I want to write a type constructor for it where one can pass their own schemas for node and cursor. This is pretty simple, but I'm having issues typing the return type to ensure it conforms to the existing Edge interface.
I've tried adding a
I did have to cheat in the
And I want to write a type constructor for it where one can pass their own schemas for node and cursor. This is pretty simple, but I'm having issues typing the return type to ensure it conforms to the existing Edge interface.
I've tried adding a
satisfies Schema.Schema<Edge<Schema.Schema.Type<Node>, Schema.Schema.Type<Cursor>>> to the Struct call, but that doesn't work. I assume there is something easy I'm missing here hahaI did have to cheat in the
zod version (below), but I was hoping I wouldn't have to do that for Schema