Skip to main content

shared/types/chartHybrid

Hybrid Chart.js type definitions combining official Chart.js v4.5.0 types with custom business logic.

Remarksโ€‹

This file creates a hybrid approach where we use Chart.js official types as the foundation but extend them with our custom business logic types where the official types lack specificity.

Strategy:

  • Use official ChartOptions<TType>, ChartData<TType> for service layer integrations
  • Use custom ChartScalesConfig, ChartPluginsConfig for business logic and utilities
  • Provide hybrid types that combine both for complete type safety

When to use which:

  • ChartOptions<'line' | 'bar' | 'doughnut'>: Service layer, Chart.js instantiation
  • ChartScalesConfig: Utils, business logic, theme integration
  • ChartPluginsConfig: Plugin configuration, custom styling
  • UptimeChartOptions<TType>: Hybrid type for complete Uptime Watcher chart config

For comprehensive documentation see the hybrid type system guide in the architecture documentation set.

Interfacesโ€‹

Functionsโ€‹