/************************** * Renderer Adapter * * Adapts the shared Renderer to work with handler contexts. * Creates lightweight adapters that bind the shared renderer * to a specific project context. * * @module server/shared/renderer/adapter **************************/ import type { HandlerContext } from "../../handlers/types.js"; import { type Renderer, type RendererOptions } from "../../../rendering/renderer.js"; import type { PageDataResponse, RenderOptions, RenderResult } from "../../../rendering/orchestrator/types.js"; import type { MdxBundle } from "../../../types/index.js"; export interface RendererAdapter { renderPage(slug: string, options?: RenderOptions): Promise; resolvePageData(slug: string, options?: RenderOptions): Promise; getAllPages(): Promise; clearCache(slug?: string): void; clearAllState(): void; getVirtualModuleSystem(): { handleRequest(req: Request): Response | null; register(id: string, source: string, projectDir: string): Promise; registerModule(id: string, source: string, projectDir: string): Promise; getModule(id: string): unknown; clear(): void; }; initializeComponents(): Promise; compileMDX(content: string, frontmatter?: Record, filePath?: string): Promise; destroy(): Promise; } /** * Abstraction over renderer initialization, allowing tests to inject * a mock renderer without pulling in the full rendering subsystem. */ export interface RendererInitializer { initialize(options: RendererOptions): Promise; isInitialized(): boolean; get(): Renderer; destroy(): Promise; } /** * Replace the renderer initializer used by the adapter layer. * Pass `undefined` to restore the default (real) initializer. * * Returns a disposer that restores the previous initializer — use in * `afterEach` or with `using` to prevent test pollution: * * ```ts * afterEach(() => setRendererInitializer(undefined)); * ``` * * @internal Test-only — not part of the public API. */ export declare function setRendererInitializer(initializer?: RendererInitializer): void; export declare function getRendererForProject(ctx: HandlerContext): Promise; export declare function destroyRendererAdapter(): Promise; //# sourceMappingURL=adapter.d.ts.map