import ApolloClient from "apollo-client"; import { NormalizedCacheObject } from "apollo-cache-inmemory"; import { OfflineItem } from "./OperationQueueEntry"; import * as debug from "debug"; import { DataSyncConfig } from "../config"; import { Operation } from "apollo-link"; export declare const logger: debug.Debugger; /** * Class used to send offline changes again after error is sent to user or after application restart. * It will trigger saved offline mutations using client to restore all elements in the link. */ export declare class OfflineMutationsHandler { private apolloClient; private store; private mutationCacheUpdates?; constructor(apolloClient: ApolloClient, clientConfig: DataSyncConfig); /** * Replay mutations to client. * This operation will help to rebuild Apollo Link observer chain * after page refresh/app restart */ replayOfflineMutations: () => Promise; /** * Perform mutation using client replicating parameters that user provided into * * @param item */ mutateOfflineElement(item: OfflineItem): Promise; /** * Add info to operation that was done when offline */ getOfflineContext(): { isOffline: boolean; }; /** * Checks if operation was scheduled to saved to offline queue. * This operations have special handling. * They are never forwarded when sent back again to client. */ static isMarkedOffline(operation: Operation): boolean; }