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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types issues in headings #15790

Closed
Witoso opened this issue Feb 2, 2024 · 0 comments 路 Fixed by #15833
Closed

Types issues in headings #15790

Witoso opened this issue Feb 2, 2024 · 0 comments 路 Fixed by #15833
Assignees
Labels
domain:ts package:heading squad:collaboration Issue to be handled by the Collaboration team. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@Witoso
Copy link
Member

Witoso commented Feb 2, 2024

馃摑 Provide a description of the improvement

Taken from #15785

Type definitions to support custom heading models

Currently the typescript definition for heading configs, uses this union type:

export type HeadingOption = HeadingElementOption | HeadingParagraphOption;

These options explicitly specify heading1-6, and paragraph models. However, according to the docs, we're able to specify our own models. (Docs example is headingFancy).

model: 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6';

Could we add some HeadingCustomOption type to the union so we don't have to use @ts-ignore?

UpcastAlso in typescript definitions?

I believe the heading options support upcastAlso as a property. For example in heading tests:

heading: {
options: [
{ model: 'paragraph', title: 'paragraph' },
{
model: 'heading1',
view: 'h1',
upcastAlso: [
{ name: 'p', attributes: { 'data-heading': 'h1' } }
],
title: 'User H1',
converterPriority: 'high'
}
]
}

Can this be added to the typescript definitions for heading options?

@Witoso Witoso added type:bug This issue reports a buggy (incorrect) behavior. package:heading squad:core Issue to be handled by the Core team. domain:ts labels Feb 2, 2024
@Mati365 Mati365 self-assigned this Feb 8, 2024
@DawidKossowski DawidKossowski added squad:collaboration Issue to be handled by the Collaboration team. and removed squad:core Issue to be handled by the Core team. labels Feb 8, 2024
@CKEditorBot CKEditorBot added this to the iteration 72 milestone Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:ts package:heading squad:collaboration Issue to be handled by the Collaboration team. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants