/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { SessionId } from "@fluidframework/id-compressor";
import { ChangeFamily, ChangeRebaser, ChangeFamilyEditor, DeltaRoot } from "../../../core/index.js";
import { TestChangeFamily, TestChange } from "../../testChange.js";
import { EditManager } from "../../../shared-tree-core/index.js";
import { RecursiveReadonly } from "../../../util/index.js";
export type TestEditManager = EditManager<ChangeFamilyEditor, TestChange, TestChangeFamily>;
export declare function testChangeEditManagerFactory(options: {
    rebaser?: ChangeRebaser<TestChange>;
    sessionId?: SessionId;
    autoDiscardRevertibles?: boolean;
}): {
    manager: TestEditManager;
    family: ChangeFamily<ChangeFamilyEditor, TestChange>;
};
export declare function editManagerFactory<TChange = TestChange>(family: ChangeFamily<any, TChange>, options?: {
    sessionId?: SessionId;
    autoDiscardRevertibles?: boolean;
}): EditManager<ChangeFamilyEditor, TChange, ChangeFamily<ChangeFamilyEditor, TChange>>;
/**
 * Simulates the following inputs to the EditManager:
 * - Apply local edit L1 with a ref seq# pointing to edit 0
 * ...(not incrementing the ref seq# for each L)
 * - Apply local edit Lc with a ref seq# pointing to edit 0
 * -- we start measuring from here
 * - Sequence trunk edit T1 with a ref seq# pointing to edit 0
 * ...(incrementing the ref seq# for each T)
 * - Sequence trunk edit Tc with a ref seq# pointing to edit Tc-1
 *
 * This defines the following relationships between edits:
 * ```text
 * (0)─(T1)─...─(Tc)
 *   └───────────────(L1)─...─(Lc)
 * ```
 *
 * @param localEditCount - The number of local edits to generate
 * @param trunkEditCount - The number of trunk edits to generate
 * @param manager - The edit manager to apply the edits to
 * @param mintChange - A function used to generate new changes
 */
export declare function rebaseLocalEditsOverTrunkEdits<TChange>(localEditCount: number, trunkEditCount: number, manager: EditManager<ChangeFamilyEditor, TChange, ChangeFamily<ChangeFamilyEditor, TChange>>, mintChange: () => TChange): void;
/**
 * Simulates the following inputs to the EditManager:
 * - Apply local edit L1 with a ref seq# pointing to edit 0
 * ...(not incrementing the ref seq# for each L)
 * - Apply local edit Lc with a ref seq# pointing to edit 0
 * -- inputs below this point are deferred until the returned thunk is invoked --
 * - Sequence trunk edit T1 with a ref seq# pointing to edit 0
 * ...(incrementing the ref seq# for each T)
 * - Sequence trunk edit Tc with a ref seq# pointing to edit Tc-1
 *
 * This defines the following relationships between edits:
 * ```text
 * (0)─(T1)─...─(Tc)
 *   └───────────────(L1)─...─(Lc)
 * ```
 *
 * @param localEditCount - The number of local edits to generate
 * @param trunkEditCount - The number of trunk edits to generate
 * @param manager - The edit manager to apply the edits to
 * @param mintChange - A function used to generate new changes
 * @param defer - Used to invoke this specific overload.
 * @returns A thunk that will apply the local edits when invoked.
 */
export declare function rebaseLocalEditsOverTrunkEdits<TChange>(localEditCount: number, trunkEditCount: number, manager: EditManager<ChangeFamilyEditor, TChange, ChangeFamily<ChangeFamilyEditor, TChange>>, mintChange: () => TChange, defer: true): () => void;
/**
 * Simulates the following inputs to the EditManager:
 * - Sequence trunk edit T1 with a ref seq# pointing to edit 0
 * ...(incrementing the ref seq# for each T)
 * - Sequence trunk edit Tc with a ref seq# pointing to edit Tc-1
 * - Sequence peer edit P1 with a ref seq# pointing to edit 0
 * ...(not incrementing the ref seq# for each P)
 * - Sequence peer edit Pc with a ref seq# pointing to edit 0
 *
 * This defines the following relationships between edits:
 * ```text
 * (0)─(T1)─...─(Tc)
 *   └───────────────(P1)─...─(Pc)
 * ```
 *
 * @param peerEditCount - The number of peer edits to generate
 * @param trunkEditCount - The number of trunk edits to generate
 * @param manager - The edit manager to apply the edits to
 * @param mintChange - A function used to generate new changes
 */
