import type { Context, IterationRequest, ResultIndexedValue, ResultValue, Results, SearchRequest, SearchRequestIndexed } from "@peerbit/document-interface"; import type * as indexerTypes from "@peerbit/indexer-interface"; import type { Program } from "@peerbit/program"; import type { SharedLogLike } from "@peerbit/shared-log"; import type { PeerRefs } from "@peerbit/stream-interface"; import type { CountEstimate } from "./program.js"; import type { GetOptions, QueryOptions, ReachScope, ResultsIterator, SearchOptions, ValueTypeFromRequest, WithContext, WithIndexedContext } from "./search.js"; export type DocumentsLikeQuery = SearchRequest | SearchRequestIndexed | IterationRequest | { query?: indexerTypes.QueryLike | indexerTypes.Query[]; sort?: indexerTypes.SortLike | indexerTypes.Sort | indexerTypes.Sort[]; }; export type DocumentsLikeWaitForOptions = { seek?: "any" | "present"; signal?: AbortSignal; timeout?: number; }; export type DocumentsLikeExactCountOptions = { query?: indexerTypes.Query | indexerTypes.QueryLike; approximate?: false | undefined; }; export type DocumentsLikeApproximateCountOptions = { query?: indexerTypes.Query | indexerTypes.QueryLike; approximate: true | { scope?: ReachScope; }; }; export type DocumentsLikeCountOptions = DocumentsLikeExactCountOptions | DocumentsLikeApproximateCountOptions; export type DocumentsLikeIndex = { get: (id: indexerTypes.Ideable | indexerTypes.IdKey, options?: GetOptions) => Promise | undefined>; getDetailed: (id: indexerTypes.IdKey | indexerTypes.IdPrimitive, options?: QueryOptions) => Promise> : ResultValue>>[] | undefined>; resolveId: (value: any) => indexerTypes.IdKey; iterate: (query?: DocumentsLikeQuery, options?: QueryOptions) => ResultsIterator>; search: (query: DocumentsLikeQuery, options?: SearchOptions) => Promise[]>; getSize: () => Promise | number; waitFor: (peers: PeerRefs, options?: DocumentsLikeWaitForOptions) => Promise; wrappedIndexedType?: new (value: I, context: Context) => WithContext; index?: { count?: (options?: indexerTypes.CountOptions) => Promise | number; getSize?: () => Promise | number; get?: (id: indexerTypes.IdKey, options?: { shape: indexerTypes.Shape; }) => Promise> | undefined> | indexerTypes.IndexedResult> | undefined; iterate?: (request?: indexerTypes.IterateOptions, options?: { shape?: indexerTypes.Shape; reference?: boolean; }) => indexerTypes.IndexIterator, indexerTypes.Shape | undefined>; put?: (value: WithContext) => Promise | void; }; }; export type DocumentsLike = { closed?: boolean; events: EventTarget; changes: EventTarget; index: DocumentsLikeIndex; log: SharedLogLike; put(doc: T, options?: unknown): Promise; get: (id: indexerTypes.Ideable | indexerTypes.IdKey, options?: Omit, "resolve">) => Promise; del(id: indexerTypes.Ideable | indexerTypes.IdKey, options?: unknown): Promise; count: { (options?: DocumentsLikeExactCountOptions): Promise; (options: DocumentsLikeApproximateCountOptions): Promise; }; waitFor: (peers: PeerRefs, options?: DocumentsLikeWaitForOptions) => Promise; recover: () => Promise; close: (from?: Program) => Promise; }; //# sourceMappingURL=like.d.ts.map