import type { Schema } from 'effect'; import { type Context, Resource } from '@dxos/context'; import { EchoHost, type EchoHostIndexingConfig } from '@dxos/echo-pipeline'; import { PublicKey } from '@dxos/keys'; import { type LevelDB } from '@dxos/kv-store'; import { EchoClient } from '../client'; import { type EchoDatabase } from '../proxy-db'; type OpenDatabaseOptions = { client?: EchoClient; reactiveSchemaQuery?: boolean; preloadSchemaOnOpen?: boolean; }; type PeerOptions = { kv?: LevelDB; indexing?: Partial; types?: Schema.Schema.AnyNoContext[]; }; export declare class EchoTestBuilder extends Resource { private readonly _peers; get lastPeer(): EchoTestPeer | undefined; protected _close(ctx: Context): Promise; createPeer(options?: PeerOptions): Promise; /** * Shorthand for creating a peer and a database. */ createDatabase(options?: PeerOptions): Promise<{ peer: EchoTestPeer; host: EchoHost; db: import("..").EchoDatabaseImpl; graph: import("..").Hypergraph; crud: import("..").CoreDatabase; }>; } export declare class EchoTestPeer extends Resource { private readonly _kv; private readonly _indexing; private readonly _types; private readonly _clients; private _queuesService; private _echoHost; private _echoClient; private _lastDatabaseSpaceKey?; private _lastDatabaseRootUrl?; constructor({ kv, indexing, types }: PeerOptions); private _initEcho; get client(): EchoClient; get host(): EchoHost; protected _open(ctx: Context): Promise; protected _close(ctx: Context): Promise; /** * Simulates a reload of the process by re-creation ECHO. */ reload(): Promise; createClient(): Promise; createDatabase(spaceKey?: PublicKey, { client, reactiveSchemaQuery, preloadSchemaOnOpen }?: OpenDatabaseOptions): Promise; openDatabase(spaceKey: PublicKey, rootUrl: string, { client, reactiveSchemaQuery, preloadSchemaOnOpen }?: OpenDatabaseOptions): Promise; openLastDatabase({ client, reactiveSchemaQuery, preloadSchemaOnOpen }?: OpenDatabaseOptions): Promise; } export declare const createDataAssertion: ({ referenceEquality, onlyObject, numObjects, }?: { referenceEquality?: boolean; onlyObject?: boolean; numObjects?: number; }) => { seed: (db: EchoDatabase) => Promise; waitForReplication: (db: EchoDatabase) => Promise>; verify: (db: EchoDatabase) => Promise; }; export {}; //# sourceMappingURL=echo-test-builder.d.ts.map