import type { GraphileConfig } from 'graphile-config'; import type { GraphQLSchema } from 'graphql'; import type { Client as GqlWsClient } from 'graphql-ws'; import type { Pool } from 'pg'; import type { GetConnectionOpts } from 'pgsql-test'; import type { SeedAdapter } from 'pgsql-test/seed/types'; import type { PgTestClient } from 'pgsql-test/test-client'; import { makePgService } from 'postgraphile/adaptors/pg'; export interface GetConnectionsInput extends GetConnectionOpts { schemas: string[]; authRole?: string; useRoot?: boolean; preset?: GraphileConfig.Preset; smartTags?: Record>; realtimeTables?: string[]; realtimeOptions?: { overflowThreshold?: number; }; buildPgSettings?: (connectionParams: Record) => Record | undefined; } export interface WsHandle { serverUrl: string; createClient(connectionParams?: Record): GqlWsClient; nextEvent>(client: GqlWsClient, query: string, variables?: Record, timeoutMs?: number): Promise; collectEvents>(client: GqlWsClient, query: string, variables?: Record): { events: T[]; unsubscribe: () => void; }; dispose(): Promise; } export interface GetConnectionsResult { pg: PgTestClient; db: PgTestClient; schema: GraphQLSchema; resolvedPreset: GraphileConfig.ResolvedPreset; pgPool: Pool; pgService: ReturnType; pgSubscriber: unknown; ws: WsHandle; notifyChange(table: string, operation: 'INSERT' | 'UPDATE' | 'DELETE', rowIds: string[], schema?: string): Promise; notifyInvalidate(table: string, schema?: string): Promise; notify(table: string, payload: string, schema?: string): Promise; teardown(): Promise; } export declare function getConnections(input: GetConnectionsInput, seedAdapters?: SeedAdapter[]): Promise;