/** * The following is modified based on source found in * https://github.com/microsoft/monaco-editor * * MIT Licensed * Copyright (c) 2016 - present Microsoft Corporation * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt */ export declare class Range { startLineNumber: number; startColumn: number; endLineNumber: number; endColumn: number; constructor(startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number); /** * Test if this range is empty. */ isEmpty(): boolean; /** * Test if `range` is empty. */ static isEmpty(range: Range): boolean; /** * Test if position is in this range. If the position is at the edges, will return true. */ containsPosition(position: any): boolean; /** * Test if `position` is in `range`. If the position is at the edges, will return true. */ static containsPosition(range: Range, position: { lineNumber: number; column: number; }): boolean; /** * Test if `position` is in `range`. If the position is at the edges, will return false. * @internal */ static strictContainsPosition(range: Range, position: { lineNumber: number; column: number; }): boolean; /** * Test if range is in this range. If the range is equal to this range, will return true. */ containsRange(range: Range): boolean; /** * Test if `otherRange` is in `range`. If the ranges are equal, will return true. */ static containsRange(range: Range, otherRange: { startLineNumber: number; endLineNumber: number; startColumn: number; endColumn: number; }): boolean; /** * Test if `range` is strictly in this range. `range` must start after and end before this range for the result to be true. */ strictContainsRange(range: Range): boolean; /** * Test if `otherRange` is strictly in `range` (must start after, and end before). If the ranges are equal, will return false. */ static strictContainsRange(range: Range, otherRange: { startLineNumber: number; endLineNumber: number; startColumn: number; endColumn: number; }): boolean; /** * A reunion of the two ranges. * The smallest position will be used as the start point, and the largest one as the end point. */ plusRange(range: Range): Range; /** * A reunion of the two ranges. * The smallest position will be used as the start point, and the largest one as the end point. */ static plusRange(a: Range, b: Range): Range; /** * A intersection of the two ranges. */ intersectRanges(range: Range): Range | null; /** * A intersection of the two ranges. */ static intersectRanges(a: Range, b: Range): Range | null; /** * Test if this range equals other. */ equalsRange(other: Range): boolean; /** * Test if range `a` equals `b`. */ static equalsRange(a: Range, b: Range): boolean; /** * Return the end position (which will be after or equal to the start position) */ getEndPosition(): Position; /** * Return the end position (which will be after or equal to the start position) */ static getEndPosition(range: Range): Position; /** * Return the start position (which will be before or equal to the end position) */ getStartPosition(): Position; /** * Return the start position (which will be before or equal to the end position) */ static getStartPosition(range: Range): Position; /** * Transform to a user presentable string representation. */ toString(): string; /** * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position. */ setEndPosition(endLineNumber: number, endColumn: number): Range; /** * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position. */ setStartPosition(startLineNumber: number, startColumn: number): Range; /** * Create a new empty range using this range's start position. */ collapseToStart(): Range; /** * Create a new empty range using this range's start position. */ static collapseToStart(range: Range): Range; /** * Create a new empty range using this range's end position. */ collapseToEnd(): Range; /** * Create a new empty range using this range's end position. */ static collapseToEnd(range: Range): Range; /** * Moves the range by the given amount of lines. */ delta(lineCount: number): Range; static fromPositions(start: { lineNumber: number; column: number; }, end?: { lineNumber: number; column: number; }): Range; static lift(range: Range): Range | null; /** * Test if `obj` is an `IRange`. */ static isIRange(obj: Range): boolean; /** * Test if the two ranges are touching in any way. */ static areIntersectingOrTouching(a: Range, b: Range): boolean; /** * Test if the two ranges are intersecting. If the ranges are touching it returns true. */ static areIntersecting(a: Range, b: Range): boolean; /** * A function that compares ranges, useful for sorting ranges * It will first compare ranges on the startPosition and then on the endPosition */ static compareRangesUsingStarts(a: Range, b: Range): number; /** * A function that compares ranges, useful for sorting ranges * It will first compare ranges on the endPosition and then on the startPosition */ static compareRangesUsingEnds(a: { endLineNumber: number; endColumn: number; startLineNumber: number; startColumn: number; }, b: { endLineNumber: number; endColumn: number; startLineNumber: number; startColumn: number; }): number; /** * Test if the range spans multiple lines. */ static spansMultipleLines(range: Range): boolean; toJSON(): this; } /** * A position in the editor. */ export declare class Position { lineNumber: number; column: number; constructor(lineNumber: number, column: number); /** * Create a new position from this position. * * @param newLineNumber new line number * @param newColumn new column */ with(newLineNumber?: number, newColumn?: number): Position; /** * Derive a new position from this position. * * @param deltaLineNumber line number delta * @param deltaColumn column delta */ delta(deltaLineNumber?: number, deltaColumn?: number): Position; /** * Test if this position equals other position */ equals(other: any): boolean; /** * Test if position `a` equals position `b` */ static equals(a: any, b: { lineNumber: any; column: any; }): boolean; /** * Test if this position is before other position. * If the two positions are equal, the result will be false. */ isBefore(other: any): boolean; /** * Test if position `a` is before position `b`. * If the two positions are equal, the result will be false. */ static isBefore(a: any, b: { lineNumber: number; column: number; }): boolean; /** * Test if this position is before other position. * If the two positions are equal, the result will be true. */ isBeforeOrEqual(other: any): boolean; /** * Test if position `a` is before position `b`. * If the two positions are equal, the result will be true. */ static isBeforeOrEqual(a: any, b: { lineNumber: number; column: number; }): boolean; /** * A function that compares positions, useful for sorting */ static compare(a: { lineNumber: number; column: number; }, b: { lineNumber: number; column: number; }): number; /** * Clone this position. */ clone(): Position; /** * Convert to a human-readable representation. */ toString(): string; /** * Create a `Position` from an `IPosition`. */ static lift(pos: { lineNumber: any; column: any; }): Position; /** * Test if `obj` is an `IPosition`. */ static isIPosition(obj: { lineNumber: any; column: any; }): boolean; toJSON(): { lineNumber: number; column: number; }; }