-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation failure #2
Comments
Thanks Daan, and thanks for reporting this TypeScript issue. I think a better definition would indeed be something like your proposal, though the values can be an object or anything: export type NestedObject = { [key: string]: NestedObject | unknown } This requires changes at the places where A workaround to fix keeping |
Hmm, it may work out like that, when I trade a |
The workaround mentioned here works, that was very helpful: microsoft/TypeScript#38628 (comment) I've published that workaround for the time being in |
Hi Jos, That works indeed! As the thread notes this isn't a 100% future-proof way of dealing with it (future Typescript releases might strip jsdocs as well), but I approve of the pragmatic approach if the alternative is a lot of work. Thanks for the quick fix. If I can find some spare time and remind myself I might look into the typing a bit myself, but you know how that goes. |
Good to hear it works. It's indeed a shaky solution. I will open this issue again as a reminder to find a better solution soon. |
I've done some refactoring to improve the TypeScript support, see 9ec74ae There is no need anymore for the Can you give |
👍 Works like a charm! |
😎 thanks for checking! |
Hi,
On attempting to use your (nice-looking!) library, I get a compilation failure:
It appears that the
@ts-ignore
you put in your types.ts is not added to the compiledtypes.d.ts
.Some interesting discussion around this behaviour on the typescript repo: microsoft/TypeScript#38628
Not sure what the best solution would be.
I was surprised by this warning since recursive types are possible in newer Typescript. Changing the definition to
export type NestedObject = {[key: string]:NestedObject};
does work, so I expect there's something special aboutRecord
here that's throwing soot in the dinner.The text was updated successfully, but these errors were encountered: