/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import type { SequenceInterval } from "../intervals/index.js"; import type { ISharedSegmentSequence } from "../sequence.js"; import type { ISharedString } from "../sharedString.js"; import type { SequenceIntervalIndex } from "./intervalIndex.js"; /** * @internal */ export interface IEndpointIndex extends SequenceIntervalIndex { /** * @returns the previous interval based on the given position number. * If no such interval exists in this index, returns `undefined` */ previousInterval(pos: number): SequenceInterval | undefined; /** * @returns the next interval based on the given position number. * If no such interval exists in this index, returns `undefined` */ nextInterval(pos: number): SequenceInterval | undefined; } export declare class EndpointIndex implements IEndpointIndex { private readonly sequence; private readonly endIntervals; constructor(sequence: ISharedSegmentSequence); previousInterval(pos: number): SequenceInterval | undefined; nextInterval(pos: number): SequenceInterval | undefined; add(interval: SequenceInterval): void; remove(interval: SequenceInterval): void; } /** * Creates an endpoint index for the provided SharedString. * * @internal */ export declare function createEndpointIndex(sharedString: ISharedString): IEndpointIndex; //# sourceMappingURL=endpointIndex.d.ts.map