-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add inferRawDocType helper #13900
Add inferRawDocType helper #13900
Conversation
Related issues: #12030 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do i understand correctly that this type is for getting a POJO type from a schema definition type?
i dont really like to have to repeat similar code, but i guess this is necessary.
though is it really required that we re-define exact helper functions that (at least look to me) to be the same as in inferschematype
?
A lot of the helper types are identical, I will see if there's some way to fix that. The reason why we need a similar helper function is because of how |
@hasezoey I found a way to reuse the helpers from |
Isn't this just |
@JavaScriptBach almost. The major difference is that |
Summary
As a potential workaround for #13772, this PR adds an
inferRawDocType
helper analogous toinferSchemaType
(and mostly a copy ofinferschematype.d.ts
) to make it easier to automatically infer the raw doc type from the schema definition. This would also help with #13523. With this change, you can overwritelean<>
result types, etc.Not ideal, but at least provides a workaround to more easily infer the correct raw doc type from the schema definition.
Examples