export declare function rebasePeerEditsOverTrunkEdits<TChange>(peerEditCount: number, trunkEditCount: number, manager: EditManager<ChangeFamilyEditor, TChange, ChangeFamily<ChangeFamilyEditor, TChange>>, mintChange: () => TChange): void;
/**
 * Simulates the following inputs to the EditManager:
 * - Sequence trunk edit T1 with a ref seq# pointing to edit 0
 * ...(incrementing the ref seq# for each T)
 * - Sequence trunk edit Tc with a ref seq# pointing to edit Tc-1
 * -- inputs below this point are deferred until the returned thunk is invoked --
 * - Sequence peer edit P1 with a ref seq# pointing to edit 0
 * ...(not incrementing the ref seq# for each P)
 * - Sequence peer edit Pc with a ref seq# pointing to edit 0
 *
 * This defines the following relationships between edits:
 * ```text
 * (0)─(T1)─...─(Tc)
 *   └───────────────(P1)─...─(Pc)
 * ```
 *
 * @param peerEditCount - The number of peer edits to generate
 * @param trunkEditCount - The number of trunk edits to generate
 * @param manager - The edit manager to apply the edits to
 * @param mintChange - A function used to generate new changes
 * @param defer - Used to invoke this specific overload.
 * @returns A thunk that will apply the peer edits when invoked.
 */
export declare function rebasePeerEditsOverTrunkEdits<TChange>(peerEditCount: number, trunkEditCount: number, manager: EditManager<ChangeFamilyEditor, TChange, ChangeFamily<ChangeFamilyEditor, TChange>>, mintChange: () => TChange, defer: true): () => void;
/**
 * Simulates the following inputs to the EditManager:
 * - Sequence trunk edit T1 with a ref seq# pointing to edit 0
 * ...(incrementing the ref seq# for each T)
 * - Sequence trunk edit Tc with a ref seq# pointing to edit Tc-1
 * - Sequence peer edit P1 with a ref seq# pointing to edit 0
 * ...(incrementing the ref seq# for each P)
 * - Sequence peer edit Pc with a ref seq# pointing to edit Tc-1
 *
 * This defines the following relationships between edits:
 * ```text
 * (0)─(T1)─...─(Tc─1)─(Tc)
 *   |    |          └──────(P1)─(P2)─...─(Pc)
 *   |    └─────────────────(P1)─(P2)
 *   └──────────────────────(P1)
 * ```
 *
 * @param editCount - The number of peer and trunk edits to generate.
 * The total number of edits generated will be twice that.
 * @param manager - The edit manager to apply the edits to
 * @param mintChange - A function used to generate new changes
 */
export declare function rebaseAdvancingPeerEditsOverTrunkEdits<TChange>(editCount: number, manager: EditManager<ChangeFamilyEditor, TChange, ChangeFamily<ChangeFamilyEditor, TChange>>, mintChange: () => TChange): void;
/**
 * Simulates the following inputs to the EditManager:
 * - Sequence trunk edit T1 with a ref seq# pointing to edit 0
 * ...(incrementing the ref seq# for each T)
 * - Sequence trunk edit Tc with a ref seq# pointing to edit Tc-1
 * -- inputs below this point are deferred until the returned thunk is invoked --
 * - Sequence peer edit P1 with a ref seq# pointing to edit 0
 * ...(incrementing the ref seq# for each P)
 * - Sequence peer edit Pc with a ref seq# pointing to edit Tc-1
 *
 * This defines the following relationships between edits:
 * ```text
 * (0)─(T1)─...─(Tc─1)─(Tc)
 *   |    |          └──────(P1)─(P2)─...─(Pc)
 *   |    └─────────────────(P1)─(P2)
 *   └──────────────────────(P1)
 * ```
 *
 * @param editCount - The number of peer and trunk edits to generate.
 * The total number of edits generated will be twice that.
 * @param manager - The edit manager to apply the edits to
 * @param mintChange - A function used to generate new changes
 * @param defer - Used to invoke this specific overload.
 * @returns A thunk that will apply the peer edits when invoked.
 */
