import { ApolloLink, Operation, NextLink, Observable, FetchResult } from "apollo-link"; import { ConflictListener, ConflictResolutionData, ObjectState, ConflictResolutionStrategy } from "offix-conflicts-client"; import { InputMapper } from "../../config/ApolloOfflineClientOptions"; /** * Represents conflict information that was returned from server */ export interface ConflictInfo { serverState: ConflictResolutionData; clientState: ConflictResolutionData; returnType: string; } /** * Configuration for conflict resolution */ export interface ConflictConfig { /** * Interface that defines how object state is progressed * This interface needs to match state provider supplied on server. */ conflictProvider: ObjectState; /** * Interface that can be implemented to receive information about the data conflict * * @deprecated see OfflineClient.registerOfflineEventListener */ conflictListener?: ConflictListener; /** * The conflict resolution strategy your client should use. By default it takes client version. */ conflictStrategy?: ConflictResolutionStrategy; /** * [Modifier] * * Maps input objects for the cases if variables are not passed to the root * */ inputMapper?: InputMapper; } /** * Conflict handling link implementation that provides ability to determine whether or not a conflict should be handled. * Leverages Apollo's onError link to keep track of the observables and the retried operations. */ export declare class ConflictLink extends ApolloLink { private config; private stater; private link; private strategy; private listener; constructor(config: ConflictConfig); request(operation: Operation, forward: NextLink): Observable | null; private conflictHandler; /** * Fetch conflict data from the errors returned from the server * @param graphQLErrors array of errors to retrieve conflicted data from */ private getConflictData; }