/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { SlidingPreference } from "./localReference";
import { ISegment } from "./mergeTreeNodes";
import { ReferenceType } from "./ops";
import { PropertySet } from "./properties";
/**
 * @internal
 */
export declare const reservedTileLabelsKey = "referenceTileLabels";
/**
 * @internal
 */
export declare const reservedRangeLabelsKey = "referenceRangeLabels";
/**
 * @internal
 */
export declare function refTypeIncludesFlag(refPosOrType: ReferencePosition | ReferenceType, flags: ReferenceType): boolean;
/**
 * @internal
 */
export declare const refGetTileLabels: (refPos: ReferencePosition) => string[] | undefined;
/**
 * @internal
 */
export declare function refHasTileLabel(refPos: ReferencePosition, label: string): boolean;
/**
 * @internal
 */
export declare function refHasTileLabels(refPos: ReferencePosition): boolean;
/**
 * Represents a reference to a place within a merge tree. This place conceptually remains stable over time
 * by referring to a particular segment and offset within that segment.
 * Thus, this reference's character position changes as the tree is edited.
 * @alpha
 */
export interface ReferencePosition {
    /**
     * Properties associated with this reference
     */
    properties?: PropertySet;
    /**
     * The direction for this reference position to slide when the segment it
     * points to is removed. See {@link (SlidingPreference:type)} for additional context.
     *
     * Defaults to SlidingPreference.Forward
     */
    slidingPreference?: SlidingPreference;
    refType: ReferenceType;
    /**
     * Gets the segment that this reference position is semantically associated with. Returns undefined iff the
     * reference became detached from the string.
     */
    getSegment(): ISegment | undefined;
    /**
     * Gets the offset for this reference position within its associated segment.
     *
     * @example
     *
     * If a merge-tree has 3 leaf segments ["hello", " ", "world"] and a ReferencePosition refers to the "l"
     * in "world", that reference's offset would be 3 as "l" is the character at index 3 within "world".
     */
    getOffset(): number;
    /**
     * @param newProps - Properties to add to this reference.
     * @remarks Note that merge-tree does not broadcast changes to other clients. It is up to the consumer
     * to ensure broadcast happens if that is desired.
     */
    addProperties(newProps: PropertySet): void;
    isLeaf(): this is ISegment;
}
/**
 * @internal
 */
export declare const DetachedReferencePosition = -1;
/**
 * @internal
 */
export declare function minReferencePosition<T extends ReferencePosition>(a: T, b: T): T;
/**
 * @internal
 */
export declare function maxReferencePosition<T extends ReferencePosition>(a: T, b: T): T;
/**
 * @internal
 */
export declare function compareReferencePositions(a: ReferencePosition, b: ReferencePosition): number;
//# sourceMappingURL=referencePositions.d.ts.map