import { Node } from "./model"; /** * A location in a source code file. * The line should be in 1..n, the column in 0..n. * * Consider a file with one line, containing text "HELLO": * - the point before the first character will be Point(1, 0) * - the point at the end of the first line, after the letter "O" will be Point(1, 5) */ export declare class Point { readonly line: number; readonly column: number; constructor(line: number, column: number); compareTo(other: Point): number; equals(other: Point): boolean; isAfter(other: Point): boolean; isSameOrAfter(other: Point): boolean; isBefore(other: Point): boolean; isSameOrBefore(other: Point): boolean; asPosition(source?: Source): Position; } export declare const START_POINT: Point; export declare abstract class Source { } export declare class SourceSet { readonly name: string; readonly root: string[]; constructor(name: string, root: string[]); } export declare class SourceSetElement extends Source { readonly sourceSet: SourceSet; readonly relativePath: string[]; constructor(sourceSet: SourceSet, relativePath: string[]); } export declare class FileSource extends Source { readonly file: string; constructor(file: string); } export declare class StringSource extends Source { readonly code?: string | undefined; constructor(code?: string | undefined); } export declare class URLSource extends Source { readonly url: string; constructor(url: string); } /** * This source is intended to be used for nodes that are "calculated". * For example, nodes representing types that are derived by examining the code * but cannot be associated to any specific point in the code. * * @param description this is a description of the source. It is used to describe the process that calculated the node. * Examples of values could be "type inference". */ export declare class SyntheticSource extends Source { readonly description: string; constructor(description: string); } /** * An area in a source file, from start to end. * The start point is the point right before the starting character. * The end point is the point right after the last character. * An empty position will have coinciding points. * * Consider a file with one line, containing text "HELLO". * The Position of such text will be Position(Point(1, 0), Point(1, 5)). */ export declare class Position { readonly start: Point; readonly end: Point; source?: Source | undefined; constructor(start: Point, end: Point, source?: Source | undefined); static ofPoint(point: Point): Position; compareTo(other: Position): number; /** * If start and end are the same, * then this Position is considered empty. */ isEmpty(): boolean; /** * Tests whether the given object is contained in the interval represented by this object. * @param object the object to test: could be a Point, a Position, or a Node. */ contains(object: Point | Position | Node | null | undefined): boolean; /** * Tests whether the given position overlaps the interval represented by this object. * @param position the position */ overlaps(position?: Position): boolean; equals(obj: Position): boolean; } export declare function pos(startLine: number, startCol: number, endLine: number, endCol: number): Position;