import { ComponentType } from 'react'; import { BaseParams, NodeData } from './base'; import { type ContextItemData } from './types'; export type ComponentImplementation = ComponentType; export type NamedComponents = Record; /** * Type used to create a component context item. */ export interface CreateComponentContextParams extends BaseParams { components: Record>; prompt: string; namespace?: string; } export declare class ComponentNodeData extends NodeData { components: Record>; prompt: string; namespace: string; constructor(params: CreateComponentContextParams); formatForLLM(codeElementIds?: string[]): ContextItemData; } /** * React hook that provides all components available globally. * Components are available everywhere, regardless of URL patterns. * * @returns Object containing all components available globally, keyed by namespace.componentName */ export declare function usePageComponents(): Record; /** * Provide components to the assistant. * * Components are always available globally, but the prompt is only applied when the URL pattern matches. * * For catch-all URL patterns, returns a setter that takes a context array. * For specific URL patterns, returns a setter that takes components and prompt separately. * * @param prompt - The prompt to use for the components (only applied when URL matches). * @param namespace - The namespace to use for the components. * @param components - The components to provide (always available). * @param urlPattern - The URL pattern to match for the prompt (components are always available). * @returns A setter function to update the context, with an unregister method attached */ export declare function provideComponents(prompt: string, namespace: string, components: Record, urlPattern?: string | RegExp): ((newComponents: Record, newPrompt: string) => void) & { unregister: () => void; }; //# sourceMappingURL=component.d.ts.map