/** * ES-module emitter for the optional view compiler. * * Turns a {@link CompiledView} into an importable side-effect module that * registers the precompiled expressions at startup. The emitted code contains * no `with` and no `new Function()`, so importing it is safe under a strict CSP. * * @module bquery/view/compiler */ import type { CompiledView, CompileOptions, CompileStats } from './types'; /** Default module specifier the emitted code imports the runtime hook from. */ export declare const DEFAULT_IMPORT_SPECIFIER = "@bquery/bquery/view"; /** Options for {@link emitModule} / {@link compileToModule}. */ export type EmitOptions = CompileOptions & { /** * Module specifier to import `registerCompiledExpressions` from. Defaults to * `'@bquery/bquery/view'`; override it for monorepos or custom aliases. */ importSpecifier?: string; }; /** * Emits an importable ES module from an already-compiled view. */ export declare const emitModule: (compiled: CompiledView, importSpecifier?: string) => string; /** * Compiles a template and emits an importable ES module in one step. * * @returns The module source and the compile statistics (so a build tool can * report or assert on coverage). * * @example * ```ts * import { compileToModule } from '@bquery/bquery/view/compiler'; * * const { code, stats } = compileToModule('
'); * // write `code` next to your template and import it before mounting * ``` */ export declare const compileToModule: (template: string, options?: EmitOptions) => { code: string; stats: CompileStats; }; //# sourceMappingURL=emit.d.ts.map