UNPKG

376 BTypeScriptView Raw
1import { Source } from './source';
2
3/**
4 * Represents a location in a Source.
5 */
6export interface SourceLocation {
7 readonly line: number;
8 readonly column: number;
9}
10
11/**
12 * Takes a Source and a UTF-8 character offset, and returns the corresponding
13 * line and column as a SourceLocation.
14 */
15export function getLocation(source: Source, position: number): SourceLocation;