///
import * as React from 'react';
import { ApolloError } from 'apollo-client';
import { DocumentNode } from 'graphql';
import { OperationVariables } from './types';
export interface SubscriptionResult {
loading: boolean;
data?: TData;
error: ApolloError;
}
export interface SubscriptionProps {
query: DocumentNode;
variables?: OperationVariables;
children: (result: any) => React.ReactNode;
}
export interface SubscriptionState {
loading: boolean;
data?: TData;
error?: ApolloError;
}
declare class Subscription extends React.Component> {
static contextTypes: {
client: any;
};
private client;
private queryObservable;
private querySubscription;
constructor(props: SubscriptionProps, context: any);
componentDidMount(): void;
componentWillReceiveProps(nextProps: any, nextContext: any): void;
componentWillUnmount(): void;
render(): React.ReactNode;
private initialize;
private startSubscription;
private getInitialState;
private updateCurrentData;
private updateError;
private endSubscription;
}
export default Subscription;