import type { DocumentNode, IntrospectionQuery } from 'graphql'; import type { Client, ClientOptions } from 'graphql-ws'; import type { SubscriptionClient } from 'subscriptions-transport-ws'; export declare type Observable = { subscribe(opts: { next: (value: T) => void; error: (error: any) => void; complete: () => void; }): Unsubscribable; subscribe(next: (value: T) => void, error: null | undefined, complete: () => void): Unsubscribable; subscribe(next?: (value: T) => void, error?: (error: any) => void, complete?: () => void): Unsubscribable; }; export declare type Unsubscribable = { unsubscribe: () => void; }; export declare type FetcherParams = { query: string; operationName: string; variables?: any; }; export declare type FetcherOpts = { headers?: { [key: string]: any; }; shouldPersistHeaders?: boolean; documentAST?: DocumentNode; }; export declare type FetcherResultPayload = { data: IntrospectionQuery; errors?: Array; } | { data?: any; errors?: Array; } | { data?: any; errors?: Array; hasNext: boolean; } | { data?: any; errors?: any[]; path: (string | number)[]; hasNext: boolean; }; export declare type FetcherResult = FetcherResultPayload | string; export declare type MaybePromise = T | Promise; export declare type SyncFetcherResult = FetcherResult | Observable | AsyncIterable; export declare type FetcherReturnType = MaybePromise; export declare type Fetcher = (graphQLParams: FetcherParams, opts?: FetcherOpts) => FetcherReturnType; export declare type WebsocketsClient = Client | SubscriptionClient; export interface CreateFetcherOptions { url: string; subscriptionUrl?: string; wsClient?: Client; legacyClient?: SubscriptionClient; headers?: Record; wsConnectionParams?: ClientOptions['connectionParams']; enableIncrementalDelivery?: boolean; fetch?: typeof fetch; schemaFetcher?: Fetcher; } //# sourceMappingURL=types.d.ts.map