import { type PromptString } from '../prompt/prompt-string'; /** * A range of text in a document. Unlike {@link vscode.Range}, this just contains the data. Do not * use {@link vscode.Range} when serializing to JSON because it serializes to an array `[start, * end]`, which is impossible to deserialize correctly without knowing that the value is for a * {@link vscode.Range}. * * The line and character numbers are 0-indexed. */ export interface RangeData { start: { line: number; character: number; }; end: { line: number; character: number; }; } /** * A specialization of RangeData such that character is always 0. This is a * 0-indexed line range [start, end). */ export interface LineRangeData { start: { line: number; character: 0; }; end: { line: number; character: 0; }; } /** * Return the plain {@link RangeData} for a rich instance of the class {@link vscode.Range}. */ export declare function toRangeData(range: R): RangeData; export declare function toRangeData(range: R | undefined): RangeData | undefined; export declare function toRangeData(badVSCodeSerializedRange: [{ line: number; character: number; }, { line: number; character: number; }]): RangeData; /** * Return the display text for the line range, such as `1-3` (meaning lines 1 through 3, which we * assume humans interpret as an inclusive range) or just `2` (meaning just line 2). Callers that * need the characters in the returned string should use {@link displayRange}. * * If the range ends on a line at character 0, it's assumed to only include the prior line. * * `RangeData` is 0-indexed but humans use 1-indexed line ranges. */ export declare function displayLineRange(range: RangeData): PromptString; /** * Returns range such that it is expanded to be the whole line (character is * always zero). */ export declare function expandToLineRange(range: RangeData): LineRangeData; /** * Return the display text for the range, such as `1:2-3:4` (meaning from character 2 on line 1 to * character 4 on line 3), `1:2-3` (meaning from character 2 to 3 on line 1), or `1:2` (meaning an * empty range that starts and ends at character 2 on line 1). Callers that need only the lines in * the returned string should use {@link displayLineRange}. * * `RangeData` is 0-indexed but humans use 1-indexed line ranges. */ export declare function displayRange(range: RangeData): PromptString; //# sourceMappingURL=range.d.ts.map