import type { Program } from "./types.js"; export interface Logger { info(msg: string, options?: unknown): void; warn(msg: string, options?: unknown): void; error(msg: string, options?: unknown): void; } export type ParseFn = (source: string, options?: { allowReturnOutsideFunction?: boolean; jsx?: boolean; }) => Program | { ast: Program; } | Promise; export type GetDirectiveTypeFn = (directive: string, moduleId?: string) => "client" | "server" | undefined; export interface DirectiveOptions { verbose?: boolean; logger?: Logger; loader?: { parse?: ParseFn; getDirectiveType?: GetDirectiveTypeFn; }; /** * Host-supplied predicate. Given the module source, return `true` when * leading code *before* a file-level directive is expected — e.g. a bundler * that prepends imports — so the "directive must be at the top" warning is * suppressed. Defaults to strict (no tolerance): rsl ships no * bundler-specific assumptions, so the host owns this policy. (A Vite host, * for instance, passes a predicate that looks for `__vitePreload` etc.) */ tolerateLeadingCode?: (source: string) => boolean; } /** No-op logger — silences output unless the caller wires one in. */ export declare const NULL_LOGGER: Logger; /** * `console`-backed logger. Use when you want the engine's verbose trace * to print to stdout without wiring a custom backend. Each method maps * straight to the matching `console` call so spy-based tests that watch * `console.log` / `console.warn` keep working. */ export declare const CONSOLE_LOGGER: Logger; /** Default directive-type mapping for React Server Components. */ export declare const defaultGetDirectiveType: GetDirectiveTypeFn; /** Panic threshold for handleError-style escalation. */ export type PanicThreshold = "none" | "critical_errors" | "all_errors"; //# sourceMappingURL=options.d.ts.map