import { type ValueKey } from '../applog/applog-utils.ts'; import { Applog, EntityID } from '../applog/datom-types.ts'; import { type Subscribable } from '../query/subscribable.ts'; import { Thread } from './basic.ts'; /** * Live index of applogs grouped by entity ID. Memoized per thread — one subscription * per thread regardless of how many consumers call this. Updated incrementally on * each parent event (O(event-size)). Lookup is O(1) via `map.get(en)`. * * Subscriber order: registers a 'derived' subscription on `thread` at first call. By * the FIFO subscriber-order convention (`thread/basic.ts:notifySubscribers`), * consumers that subscribe to `thread` AFTER calling `applogsByEntity(thread)` will * see an up-to-date index when their handler runs. */ export declare const applogsByEntity: (thread: Thread) => ReadonlyMap; /** * Live index of applogs grouped by value for a given attribute. Value-based counterpart * to `applogsByEntity` (which groups by entity ID). * * Uses `rollingFilter` internally for the attribute filter (memoized, shared with any * other code filtering by the same attribute). * * Returns a `Subscribable` with lazy upstream activation: * - Snapshot use: read `.value` — zero subscription overhead * - Reactive use: `.subscribe()` activates the chain for incremental updates */ export declare const applogsByAttrValue: (thread: Thread, attr: string) => Subscribable>; export interface LinkEntry { /** The link entity's own ID */ linkId: EntityID; /** Value of attrA on this link entity */ aValue: EntityID; /** Value of attrB on this link entity */ bValue: EntityID; } export interface EntityLinkIndexValue { /** Lookup by attrA value → link entries (each has linkId + bValue) */ byA: ReadonlyMap; /** Lookup by attrB value → link entries (each has linkId + aValue) */ byB: ReadonlyMap; } /** * Live bidirectional index for entity-link relations: a common wovin pattern where * a **link entity** connects two targets via two attributes. * * Example: note3 relations use a relation entity with `relation/block` (→ child block) * and `relation/childOf` (→ parent block). * * Returns a `Subscribable` with lazy upstream activation: * - Snapshot use: read `.value` — zero subscription overhead * - Reactive use: `.subscribe()` activates the chain for incremental updates * * Link entity IDs are included in entries so consumers can look up full link state * via `applogsByEntity`. */ export declare const entityLinkIndex: (thread: Thread, attrA: string, attrB: string) => Subscribable; //# sourceMappingURL=indexes.d.ts.map