import { Filter, Query } from '@dxos/echo'; import { type PublicKey, type SpaceId } from '@dxos/keys'; import { type Live } from '@dxos/live-object'; import { QueryOptions as QueryOptionsProto } from '@dxos/protocols/proto/dxos/echo/filter'; import { type QueryResult } from './query-result'; export { Filter, Query }; /** * `query` API function declaration. */ export interface QueryFn { (query: Q, options?: QueryOptions | undefined): QueryResult>>; (filter: F, options?: QueryOptions | undefined): QueryResult>>; } /** * Defines the result format of the query. */ export declare enum ResultFormat { /** * Plain javascript objects. * No live updates. */ Plain = "plain", /** * Live objects that update automatically with mutations in the database. * Support signal notifications. */ Live = "live", /** * Direct access to the automerge document. */ AutomergeDocAccessor = "automergeDocAccessor" } /** * @deprecated Use `Query.options` instead. */ export type QueryOptions = { /** * Query only in specific spaces. */ spaceIds?: string[]; /** * Controls how deleted items are filtered. * * Options: * - proto3_optional = true */ deleted?: QueryOptionsProto.ShowDeletedOption; /** * Query only local spaces, or remote on agent. * @default `QueryOptions.DataLocation.LOCAL` * * Options: * - proto3_optional = true */ dataLocation?: QueryOptionsProto.DataLocation; /** * Specify which references are to inline in the result. */ include?: QueryJoinSpec; /** * Return only the first `limit` results. */ limit?: number; /** * @deprecated Stick to live format. */ format?: ResultFormat; /** * @deprecated Use `spaceIds` instead. */ spaces?: PublicKey[]; }; export interface QueryJoinSpec extends Record { } export declare const optionsToProto: (options: QueryOptions) => QueryOptionsProto; type NormalizeQueryOptions = { defaultSpaceId?: SpaceId; }; export declare const normalizeQuery: (query_: unknown | undefined, userOptions: QueryOptions | undefined, opts?: NormalizeQueryOptions) => Query.Any; //# sourceMappingURL=api.d.ts.map