import { ChatContextItem } from './types'; declare global { interface Window { [key: string]: any; } } export interface PageContextRegistration { id: string; urlPattern: string | RegExp; context: ChatContextItem[]; } /** * Registers context items for specific pages based on URL patterns. * Returns a setter function to update the context dynamically, similar to useState. * * Multiple registrations with the same URL pattern are allowed and will all be merged * when the pattern matches. Each call creates a new independent registration. * * @param urlPattern - URL pattern (string or RegExp) to match against page URLs * @param initialContext - *Initial* array of ContextItems to provide when the pattern matches. IMPORTANT: will be overwritten when setContext is used to update the context. * @returns A setter function to update the context, with an unregister method attached */ export declare function providePageContext(urlPattern: string | RegExp, initialContext: ChatContextItem[]): ((context: ChatContextItem[]) => void) & { unregister: () => void; }; /** * React hook for providing page context that automatically cleans up on unmount. * This is the recommended way to use page context in React components. * * @param urlPattern - URL pattern (string or RegExp) to match against page URLs * @param initialContext - Initial array of ContextItems to provide when the pattern matches. IMPORTANT: will be overwritten when setContext is used to update the context. * @returns A setter function to update the context */ export declare function useProvidePageContext(urlPattern: string | RegExp, initialContext?: ChatContextItem[]): (context: ChatContextItem[]) => void; export declare function usePageContext(options?: { allowQuestions: boolean; allowComponents: boolean; }): ChatContextItem[]; export declare function generateRegistrationId(prefix?: string): string; /** * Test utility function to clear all registrations from the registry. * This should only be used in tests to ensure a clean slate between test runs. * * @internal This is for testing purposes only */ export declare function __clearPageContextRegistryForTesting(): void; //# sourceMappingURL=page.d.ts.map