UNPKG

971 BTypeScriptView Raw
1import { ApolloLink, Operation, FetchResult, Observable } from 'apollo-link';
2import { SubscriptionClient, ClientOptions } from 'subscriptions-transport-ws';
3export declare namespace WebSocketLink {
4 /**
5 * Configuration to use when constructing the subscription client (subscriptions-transport-ws).
6 */
7 interface Configuration {
8 /**
9 * The endpoint to connect to.
10 */
11 uri: string;
12 /**
13 * Options to pass when constructing the subscription client.
14 */
15 options?: ClientOptions;
16 /**
17 * A custom WebSocket implementation to use.
18 */
19 webSocketImpl?: any;
20 }
21}
22export import WebSocketParams = WebSocketLink.Configuration;
23export declare class WebSocketLink extends ApolloLink {
24 private subscriptionClient;
25 constructor(paramsOrClient: WebSocketLink.Configuration | SubscriptionClient);
26 request(operation: Operation): Observable<FetchResult> | null;
27}