/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
/**
 * A map keyed on integers allowing reading and writing contiguous ranges of integer keys.
 *
 * TODO: We should avoid the direct exposure of RangeEntry. AB#7414
 */
export type RangeMap<T> = RangeEntry<T>[];
export interface RangeEntry<T> {
    start: number;
    length: number;
    value: T;
}
/**
 * The result of a query about a range of keys.
 *
 * @internal
 */
export interface RangeQueryResult<T> {
    /**
     * The value of the first key in the query range.
     */
    value: T | undefined;
    /**
     * The length of the prefix of the query range which have the same value.
     * For example, if a RangeMap has the same value for keys 5, 6, and 7,
     * a query about the range [5, 10] would give a result with length 3.
     */
    length: number;
}
/**
 * See comments on `RangeQueryResult`.
 */
export declare function getFromRangeMap<T>(map: RangeMap<T>, start: number, length: number): RangeQueryResult<T>;
export declare function getFirstEntryFromRangeMap<T>(map: RangeMap<T>, start: number, length: number): RangeEntry<T> | undefined;
/**
 * Sets the keys from `start` to `start + length - 1` to `value`.
 */
export declare function setInRangeMap<T>(map: RangeMap<T>, start: number, length: number, value: T): void;
/**
 * Delete the keys from `start` to `start + length - 1`
 *
 * 1. If an entry is completely included in the deletion range, the whole entry will be deleted
 * e.g.: map = [[1, 2], [4, 6]], delete range: [3, 6]
 * map becomes [[1, 2]] after deletion
 * (Note: the notation [a, b] represents start = a, end = b for simpler visiualization, instead of `b`
 * representing the length)
 *
 * 2. If an entry is partially overlapped with the deletion range, the start or end point will be shifted
 * e.g.: map = [[1, 2], [4, 6]], delete range: [2, 4]
 * map becomes [[1, 1], [5, 6]] after deletion
 *
 * 3. If an entry completely includes the deletion range, the original entry may be split into two.
 * e.g.: map = [[1, 6]], delete range: [2, 4]
 * map becomes [[1, 1], [5, 6]]
 *
 * TODO: We may find ways to mitigate the code duplication between set and delete, and we need to better
 * document the API.  AB#7413
 */
export declare function deleteFromRangeMap<T>(map: RangeMap<T>, start: number, length: number): void;
//# sourceMappingURL=rangeMap.d.ts.map