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
Adjust typings in headings options #15833
Conversation
/** | ||
* Custom name of the model specified by the user. | ||
* | ||
* @internal |
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.
Why is it internal if it's used in non-internal type (line 98)?
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.
@arkflpc It should be exported and public available, but we have issue with documentation generation. Umberto incorrectly serializes union in template string literal and in API reference we have something like this:
I tried to split it between types or use it inline directly in HeadingCustomModel
but it always results in [object Set]
in docs.
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.
I think we should change this solution a bit. Adding the new type (HeadingCustomModelSeparator
) seems redundant, and it makes our API docs look confusing:
Here's my idea: let's create a separate interface for the custom element. We could call it HeadingCustomElementOption
or HeadingCustomOption
, and it would basically be a copy of HeadingElementOption
, but with the model property changed to heading${ string }
. You can also try to prepare a basic type and extend it, but I am not sure if it will be correctly compiled by Umberto.
@DawidKossowski Have you tested this solution? I'm quite sure that it'll lead to collapse of heading union. |
@DawidKossowski I pushed modifications. |
Suggested merge commit message (convention)
Feat (heading): Adjust typings in headings options. Closes #15790.