/** * The component registries the render layer resolves against, and the `init` * functions applications call to fill them. * * Components are held as `unknown` because the core layer has no opinion on what a * component is; each framework binding narrows on read. * * @module */ import { ComponentRegistry, ComponentResolverOrObject } from '../../render/componentRegistry.js'; import { type FormHandlers } from '../forms/setup.js'; /** Registers the application's components. */ export declare function initComponentRegistry(options: { resolver: ComponentResolverOrObject; }): void; /** * Registers Optimizely Forms content types and the components that render them. * * @param handlers Form component handlers mapped by display name */ export declare function initForms(handlers: FormHandlers): void; /** True once either registry has been filled. A forms-only application is legitimate. */ export declare const hasComponentRegistry: () => boolean; /** Options for a component lookup. */ export type ResolveComponentOptions = { tag?: string; /** Looked up instead of both global registries, so bindings sharing a host stay apart. */ registry?: ComponentRegistry; }; /** * Looks a component up in `options.registry` when given, otherwise in the * application's registry, then in the forms one. */ export declare function resolveComponent(contentType: string, { registry, ...options }?: ResolveComponentOptions): C | undefined; /** * Empties both registries. * * @internal Exists for tests, which would otherwise leak registrations between cases. */ export declare function resetComponentRegistry(): void;