/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { RevisionTag } from "../../core";
import { Brand, NestedSet } from "../../util";
import { IdAllocator } from "./fieldChangeHandler";
export declare type CrossFieldQuerySet = NestedSet<RevisionTag | undefined, ChangesetLocalId>;
/**
 * @alpha
 */
export declare enum CrossFieldTarget {
    Source = 0,
    Destination = 1
}
/**
 * Used by {@link FieldChangeHandler} implementations for exchanging information across other fields
 * while rebasing, composing, or inverting a change.
 * @alpha
 */
export interface CrossFieldManager<T = unknown> {
    /**
     * Returns the data associated with triplet key of `target`, `revision`, and `id`.
     * Calling this records a dependency for the current field on this key if `addDependency` is true.
     */
    get(target: CrossFieldTarget, revision: RevisionTag | undefined, id: ChangesetLocalId, addDependency: boolean): T | undefined;
    /**
     * If there is no data for this key, sets the value to `newValue`.
     * Then returns the data for this key.
     * If `invalidateDependents` is true, all fields which took a dependency on this key will be considered invalidated
     * and will be given a chance to address the new data in `amendRebase`, `amendInvert`, or `amendCompose`,
     * as appropriate.
     */
    getOrCreate(target: CrossFieldTarget, revision: RevisionTag | undefined, id: ChangesetLocalId, newValue: T, invalidateDependents: boolean): T;
}
/**
 * An ID which is unique within a revision of a `ModularChangeset`.
 * A `ModularChangeset` which is a composition of multiple revisions may contain duplicate `ChangesetLocalId`s,
 * but they are unique when qualified by the revision of the change they are used in.
 * @alpha
 */
export declare type ChangesetLocalId = Brand<number, "ChangesetLocalId">;
export declare const ChangesetLocalIdSchema: import("@sinclair/typebox").TUnsafe<ChangesetLocalId>;
export interface IdAllocationState {
    maxId: ChangesetLocalId;
}
/**
 * @alpha
 */
export declare function idAllocatorFromMaxId(maxId?: ChangesetLocalId | undefined): IdAllocator;
export declare function idAllocatorFromState(state: IdAllocationState): IdAllocator;
//# sourceMappingURL=crossFieldQueries.d.ts.map