/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { AttributionKey, ISegment } from "./mergeTreeNodes";
export interface SerializedAttributionCollection {
    /**
     * Parallel array with posBreakpoints which tracks the seq of insertion.
     * Ex: if seqs is [45, 46] and posBreakpoints is [0, 3], the section of the string
     * between offsets 0 and 3 was inserted at seq 45 and the section of the string between
     * 3 and the length of the string was inserted at seq 46.
     */
    seqs: number[];
    posBreakpoints: number[];
    length: number;
}
/**
 * @alpha
 */
export interface IAttributionCollection<T> {
    /**
     * Retrieves the attribution key associated with the provided offset.
     */
    getAtOffset(offset: number): T;
    /**
     * Total length of all attribution keys in this collection.
     */
    readonly length: number;
    /**
     * Retrieve all key/offset pairs stored on this segment. Entries should be ordered by offset, such that
     * the `i`th result's attribution key applies to offsets in the open range between the `i`th offset and the
     * `i+1`th offset.
     * The last entry's key applies to the open interval from the last entry's offset to this collection's length.
     * @internal
     */
    getAll(): Iterable<{
        offset: number;
        key: T;
    }>;
    /** @internal */
    splitAt(pos: number): IAttributionCollection<T>;
    /** @internal */
    append(other: IAttributionCollection<T>): void;
    /** @internal */
    clone(): IAttributionCollection<T>;
}
export declare class AttributionCollection implements IAttributionCollection<AttributionKey> {
    private _length;
    private offsets;
    private seqs;
    constructor(baseEntry: number, _length: number);
    getAtOffset(offset: number): AttributionKey;
    private findIndex;
    get length(): number;
    /**
     * Splits this attribution collection into two with entries for [0, pos) and [pos, length).
     */
    splitAt(pos: number): AttributionCollection;
    append(other: AttributionCollection): void;
    getAll(): {
        offset: number;
        key: AttributionKey;
    }[];
    clone(): AttributionCollection;
    /**
     * Rehydrates attribution information from its serialized form into the provided iterable of consecutive segments.
     */
    static populateAttributionCollections(segments: Iterable<ISegment>, summary: SerializedAttributionCollection): void;
    /**
     * Condenses attribution information on consecutive segments into a `SerializedAttributionCollection`
     */
    static serializeAttributionCollections(segments: Iterable<{
        attribution?: IAttributionCollection<AttributionKey>;
        cachedLength: number;
    }>): SerializedAttributionCollection;
}
//# sourceMappingURL=attributionCollection.d.ts.map