Skip to content
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

Improve DX of schema specification #43

Closed
karelklima opened this issue Mar 26, 2023 · 3 comments
Closed

Improve DX of schema specification #43

karelklima opened this issue Mar 26, 2023 · 3 comments
Labels
question Further information is requested
Milestone

Comments

@karelklima
Copy link
Owner

Improve DX of schema specification using const type parameters: https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#const-type-parameters

This could be useful for creating a schema so that the as const is not needed, and may perhaps be replaced with a wrapper function.

@karelklima karelklima added the question Further information is requested label Mar 26, 2023
@karelklima karelklima added this to the 2.0 milestone Nov 22, 2023
@karelklima
Copy link
Owner Author

One big drawback is that it would require dependency on LDkit to specify the schema, whereas in the current state schema is just a plain object.

@karelklima
Copy link
Owner Author

In the future, it should be possible to work with satisfies TypeScript feature, but at this point it does not work in tandem with const assertions, which are still mandatory to infer the type correctly.

microsoft/TypeScript#51173

@karelklima
Copy link
Owner Author

One significant change has been achieved: #82.

Additional improvements are not planned at this stage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant