import type { TargetType } from "./aberdeen.js"; /** * Represents a set of changes that can be applied to proxied objects. * This is an opaque type - its internal structure is not part of the public API. * @private */ export type Patch = Map>; /** * Run the provided function, while treating all changes to Observables as predictions, * meaning they will be reverted when changes come back from the server (or some other * async source). * @param predictFunc The function to run. It will generally modify some Observables * to immediately reflect state (as closely as possible) that we expect the server * to communicate back to us later on. * @returns A `Patch` object. Don't modify it. This is only meant to be passed to `applyCanon`. */ export declare function applyPrediction(predictFunc: () => void): Patch; /** * Temporarily revert all outstanding predictions, optionally run the provided function * (which will generally make authoritative changes to the data based on a server response), * and then attempt to reapply the predictions on top of the new canonical state, dropping * any predictions that can no longer be applied cleanly (the data has been modified) or * that were specified in `dropPredictions`. * * All of this is done such that redraws are only triggered if the overall effect is an * actual change to an `Observable`. * @param canonFunc The function to run without any predictions applied. This will typically * make authoritative changes to the data, based on a server response. * @param dropPredictions An optional list of predictions (as returned by `applyPrediction`) * to undo. Typically, when a server response for a certain request is being handled, * you'd want to drop the prediction that was done for that request. */ export declare function applyCanon(canonFunc?: () => void, dropPredictions?: Array): void;