/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { type MergeTree } from "./mergeTree.js";
import { type ISegmentLeaf } from "./mergeTreeNodes.js";
import { type IInsertionInfo, type IMoveInfo, type IRemovalInfo, type SegmentWithInfo } from "./segmentInfos.js";
/**
 * Provides a view of a MergeTree from the perspective of a specific client at a specific sequence number.
 */
export interface Perspective {
    nextSegment(segment: ISegmentLeaf, forward?: boolean): ISegmentLeaf;
    previousSegment(segment: ISegmentLeaf): ISegmentLeaf;
}
/**
 * Represents a point in time inside the collaboration window.
 */
export interface SeqTime {
    refSeq: number;
    localSeq?: number;
}
/**
 * Implementation of {@link Perspective}.
 * @privateRemarks
 * TODO:AB#29765: This class does not support non-local-client perspectives, but should.
 */
export declare class PerspectiveImpl implements Perspective {
    private readonly _mergeTree;
    private readonly _seqTime;
    /**
     * @param _mergeTree - The {@link MergeTree} to view.
     * @param _seqTime - The latest sequence number and local sequence number to consider.
     */
    constructor(_mergeTree: MergeTree, _seqTime: SeqTime);
    /**
     * Returns the immediately adjacent segment in the specified direction from this perspective.
     * There may actually be multiple segments between the given segment and the returned segment,
     * but they were either inserted after this perspective, or have been removed or moved before this perspective.
     *
     * @param segment - The segment to start from.
     * @param forward - The direction to search.
     * @returns the next segment in the specified direction, or the start or end of the tree if there is no next segment.
     */
    nextSegment(segment: ISegmentLeaf, forward?: boolean): ISegmentLeaf;
    /**
     * Finds the segment prior to the given segment.
     * @param segment - The segment to start from.
     * @returns the previous segment, or the start of the tree if there is no previous segment.
     * @remarks This is a convenient equivalent to calling `nextSegment(segment, false)`.
     */
    previousSegment(segment: ISegmentLeaf): ISegmentLeaf;
}
/**
 * Determines if the given segment was removed before the given perspective.
 * @param seg - The segment to check.
 * @param seq - The latest sequence number to consider.
 * @param localSeq - The latest local sequence number to consider.
 * @returns true iff this segment was removed in the given perspective.
 * @privateRemarks
 * TODO:AB#29765: This function does not support non-local-client perspectives, but should.
 */
export declare function wasRemovedBefore(seg: SegmentWithInfo<IInsertionInfo & IRemovalInfo>, { refSeq, localSeq }: SeqTime): boolean;
/**
 * Determines if the given segment was moved before the given perspective.
 * @param seg - The segment to check.
 * @param refSeq - The latest sequence number to consider.
 * @param localSeq - The latest local sequence number to consider.
 * @returns true iff this segment was moved (aka obliterated) in the given perspective.
 * @privateRemarks
 * TODO:AB#29765: This function does not support non-local-client perspectives, but should.
 */
export declare function wasMovedBefore(seg: SegmentWithInfo<IInsertionInfo & IMoveInfo>, { refSeq, localSeq }: SeqTime): boolean;
/**
 * See {@link wasRemovedBefore} and {@link wasMovedBefore}.
 * @privateRemarks
 * TODO:AB#29765: This function does not support non-local-client perspectives, but should.
 */
export declare function wasRemovedOrMovedBefore(seg: ISegmentLeaf, seqTime: SeqTime): boolean;
/**
 * Determines if the given segment is present in the given perspective.
 * @param seg - The segment to check.
 * @param seqTime - The latest sequence number and local sequence number to consider.
 * @returns true iff this segment was inserted before the given perspective,
 * and it was not removed or moved in the given perspective.
 * @privateRemarks
 * TODO:AB#29765: This function does not support non-local-client perspectives, but should.
 */
export declare function isSegmentPresent(seg: ISegmentLeaf, seqTime: SeqTime): boolean;
//# sourceMappingURL=perspective.d.ts.map