export declare function rebaseAdvancingPeerEditsOverTrunkEdits<TChange>(editCount: number, manager: EditManager<ChangeFamilyEditor, TChange, ChangeFamily<ChangeFamilyEditor, TChange>>, mintChange: () => TChange, defer: true): () => void;
/**
 * Simulates the following inputs to the EditManager:
 * Each peer edit is sequenced in a round-robin fashion starting with the first edit from peer 1 then
 * the first edit from peer 2, etc. Then the second edit from each peer (in the same peer order) etc.
 * All edit have a reference sequence number of 0.
 *
 * This defines the following relationships between edits:
 * ```text
 * (0)
 *   ├─(P1E1)───────────────(P1E2)──────...──────(P1Ek)
 *   ├────────(P2E1)───────────────(P2E2)──────...──────(P2Ek)
 *   ├...
 *   └───────────────(PnE1)───────────────(PnE2)──────...──────(PnEk)
 * ```
 *
 * @param peerCount - The number of peer to generate edits for.
 * @param editCount - The number of edits to generate per peer.
 * @param manager - The edit manager to apply the edits to
 * @param mintChange - A function used to generate new changes
 */
export declare function rebaseConcurrentPeerEdits<TChange>(peerCount: number, editsPerPeerCount: number, manager: EditManager<ChangeFamilyEditor, TChange, ChangeFamily<ChangeFamilyEditor, TChange>>, mintChange: () => TChange, defer: true): () => void;
/**
 * Simulates the following inputs to the EditManager:
 * Each peer edit is sequenced in a round-robin fashion starting with the first edit from peer 1 then
 * the first edit from peer 2, etc. Then the second edit from each peer (in the same peer order) etc.
 * All edit have a reference sequence number of 0.
 *
 * This defines the following relationships between edits:
 * ```text
 * (0)
 *   ├─(P1E1)───────────────(P1E2)──────...──────(P1Ek)
 *   ├────────(P2E1)───────────────(P2E2)──────...──────(P2Ek)
 *   ├...
 *   └───────────────(PnE1)───────────────(PnE2)──────...──────(PnEk)
 * ```
 *
 * @param peerCount - The number of peer to generate edits for.
 * @param editCount - The number of edits to generate per peer.
 * @param manager - The edit manager to apply the edits to
 * @param mintChange - A function used to generate new changes
 * @param defer - Used to invoke this specific overload.
 * @returns A thunk that will apply the peer edits when invoked.
 */
export declare function rebaseConcurrentPeerEdits<TChange>(peerCount: number, editsPerPeerCount: number, manager: EditManager<ChangeFamilyEditor, TChange, ChangeFamily<ChangeFamilyEditor, TChange>>, mintChange: () => TChange): void;
export declare function checkChangeList(manager: TestEditManager, intentions: number[]): void;
export declare function getAllChanges(manager: TestEditManager): RecursiveReadonly<TestChange>[];
/** Adds a sequenced change to an `EditManager` and returns the delta that was caused by the change */
export declare function addSequencedChange(editManager: TestEditManager, ...args: Parameters<(typeof editManager)["addSequencedChange"]>): DeltaRoot;
//# sourceMappingURL=editManagerTestUtils.d.ts.map