import React from "react";
import type { PageTemplate } from "../types/page-template";
import type { Navigation, ScreenDefinition } from "../types";
/**
 * Context value for page template resolution.
 * All properties are readonly since context values should not be mutated by consumers.
 */
interface PageTemplateContextValue {
    /**
     * Resolve a navigation's page_refs and screens into a unified screen list
     */
    readonly resolvePages: (navigation: Navigation) => ScreenDefinition[];
    /**
     * Get all available page templates
     */
    readonly listTemplates: () => PageTemplate[];
    /**
     * Get a specific template by ID
     */
    readonly getTemplate: (id: string) => PageTemplate | undefined;
    /**
     * Check if a template exists
     */
    readonly hasTemplate: (id: string) => boolean;
}
/**
 * Props for PageTemplateProvider
 */
interface PageTemplateProviderProps {
    children: React.ReactNode;
    /**
     * Additional custom page templates to register.
     * These are registered when the provider mounts and unregistered when it unmounts.
     */
    templates?: readonly PageTemplate[];
}
/**
 * Provider for page template resolution.
 *
 * This provider:
 * 1. Registers any custom templates passed via props
 * 2. Provides methods for resolving navigation pages
 * 3. Cleans up custom templates on unmount
 *
 * @example
 * ```tsx
 * // With custom templates
 * const customTemplates: PageTemplate[] = [
 *   {
 *     id: 'custom-dashboard',
 *     slug: 'dashboard',
 *     name: 'Dashboard',
 *     category: 'custom',
 *     version: '1.0.0',
 *     component_tree: [{ type: 'TextWidget', props: { text: 'Custom Dashboard' } }],
 *   },
 * ];
 *
 * <PageTemplateProvider templates={customTemplates}>
 *   <App />
 * </PageTemplateProvider>
 *
 * // Without custom templates (uses only core templates)
 * <PageTemplateProvider>
 *   <App />
 * </PageTemplateProvider>
 * ```
 */
export declare function PageTemplateProvider({ children, templates }: PageTemplateProviderProps): React.JSX.Element;
/**
 * Hook to access page template functionality.
 *
 * @throws Error if used outside of PageTemplateProvider
 *
 * @example
 * ```tsx
 * function NavigationRenderer({ navigation }: { navigation: Navigation }) {
 *   const { resolvePages } = usePageTemplates();
 *   const screens = resolvePages(navigation);
 *
 *   return (
 *     <div>
 *       {screens.map((screen) => (
 *         <Screen key={screen.id} definition={screen} />
 *       ))}
 *     </div>
 *   );
 * }
 * ```
 */
export declare function usePageTemplates(): PageTemplateContextValue;
/**
 * Hook to resolve navigation pages directly.
 * Convenience wrapper around usePageTemplates().resolvePages.
 *
 * @param navigation - The navigation to resolve
 * @returns Array of resolved screen definitions
 */
export declare function useResolvedPages(navigation: Navigation): ScreenDefinition[];
export {};
//# sourceMappingURL=PageTemplateProvider.d.ts.map