import { JsonResolvedValue, JsonValue } from '../skillet/parser/json-parser'; import { s } from '../schema'; import { Prettify } from '../utils'; /** * @public */ export type Component = { new (...args: any[]): T; } | ((props: T) => any); /** * @public */ export type AngularSignalLike = () => T; /** * @public */ export type ComponentPropSchema = Prettify ? { [K in keyof P]?: P[K] extends AngularSignalLike ? s.Schema | s.StandardJSONSchemaV1 : never; } : T extends Component ? { [K in keyof P]?: s.Schema | s.StandardJSONSchemaV1; } : never>; /** * @public */ export interface ExposedComponent> { component: T; name: string; description: string; children?: 'any' | 'text' | ExposedComponent[] | false; props?: ComponentPropSchema; fallback?: Component; } /** * Minimal component descriptor shape accepted by schema helpers. * * @public */ export interface ExposedComponentDescriptor { component: object; name: string; description: string; children?: 'any' | 'text' | false | unknown[]; props?: Record; fallback?: unknown; } /** * @public */ export type ComponentFallbackProps = { tag: string; partialProps?: Record; }; /** * @public */ export type ComponentNode = { [tagName: string]: { props?: { complete: boolean; partialValue: JsonResolvedValue; value?: Record; }; children?: ComponentNode[] | string; }; }; /** * @public */ export type ComponentTree = ComponentNode[]; /** * @public */ export type ComponentTreeSchema = s.HashbrownType; /** * Wrapper object used for UI kit responses. * * @public */ export interface UiWrapper { ui: ComponentTree; } /** * Flattens a component hierarchy into a map of component names to their definitions. * This includes nested components defined in the children property. * * @public */ export declare function flattenComponents(components: T[]): Map; /** * Creates a schema for a list of exposed components, allowing for the definition * of component structures and their relationships. * * @public * @param components - An array of components to create schemas for. * @returns A schema representing the structure of the components. */ export declare function createComponentSchema(components: ExposedComponentDescriptor[]): ComponentTreeSchema; //# sourceMappingURL=expose-component.d.ts.map