import { NetworkInterface } from './networkInterface'; import { ApolloStore, Store } from './store'; import { QueryStoreValue } from './queries/store'; import { QueryTransformer } from './queries/queryTransform'; import { GraphQLResult, Document } from 'graphql'; import { Observable, Observer, Subscription } from './util/Observable'; export declare class ObservableQuery extends Observable { subscribe(observer: Observer): QuerySubscription; result(): Promise; } export interface QuerySubscription extends Subscription { refetch(variables?: any): Promise; stopPolling(): void; startPolling(pollInterval: number): void; } export interface WatchQueryOptions { query: Document; variables?: { [key: string]: any; }; forceFetch?: boolean; returnPartialData?: boolean; pollInterval?: number; } export declare type QueryListener = (queryStoreValue: QueryStoreValue) => void; export declare class QueryManager { private networkInterface; private store; private reduxRootKey; private pollingTimers; private queryTransformer; private queryListeners; private idCounter; private scheduler; private batcher; private batcherPollInterval; constructor({networkInterface, store, reduxRootKey, queryTransformer, shouldBatch}: { networkInterface: NetworkInterface; store: ApolloStore; reduxRootKey: string; queryTransformer?: QueryTransformer; shouldBatch?: Boolean; }); broadcastNewStore(store: any): void; mutate({mutation, variables}: { mutation: Document; variables?: Object; }): Promise; queryListenerForObserver(options: WatchQueryOptions, observer: Observer): QueryListener; watchQuery(options: WatchQueryOptions): ObservableQuery; query(options: WatchQueryOptions): Promise; fetchQuery(queryId: string, options: WatchQueryOptions): Promise; generateQueryId(): string; stopQueryInStore(queryId: string): void; getApolloState(): Store; addQueryListener(queryId: string, listener: QueryListener): void; removeQueryListener(queryId: string): void; private fetchQueryOverInterface(queryId, options, network); private startQuery(options, listener); private stopQuery(queryId); private broadcastQueries(); private generateRequestId(); }