import { Emitter } from "@welshman/lib"; import { Filter, TrustedEvent } from "@welshman/util"; import { Tracker } from "../../tracker.js"; import { DeleteIndex } from "../core.js"; import type { Repository, RepositoryOptions, RepositoryUpdate, ObserveOptions, QueryOptions, CountTagsOptions } from "../core.js"; type AppliedFilter = { filter: Filter; ids: Set; }; /** A `Repository` that keeps everything in memory, indexed for the filters nostr asks. */ export declare class MemoryRepository extends Emitter implements Repository { tracker: Tracker; eventsById: Map; eventsByAddress: Map; eventsByTag: Map; eventsByDay: Map; eventsByAuthor: Map; eventsByKind: Map; deletes: DeleteIndex; expired: Map; replaced: Map; constructor({ tracker }?: RepositoryOptions); dump: () => TrustedEvent[]; load: (events: TrustedEvent[]) => void; query: (filters: Filter[], options?: QueryOptions) => Promise; count: (filters: Filter[], options?: QueryOptions) => Promise; countTags: (name: string, { signal }?: CountTagsOptions) => Promise>; getEvent: (idOrAddress: string) => Promise; isDeleted: (event: TrustedEvent) => boolean; observe: (options: ObserveOptions) => import("../../svelte.js").Unsubscriber; publish: (event: TrustedEvent) => Promise; removeEvent: (idOrAddress: string) => Promise; pendingWrites: () => undefined; clear: () => Promise; getEventSync: (idOrAddress: string) => TrustedEvent | undefined; querySync: (filters: Filter[], { includeDeleted, includeExpired, relay }?: QueryOptions) => TrustedEvent[]; publishSync: (event: TrustedEvent) => boolean; removeEventSync: (idOrAddress: string) => void; isExpired: (event: TrustedEvent) => boolean; _queryOne: (filter: Filter, options: QueryOptions) => TrustedEvent[]; _walkDays(filter: Filter): Generator; _collect: (candidates: Iterable, filter: Filter, options: QueryOptions) => TrustedEvent[]; _isIncluded: (event: TrustedEvent, { includeDeleted, includeExpired, relay }: QueryOptions) => boolean; _getEvents: (ids: Iterable) => TrustedEvent[]; _applyIdsFilter: (filter: Filter) => { filter: Filter; ids: Set; } | undefined; _applyAuthorsFilter: (filter: Filter) => { filter: Filter; ids: Set; } | undefined; _applyTagsFilter: (filter: Filter) => { filter: Filter; ids: Set; } | undefined; _applyKindsFilter: (filter: Filter) => { filter: Filter; ids: Set; } | undefined; _applyDaysFilter: (filter: Filter) => { filter: Filter; ids: Set; } | undefined; _applySelectiveFilter: (filter: Filter) => AppliedFilter | undefined; _applyBroadFilter: (filter: Filter) => AppliedFilter | undefined; _applyFirst: (filter: Filter, matchers: ((filter: Filter) => AppliedFilter | undefined)[]) => AppliedFilter | undefined; _publish: (event: TrustedEvent) => RepositoryUpdate | undefined; _emitUpdates: (updates: RepositoryUpdate[]) => void; _replaceEvent: (existing: TrustedEvent, event: TrustedEvent) => void; _eachIndex: (event: TrustedEvent, f: (index: Map, key: K) => void) => void; _index: (event: TrustedEvent) => void; _unindex: (event: TrustedEvent) => void; _undelete: (id: string) => TrustedEvent[]; _isVisible: (event: TrustedEvent) => boolean; } export {}; //# sourceMappingURL=memory.d.ts.map