import type { CompiledQuery } from "kysely"; import type { LixEngine } from "./boot.js"; type EngineForCache = Pick; type ExecuteResult = ReturnType; /** * Executes an internal compiled query once per engine instance and serves future callers from cache. * * Uses `engine.runtimeCacheRef` as a stable WeakMap key, subscribes to `onStateCommit`, and * invalidates cached results when relevant entities, schema keys, or version IDs change. * * @example * ```ts * const [config] = withRuntimeCache( * engine, * internalQueryBuilder * .selectFrom("lix_internal_state_vtable") * .where("entity_id", "=", "lix_deterministic_mode") * .where("schema_key", "=", "lix_key_value") * .select(sql`json_extract(snapshot_content, '$.value.enabled')`.as("enabled")) * .limit(1) * .compile() * ).rows; * ``` */ export declare function withRuntimeCache(engine: EngineForCache, compiled: CompiledQuery): ExecuteResult; export {}; //# sourceMappingURL=with-runtime-cache.d.ts.map