/** * Active indexing strategy factory. Calling `withIndexing()` returns * an `IndexStrategy` whose `createState` constructs a real * `CollectionIndexes` (eager) or `PersistedCollectionIndex` (lazy) * per Collection, depending on the collection's `prefetch` mode and * its declared `IndexDef[]`. * * This module is only reachable through the `@noy-db/hub/indexing` * subpath — a consumer that never imports the subpath ships none of * this (ESM tree-shaking + hub's `"sideEffects": false`). */ import type { IndexStrategy } from './strategy.js'; /** * Build the default indexing strategy. Pass into * `createNoydb({ indexStrategy: withIndexing() })` to light up the * eager-mode `==/in` fast-path on `.query()` and the full lazy-mode * `.lazyQuery()` + rebuild / reconcile / auto-reconcile surface. * * @example * ```ts * import { createNoydb } from '@noy-db/hub' * import { withIndexing } from '@noy-db/hub/indexing' * * const db = await createNoydb({ * store, user, secret, * indexStrategy: withIndexing(), * }) * ``` */ export declare function withIndexing(): IndexStrategy;