/** * Lazy-mode capability contract (#267 Track A tail — lazy-mode promoted out * of `routing` into its own `lazy` service). Lives on the `/with` port (the * one seam the kernel spine may import statically) so `Collection` can hold * the back-compat default without a spine→service static import. * * Lazy mode (`prefetch: false`) skips bulk hydration: reads go per-id * against the store and land in a bounded LRU working set. The strategy owns * constructing that LRU: * * - `withLazy()` (`with-store/lazy/active.ts`, subpath `@noy-db/hub/lazy`) * is the explicit catalog opt-in — silent, forward-stable. * - {@link IMPLICIT_LAZY} is the floor default reached when a collection * declares `prefetch: false` WITHOUT `lazyStrategy: withLazy()`. It keeps * the pre-#267 behavior byte-for-byte (back-compat delegation, pre-1.0) * but emits a one-time deprecation warn outside test env. It will become * a throwing stub at 1.0, letting the LRU leave the floor bundle * entirely once the per-record-CEK cache stops pinning `Lru` there. * * The on-demand read/write branches themselves stay kernel-resident (they * are `if (this.lazy)` forks on the hot get/put/scan paths); the service * seam owns cache construction + budget validation, which is where the * opt-in and the future tree-shake win live. * @internal */ import { Lru } from '../../kernel/cache/index.js'; import type { CacheOptions } from '../../kernel/collection.js'; export interface LazyStrategy { /** * Build the bounded LRU working-set cache for a lazy collection. * MUST throw when `cache` declares neither `maxRecords` nor `maxBytes` — * an unbounded lazy cache defeats the purpose. */ createCache(collection: string, cache: CacheOptions | undefined): Lru; } /** * Shared budget validation + LRU construction — the one implementation both * {@link IMPLICIT_LAZY} and `withLazy()` run, so the two paths cannot drift. * @internal */ export declare function buildLazyCache(collection: string, cache: CacheOptions | undefined): Lru; /** * Back-compat default (deprecated): `prefetch: false` without * `lazyStrategy: withLazy()`. Identical behavior to the explicit opt-in, * plus a one-time deprecation warn (suppressed under NODE_ENV=test, * mirroring the listPage fallback warn). @internal */ export declare const IMPLICIT_LAZY: LazyStrategy;