This repository has been archived by the owner on Mar 26, 2024. It is now read-only.
re: recursive type expansion #178
refactorized
started this conversation in
General
Replies: 1 comment 6 replies
-
could you provide the generated types along with the use case that doesn't work? I can better help debug then |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi again,
I was trying to implement types using the reference expanding utility type you provided yesterday (thanks again) here:
#175 (comment)
But when I apply it to a type that comes out of the codegen, I just get the same type back. It seems that I have to union the type from the codegen with
Record<string, unknown>
to get the type to resolve correctly. Otherwise the last conditional fails, and I just get the type back.I'm not sure why this doesn't work. As far as I can tell, the generated type should fulfill
Record<string, unknown>
but I am a little unsure about how unknown gets treated in type math. The following is what my code looks like now, and it works, but do you know any way I can use it without unioning the generated type?Beta Was this translation helpful? Give feedback.
All reactions