You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
z.zodTuple does not exist => rewriting to z.tuple()
Then this line does not work anymore, due to readonly something somewhere: .args(z.tuple([z.unknown() as any] as const));
I would like to have something like a z.generic() function which allows a generic to be defined as input and to be retrieved as an output type for example.
Maybe like this:
Just my 5 cents for future readers, HKT is actually kind of possible in typescript through this, albeit a bit verbose: microsoft/TypeScript#40928 (you need to define an interface for the callback each time)
exportinterfaceHKT{param: unknown;result: unknown;}exporttypeApply<fextendsHKT,x>=(f&{param: x})['result'];interfaceBoxHKTextendsHKT{result: [this['param']];}typeTest3=Apply<BoxHKT,number>// be deduced to `[number]`
Given the following function type:
ChunkTransformFunc<P, R> = (chunk: P) => R
I want to be able to express:
ChatGPT Gives me something like this:
But this has some problems:
.args(z.tuple([z.unknown() as any] as const));
I would like to have something like a
z.generic()
function which allows a generic to be defined as input and to be retrieved as an output type for example.Maybe like this:
The text was updated successfully, but these errors were encountered: