import type { ComponentType } from "react"; import type { AppContainer } from "../AppContainer"; import type { LayoutNode } from "../layout/LayoutNode"; import type { ComponentModel } from "../models"; import type { Service } from "../services"; /** * Creates components and component models from layout nodes. */ export interface ComponentFactory extends Service { /** * Gets the React component type associated with the given layout node (i.e. * an object that can be passed to createElement()). * * @param node The layout node. */ getComponentType(node: LayoutNode): Promise; /** * Creates the model for a component. * * @param node The layout node. * @param appContainer Optionally specify an AppContainer, if not provided * it will use the AppContainer from the current context. */ createComponentModel(node: LayoutNode, appContainer?: AppContainer): Promise; }