/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { LocalReferenceCollection } from "./localReference";
import { MergeTree } from "./mergeTree";
import { IMergeBlock, IRemovalInfo, ISegment } from "./mergeTreeNodes";
/**
 * This is a special segment that is not bound or known by the merge tree itself,
 * but the segment itself pretends to be a removed segment at an endpoint of the
 * tree. It is removed so it appears as a undefined/0 length segment. This segment
 * adds the capability to hold local references that have been detached from the
 * real merge tree, and give the appearance that they exist at an endpoint of the
 * tree.
 *
 * This is useful today in 2 cases: detached references and interval stickiness.
 *
 * In general, local references only become detached when the tree becomes empty
 * and the EndOfTreeSegment allows us to gracefully handle that case by giving
 * those references a place to live.
 *
 * In the case of interval stickiness, it is desirable to be able to refer to
 * the position immediately after or before a segment, in order for the endpoint
 * of an interval to be exclusive. This means that in order to support intervals
 * that are exclusive and also include the first or last segment of the tree, it
 * must be possible in some way to refer to a position before or after the tree
 * respectively. The endpoint segments allow us to support such behavior.
 */
declare abstract class BaseEndpointSegment {
    protected readonly mergeTree: MergeTree;
    constructor(mergeTree: MergeTree);
    removedSeq: number;
    removedClientIds: number[];
    attribution: undefined;
    propertyManager: undefined;
    localSeq: undefined;
    localRemovedSeq: undefined;
    properties: undefined;
    seq: number;
    clientId: number;
    cachedLength: number;
    isLeaf(): this is ISegment;
    protected abstract endpointSegmentProps(): {
        parent: IMergeBlock;
        index: number;
        depth: number;
    };
    get parent(): IMergeBlock;
    get index(): number;
    abstract get ordinal(): string;
    localRefs?: LocalReferenceCollection;
    get segmentGroups(): never;
    get trackingCollection(): never;
    addProperties: () => never;
    clone: () => never;
    canAppend: () => never;
    append: () => never;
    splitAt: () => never;
    toJSONObject: () => never;
    ack: () => never;
}
/**
 * The position immediately prior to the start of the tree
 */
export declare class StartOfTreeSegment extends BaseEndpointSegment implements ISegment, IRemovalInfo {
    type: string;
    readonly endpointType = "start";
    /**
     * this segment pretends to be a sibling of the first real segment.
     * so compute the necessary properties to pretend to be that segment.
     */
    protected endpointSegmentProps(): {
        parent: IMergeBlock;
        index: number;
        depth: number;
    };
    get ordinal(): string;
}
/**
 * The position immediately after the end of the tree
 */
export declare class EndOfTreeSegment extends BaseEndpointSegment implements ISegment, IRemovalInfo {
    type: string;
    readonly endpointType = "end";
    /**
     * this segment pretends to be a sibling of the last real segment.
     * so compute the necessary properties to pretend to be that segment.
     */
    protected endpointSegmentProps(): {
        parent: IMergeBlock;
        index: number;
        depth: number;
    };
    get ordinal(): string;
}
export {};
//# sourceMappingURL=endOfTreeSegment.d.ts.map