import type { BunPlugin } from "bun"; export interface SsrGraphOptions { /** The app root. Only files under it (and outside `node_modules`) are tracked. */ readonly root: string; } export interface SsrGraph { /** * The Bun **runtime** plugin that records the graph and re-keys imports. Register it before the first * route module is imported; a runtime plugin only affects modules loaded after it. */ readonly plugin: BunPlugin; /** * Re-stat every tracked module and bump the versions of the changed ones and their importers. * Returns `true` when anything moved, i.e. when the app has to be rebuilt. */ sweep(): boolean; /** Bumped by each {@link sweep} that found a change. Belongs in the key the built app is cached under. */ generation(): number; /** Release the process-wide hook {@link rewriteSsrImports} reads. */ dispose(): void; } /** * Re-key the app-owned imports of a module a **server-side** plugin just compiled. A plugin that claims a * file extension is the only code that sees that file's source, so it is the only place its imports can * be versioned; without this call every component in that language stays on the code it had at startup. * * A no-op outside a Bun dev server, and on the client half of a plugin - the client is bundled, and a * bundle has no import cache to bust. */ export declare function rewriteSsrImports(contents: string, path: string, generate: "dom" | "ssr"): string; /** Track and version the app's own server-side module graph. See the module doc for the whole design. */ export declare function createSsrGraph(options: SsrGraphOptions): SsrGraph; //# sourceMappingURL=dev-ssr-graph.d.ts.map