Skip to content

[TS] Improve autogen autocompletion and typing#4309

Open
coolreader18 wants to merge 4 commits intomasterfrom
noa/ts-better-codegen
Open

[TS] Improve autogen autocompletion and typing#4309
coolreader18 wants to merge 4 commits intomasterfrom
noa/ts-better-codegen

Conversation

@coolreader18
Copy link
Collaborator

Description of Changes

This changes the generated files for product type to be const Point = t.object(...); export default Point; instead of just export default t.object(...);, to match sum types. This lets intellisense know that it should be imported as import Point from ".../point_type.ts", not import point_type from ".../point_type.ts". It also adds a type Point = Infer<typeof Point>;, so that Point becomes both a type and a value, and users/we have to do less Infer<typeof Point>.

Expected complexity level and risk

1

Testing

n/a, no change in behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants