import type { Client } from 'graphql-ws'; import { GQtyError } from '../../Error'; import type { LegacySelection as Selection } from './selection'; type Promisable = T | Promise; export type LegacySubscriptionsClient = Record> = { subscribe(opts: { query: string; variables: Record | undefined; selections: Selection[]; events: ((ctx: { selections: Selection[]; query: string; variables: Record | undefined; operationId: string; }) => LegacySubscribeEvents) | LegacySubscribeEvents; cacheKey?: string; }): Promisable<{ unsubscribe: () => Promise; operationId: string; }>; unsubscribe(selections: Selection[] | Set): Promise; close(): Promise; setConnectionParams(connectionParams: (() => Promisable>) | Record, restartClient?: boolean): void; }; export interface LegacySubscribeEvents = Record> { onData: (data: TData) => void; onError: (payload: { error: GQtyError; data: TData | null; }) => void; onStart?: () => void; onComplete?: () => void; } export declare const createLegacySubscriptionsClient: (subscriptionsClient: LegacySubscriptionsClient) => Client; export {};