import type { RuntimeAdapter } from "../../platform/adapters/base.js"; import type { EntityInfo, LayoutItem, MdxBundle } from "../../types/index.js"; import type { VeryfrontConfig } from "../../config/index.js"; export declare function resolveLayoutRouterRootDir(projectDir: string, useAppRouter: boolean, config: VeryfrontConfig): string; export declare function extractTsxLayoutSignal(source: string, filePath: string): Promise; /** * FileExistenceChecker is a pure interface for checking file existence. * This allows unit testing without mocking the full adapter. */ export interface FileExistenceChecker { exists(path: string): Promise; } /** * Discovers a components/layout.* file in the given project directory. * Returns the full path if found, or null if no layout file exists. * * This is a pure function that can be unit tested without mocking the full adapter. */ export declare function discoverComponentsLayoutPath(projectDir: string, checker: FileExistenceChecker): Promise; export interface LayoutCollectionResult { layoutBundle: MdxBundle | undefined; nestedLayouts: LayoutItem[]; } export interface LayoutCollectorOptions { projectDir: string; projectId?: string; contentSourceId?: string; adapter: RuntimeAdapter; config: VeryfrontConfig; compileMDX: (content: string, frontmatter?: Record, filePath?: string) => Promise; } export declare class LayoutCollector { private projectDir; private projectId?; private contentSourceId?; private adapter; private config; private compileMDX; constructor(options: LayoutCollectorOptions); collectLayouts(pageInfo: EntityInfo): Promise; private processLayoutResult; private collectNamedLayoutWithPath; private resolveLayoutName; private collectNestedLayouts; private collectLayoutsUnified; /** * Check for components/layout.* as a fallback when no nested layouts are found. * This provides consistent behavior between filesystem and API adapters. * * IMPORTANT: If config.layout is set, skip this fallback - config takes priority * over convention-based discovery. */ private checkComponentsLayoutFallback; /** * Creates a LayoutItem, compiling MDX content if needed. */ private createLayoutItemWithBundle; } //# sourceMappingURL=layout-collector.d.ts.map