Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Is there a way to configure this for "relaxed" type generation? #191

Open
unphased opened this issue Dec 7, 2023 · 0 comments
Open

Is there a way to configure this for "relaxed" type generation? #191

unphased opened this issue Dec 7, 2023 · 0 comments

Comments

@unphased
Copy link

unphased commented Dec 7, 2023

I have some large and deep javascript structures I generate in my app as a database of sorts.

Now I want to have a type def for it since it turns out I got pretty used to getting the editor suggesting types for me, and I probably should handcraft a type def, but I am exploring autogenerating this thing based on the dynamic value I generate in my app.

The problem with this is that dts-gen is way too strict. I have objects whose keys are file paths, and so it's generating types that have all these file paths serialized out. Now this is not surprising and correct behavior but I wonder if there is some sort of thing I can do to cause it to just use e.g. string in this situation? And for all the differences in the child properties, resolve them down to required or optional types based on whether they are always present or sometimes present.

I assume this is probably possible but nobody really has built such a thing. I guess I will bite the bullet and hand craft and maintain the type.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant