Skip to content

feat(mermaid): add SlotsType declaration for header and custom action slots#107

Merged
cc-hearts merged 1 commit into
mainfrom
feat/mermaid-header-slot-types
Jun 18, 2026
Merged

feat(mermaid): add SlotsType declaration for header and custom action slots#107
cc-hearts merged 1 commit into
mainfrom
feat/mermaid-header-slot-types

Conversation

@cc-hearts

Copy link
Copy Markdown
Member

🤔 This is a ...

  • 🆕 New feature
  • 🐞 Bug fix
  • 📝 Site / documentation improvement
  • 📽️ Demo improvement
  • 💄 Component style improvement
  • 🤖 TypeScript definition improvement
  • 📦 Bundle size optimization
  • ⚡️ Performance optimization
  • ⭐️ Feature enhancement
  • 🌐 Internationalization
  • 🛠 Refactoring
  • 🎨 Code style optimization
  • ✅ Test Case
  • 🔀 Branch merge
  • ⏩ Workflow
  • ⌨️ Accessibility improvement
  • ❓ Other (about what?)

🔗 Related Issues

N/A

💡 Background and Solution

Mermaid already supports header, customActionIconRender, and customActionRender slots at runtime, but the slot types were not declared explicitly. This means consumers can use the slots, but there was no static typing or IDE completion.

This PR adds a MermaidSlots interface and wires it into defineComponent with SlotsType<MermaidSlots>, then exports the slot type from the package entry.

📝 Change Log

Language Changelog
🇺🇸 English Mermaid now declares typed slots for header, customActionIconRender, and customActionRender via SlotsType, improving type safety and IDE completion.
🇨🇳 Chinese Mermaid 现在通过 SlotsType 显式声明了 headercustomActionIconRendercustomActionRender 插槽,提升类型安全和 IDE 补全。

… slots

Mermaid already supports the `header`, `customActionIconRender` and
`customActionRender` slots at runtime, but they were untyped (no static
checking or IDE completion). Declare a `MermaidSlots` interface via
`SlotsType` and export it, so slot usage is type-checked.
@cc-hearts cc-hearts merged commit a5e765e into main Jun 18, 2026
1 check passed
@cc-hearts cc-hearts deleted the feat/mermaid-header-slot-types branch June 18, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant