/**
 * Rewrite free `Hot.*` references inside a preamble body to equivalent
 * `hotCtx.*` accesses so the compiled preamble runs in the v0.9.0 runtime
 * without relying on the global Hot singleton. Also collects literal
 * Hot.include() targets for build-time partial resolution (HS090-15).
 *
 * Uses ts-morph (already a HotStaq dependency) for a scope-aware pass —
 * this is what lets us skip rewrites when an app locally rebinds `Hot`
 * via `let foo = Hot` or `const { Cookies } = Hot`.
 *
 * See design/HS090-parser-split.md "Preamble rewrite".
 */
import { CompileWarning } from "./types";
export interface RewriteOptions {
    /** Name of the runtime context parameter. Defaults to "hotCtx". */
    ctxParam?: string;
    /**
     * Optional absolute file path used for error reporting. The preamble
     * source is treated as an ambient script, not bound to any specific
     * file on disk.
     */
    filename?: string;
}
/**
 * A captured Hot.include() call site with enough info for the builder
 * to resolve and optionally build-time expand the partial.
 */
export interface PartialCall {
    /** Raw path string as written in the .hott source. */
    path: string;
    /** Literal args object if the call site passed one, else null. */
    args: Record<string, any> | null;
    /**
     * Verbatim source text of the args expression. Runtime-inline uses
     * this so caller-scope live variables (e.g. a runtime-fetched
     * `config`) flow into the partial naturally.
     */
    argsExprText: string | null;
    /**
     * Stable stash id the compiled preamble references via
     * hotCtx.includeStash(...). Derived from path for plain literal
     * includes, or path + args-hash when args are present so that two
     * call sites with different args get distinct stash entries.
     */
    stashId: string;
}
export interface RewriteResult {
    /** Rewritten preamble source. */
    source: string;
    /** Literal Hot.include() targets, deduped, in first-seen order. */
    partials: string[];
    /** Structured record of every literal Hot.include call encountered. */
    partialCalls: PartialCall[];
    warnings: CompileWarning[];
}
/**
 * Rewrite a preamble source string.
 */
export declare function rewritePreamble(source: string, opts?: RewriteOptions): RewriteResult;
/**
 * Derive a stable stash id from a .hott partial path. The full path is
 * preserved (minus the .hott extension) so two different components named
 * "card.hott" in different directories don't collide.
 */
export declare function partialIdFromPath(path: string): string;
//# sourceMappingURL=rewrite-preamble.d.ts.map