location.d.ts 376 B

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