import { ApolloLink, NextLink, Operation, Observable } from "apollo-link"; import { NetworkStatus, OfflineQueueListener, OfflineMutationsHandler, OfflineStore } from "."; import { ObjectState } from "../conflicts"; import * as debug from "debug"; export declare const logger: debug.Debugger; export interface OfflineLinkOptions { networkStatus: NetworkStatus; store: OfflineStore; listener?: OfflineQueueListener; conflictStateProvider?: ObjectState; } /** * Apollo link implementation used to queue graphql requests. * * Link will push every incoming operation to queue. * All operations that are ready (i.e. they don't use client * generated ID) are forwarded to next link when: * * - client goes online * - there is a new operation and client is online * - operation was completed (which could result in ID updates, i.e. new * operations ready to be forwarded - see OfflineQueue class) */ export declare class OfflineLink extends ApolloLink { private online; private queue; private readonly networkStatus; private offlineMutationHandler?; constructor(options: OfflineLinkOptions); request(operation: Operation, forward: NextLink): Observable<{}>; /** * Force forward offline operations */ forwardOfflineOperations(): Promise; initOnlineState(): Promise; setup(handler: OfflineMutationsHandler): void; }