1- import type { FC } from "react" ;
1+ import type { ComponentType } from "react" ;
2+
23import type { ComponentProps } from "@/lib/component/Component" ;
34
45/**
@@ -22,14 +23,14 @@ export interface Registry {
2223 * @param type The Chartlets component's unique type name.
2324 * @param component A functional React component.
2425 */
25- register ( type : string , component : FC < ComponentProps > ) : ( ) => void ;
26+ register ( type : string , component : ComponentType < ComponentProps > ) : ( ) => void ;
2627
2728 /**
2829 * Lookup the component of the provided type.
2930 *
3031 * @param type The Chartlets component's type name.
3132 */
32- lookup ( type : string ) : FC < ComponentProps > | undefined ;
33+ lookup ( type : string ) : ComponentType < ComponentProps > | undefined ;
3334
3435 /**
3536 * Get the type names of all registered components.
@@ -39,9 +40,9 @@ export interface Registry {
3940
4041// export for testing only
4142export class RegistryImpl implements Registry {
42- private components = new Map < string , FC < ComponentProps > > ( ) ;
43+ private components = new Map < string , ComponentType < ComponentProps > > ( ) ;
4344
44- register ( type : string , component : FC < ComponentProps > ) : ( ) => void {
45+ register ( type : string , component : ComponentType < ComponentProps > ) : ( ) => void {
4546 const oldComponent = this . components . get ( type ) ;
4647 this . components . set ( type , component ) ;
4748 return ( ) => {
@@ -53,7 +54,7 @@ export class RegistryImpl implements Registry {
5354 } ;
5455 }
5556
56- lookup ( type : string ) : FC < ComponentProps > | undefined {
57+ lookup ( type : string ) : ComponentType < ComponentProps > | undefined {
5758 return this . components . get ( type ) ;
5859 }
5960
@@ -63,7 +64,7 @@ export class RegistryImpl implements Registry {
6364}
6465
6566/**
66- * The Chartly component registry.
67+ * The Chartlets component registry.
6768 *
6869 * Use `registry.register("C", C)` to register your own component `C`.
6970 *
0 commit comments