/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { Client } from "./client";
import { List } from "./collections";
import { ISegment } from "./mergeTree";
import { ICombiningOp, ReferenceType } from "./ops";
import { PropertySet } from "./properties";
import { ReferencePosition } from "./referencePositions";
/**
 * @internal
 */
export declare function _validateReferenceType(refType: ReferenceType): void;
export interface LocalReferencePosition extends ReferencePosition {
    callbacks?: Partial<Record<"beforeSlide" | "afterSlide", () => void>>;
}
/**
 * @deprecated - Use LocalReferencePosition
 */
export declare class LocalReference implements LocalReferencePosition {
    private readonly client;
    /**
     * @deprecated - use getOffset
     */
    offset: number;
    refType: ReferenceType;
    /**
     * @deprecated - use DetachedReferencePosition
     */
    static readonly DetachedPosition: number;
    properties: PropertySet | undefined;
    /**
     * @deprecated - use properties to store pair
     */
    pairedRef?: LocalReference;
    /**
     * @deprecated - use getSegment
     */
    segment: ISegment | undefined;
    callbacks?: Partial<Record<"beforeSlide" | "afterSlide", () => void>> | undefined;
    /**
     * @deprecated - use createReferencePosition
     */
    constructor(client: Client, initSegment: ISegment, 
    /**
     * @deprecated - use getOffset
     */
    offset?: number, refType?: ReferenceType, properties?: PropertySet);
    /**
     * @deprecated - use minReferencePosition
     */
    min(b: LocalReference): LocalReference;
    /**
     * @deprecated - use maxReferencePosition
     */
    max(b: LocalReference): LocalReference;
    /**
     * @deprecated - use compareReferencePositions
     */
    compare(b: LocalReference): number;
    /**
     * @deprecated - use getLocalReferencePosition
     */
    toPosition(): number;
    /**
     * @deprecated - use refHasTileLabels
     */
    hasTileLabels(): boolean;
    /**
     * @deprecated - use refHasRangeLabels
     */
    hasRangeLabels(): boolean;
    /**
     * @deprecated - use refHasTileLabel
     */
    hasTileLabel(label: string): boolean;
    /**
     * @deprecated - use refHasRangeLabel
     */
    hasRangeLabel(label: string): boolean;
    /**
     * @deprecated - use refGetTileLabels
     */
    getTileLabels(): string[] | undefined;
    /**
     * @deprecated - use refGetRangeLabels
     */
    getRangeLabels(): string[] | undefined;
    isLeaf(): boolean;
    addProperties(newProps: PropertySet, op?: ICombiningOp): void;
    /**
     * @deprecated - no longer supported
     */
    getClient(): Client;
    getSegment(): ISegment | undefined;
    getOffset(): number;
    getProperties(): PropertySet | undefined;
}
interface IRefsAtOffset {
    before?: List<LocalReference>;
    at?: List<LocalReference>;
    after?: List<LocalReference>;
}
/**
 * Represents a collection of {@link ReferencePosition}s associated with one segment in a merge-tree.
 */
export declare class LocalReferenceCollection {
    /** Segment this `LocalReferenceCollection` is associated to. */
    private readonly segment;
    static append(seg1: ISegment, seg2: ISegment): void;
    /**
     *
     * @internal - this method should only be called by mergeTree
     */
    hierRefCount: number;
    private readonly refsByOffset;
    private refCount;
    /**
     *
     * @internal - this method should only be called by mergeTree
     */
    constructor(
    /** Segment this `LocalReferenceCollection` is associated to. */
    segment: ISegment, initialRefsByfOffset?: (IRefsAtOffset | undefined)[]);
    /**
     *
     * @internal - this method should only be called by mergeTree
     */
    [Symbol.iterator](): {
        next(): IteratorResult<LocalReference>;
        [Symbol.iterator](): any;
    };
    /**
     *
     * @internal - this method should only be called by mergeTree
     */
    clear(): void;
    /**
     *
     * @internal - this method should only be called by mergeTree
     */
    get empty(): boolean;
    /**
     *
     * @internal - this method should only be called by mergeTree
     */
    createLocalRef(offset: number | undefined, refType: ReferenceType, properties: PropertySet | undefined, client: Client): ReferencePosition;
    /**
     *
     * @internal - this method should only be called by mergeTree
     */
    addLocalRef(lref: LocalReference | ReferencePosition): void;
    /**
     *
     * @internal - this method should only be called by mergeTree
     */
    removeLocalRef(lref: LocalReference | ReferencePosition): LocalReference | undefined;
    /**
     * @internal - this method should only be called by mergeTree
     *
     * Called by 'append()' implementations to append local refs from the given 'other' segment to the
     * end of 'this' segment.
     *
     * Note: This method should be invoked after the caller has ensured that segments can be merged,
     *       but before 'this' segment's cachedLength has changed, or the adjustment to the local refs
     *       will be incorrect.
     */
    append(other: LocalReferenceCollection): void;
    /**
     * @internal - this method should only be called by mergeTree
     *
     * Splits this `LocalReferenceCollection` into the intervals [0, offset) and [offset, originalLength).
     * Local references in the former half of this split will remain associated with the segment used on construction.
     * Local references in the latter half of this split will be transferred to `splitSeg`,
     * and its `localRefs` field will be set.
     * @param offset - Offset into the original segment at which the collection should be split
     * @param splitSeg - Split segment which originally corresponded to the indices [offset, originalLength)
     * before splitting.
     */
    split(offset: number, splitSeg: ISegment): void;
    addBeforeTombstones(...refs: Iterable<LocalReference | ReferencePosition>[]): void;
    addAfterTombstones(...refs: Iterable<LocalReference | ReferencePosition>[]): void;
}
export {};
//# sourceMappingURL=localReference.d.ts.map