import React, { PropsWithChildren } from 'react'; export class CustomSectionRegistry { private definitions: Map> = new Map(); define(name: string, section: CustomSection): this { this.definitions.set(name, section); return this; } getComponent(name: string): CustomSectionComponent | undefined { return this.definitions.get(name)?.component; } getResolver(name: string): (() => Promise) | undefined { return this.definitions.get(name)?.dataResolver; } } type CustomSection = { component: CustomSectionComponent, dataResolver?: () => Promise }; type CustomSectionComponent = React.FC>;