/**
 * Prebuild cache loader
 *
 * Loads content from the prebuild cache at runtime as a last-resort fallback.
 */
import type { PrebuildManifest, NavigationCacheFile, FormsCacheFile } from './types';
import type { SiteResponse, PageResponse, EntriesResponse, EntriesResponseWithMeta, GetEntriesBaseParams } from '../client/types';
export interface PrebuildLoaderConfig {
    /** Path to prebuild cache directory */
    prebuildDir: string;
    /** Maximum age in seconds for prebuild cache */
    maxPrebuildAgeSec?: number;
}
export interface LoadResult<T> {
    /** Loaded data */
    data: T;
    /** Age of prebuild in seconds */
    prebuildAgeSec: number;
}
/**
 * Check if we're running in a Node.js environment with filesystem access.
 * Edge runtimes (Vercel Edge, Cloudflare Workers) don't have fs access.
 */
export declare function canUsePrebuild(): boolean;
/**
 * Loader for reading data from the prebuild cache.
 *
 * Used as a last-resort fallback when the CMS is unavailable and
 * there's no cached data.
 */
export declare class PrebuildLoader {
    private readonly prebuildDir;
    private readonly maxPrebuildAgeSec;
    constructor(config: PrebuildLoaderConfig);
    /**
     * Check if prebuild is available and not expired.
     */
    isAvailable(): boolean;
    /**
     * Load site data from prebuild cache.
     */
    loadSite(siteId: string): LoadResult<SiteResponse> | null;
    /**
     * Load page data from prebuild cache.
     */
    loadPage(siteId: string, pagePath: string): LoadResult<PageResponse> | null;
    /**
     * Load entries from prebuild cache with runtime filtering.
     *
     * The prebuild stores ALL entries for each content type.
     * Filtering, ordering, and pagination are applied at runtime.
     */
    loadEntries(siteId: string, params: GetEntriesBaseParams & {
        includeMeta?: boolean;
    }): LoadResult<EntriesResponse | EntriesResponseWithMeta> | null;
    /**
     * Load navigation data from prebuild cache.
     */
    loadNavigation(): LoadResult<NavigationCacheFile['menus']> | null;
    /**
     * Load forms data from prebuild cache.
     */
    loadForms(): LoadResult<FormsCacheFile['forms']> | null;
    /**
     * Get the manifest for inspection.
     */
    getManifest(): PrebuildManifest | null;
    /**
     * Clear the cached manifest (for testing).
     */
    clearCache(): void;
}
/**
 * Create a prebuild loader instance.
 */
export declare function createPrebuildLoader(config: PrebuildLoaderConfig): PrebuildLoader;
