import * as Effect from 'effect/Effect'; import type * as SqlClient from 'effect/sql/SqlClient'; import { type Context } from '@dxos/context'; import * as RuntimeProvider from '@dxos/effect/RuntimeProvider'; import { type FeedOptions, type FeedStore } from '@dxos/feed'; import { type DataSourceCursor, type IndexDataSource, type IndexerObject } from '@dxos/index-core'; import type { SpaceId } from '@dxos/keys'; export type FeedDataSourceOptions = { feedStore: FeedStore; runtime: RuntimeProvider.RuntimeProvider; /** * Callback to get the list of space IDs that should be indexed. */ getSpaceIds: () => SpaceId[]; /** * Feed namespaces to index. * @default [WellKnownNamespaces.data, WellKnownNamespaces.trace] */ feedNamespaces?: string[]; }; /** The value a backfill cursor takes once it has read its feed to the end; the host then deletes it. */ export declare const BACKFILL_FINISHED = "done"; /** * Resource id of the cursor that backfills one feed, read by {@link FeedDataSource} beside the * namespace cursors; a host seeds it (`IndexEngine.seedCursor`) when a feed's indexing is re-enabled. */ export declare const backfillResourceId: (feedNamespace: string, feedId: string) => string; /** Whether the feed's index holds every branch; absent, it holds only the main branch. */ export declare const indexesAllBranches: (options: FeedOptions | undefined) => boolean; /** What one pass read beyond the objects it returned, for the host to act on once the pass ends. */ export type FeedPassReport = { /** Spaces whose feeds returned blocks, indexed or skipped; retention may have more to trim there. */ spaces: Set; /** * Feeds whose blocks were skipped because indexing is disabled or the block is on a branch the index * does not hold, keyed by space; their readers still need invalidating. */ skippedFeeds: Map>; /** Backfill cursors that reached {@link BACKFILL_FINISHED}, for the host to delete. */ finishedBackfills: Map>; }; export declare class FeedDataSource implements IndexDataSource { #private; readonly sourceName = "queue"; /** * Feed namespaces to index. */ private readonly _feedNamespaces; private readonly _feedStore; private readonly _runtime; private readonly _getSpaceIds; constructor(options: FeedDataSourceOptions); beginPass(): void; endPass(): void; /** What the passes since the last call read beyond their objects; resets the report. */ takeReport(): FeedPassReport; getChangedObjects(_ctx: Context, cursors: DataSourceCursor[], opts?: { limit?: number; objects?: boolean; }): Effect.Effect<{ objects: IndexerObject[]; cursors: DataSourceCursor[]; more: boolean; }>; } //# sourceMappingURL=feed-data-source.d.ts.map