export interface IPosition { line : number ; column : number ; } export class Position implements IPosition { public static fromZeroBased ( { line , character , } ) { return new Position ( line + 1 , character + 1 ) ; } param line param column constructor ( public readonly line , public readonly column ) { } param other return public isBefore ( other ) { return this . line < other . line || ( this . line === other . line && this . column < other . column ) ; } param other return public isBeforeOrEqual ( other ) { return this . line < other . line || ( this . line === other . line && this . column <= other . column ) ; } param other return public isAfter ( other ) { return this . line > other . line || ( this . line === other . line && this . column > other . column ) ; } param other return public isAfterOrEqual ( other ) { return this . line > other . line || ( this . line === other . line && this . column >= other . column ) ; } param other return public isEqual ( other ) { return this . line === other . line && this . column === other . column ; } public isWithin ( start , end ) { return this . isAfter ( start ) && this . isBefore ( end ) ; } public isWithinStrict ( start , end ) { return this . isAfterOrEqual ( start ) && this . isBeforeOrEqual ( end ) ; } }