We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Would it be possible to add an existing file with type definitions as input so only not existing types would be generated.
This would be useful if some generated types are adapted by hand and need to be updated later.
Here a example:
input JSON
{ "prop1":{ "name":"", "area": 500 }, "prop2":{ "name":"", "area": 300 }, "prop3": { "name":"", "area": 400 } }
MakeTypes output
export interface MyTestInterface { prop1: Prop1OrProp2OrProp3; prop2: Prop1OrProp2OrProp3; prop3: Prop1OrProp2OrProp3; } export interface Prop1OrProp2OrProp3 { name: string; area: number; }
Adjusted types by hand
export type PropList = 'prop1' | 'prop2' | 'prop3'; export interface MyTestInterface { [p in PropList]: Prop; } export interface Prop { name: string; area: number; }
if then the json would be updated to this
{ "prop1":{ "name":"", "area": 500, "population": 10000 }, "prop2":{ "name":"", "area": 300, "population": 4000 }, "prop3": { "name":"", "area": 400, "population": 8000 } }
it should generate
export type PropList = 'prop1' | 'prop2' | 'prop3'; export interface MyTestInterface { [p in PropList]: Prop; } export interface Prop { name: string; area: number; population: number; }
If you think it's possible i could try to dig into the library and try help coding it.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Would it be possible to add an existing file with type definitions as input so only not existing types would be generated.
This would be useful if some generated types are adapted by hand and need to be updated later.
Here a example:
input JSON
MakeTypes output
Adjusted types by hand
if then the json would be updated to this
it should generate
If you think it's possible i could try to dig into the library and try help coding it.
The text was updated successfully, but these errors were encountered: