location.d.ts 394 B

12345678910111213141516
  1. import type { 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 declare function getLocation(
  14. source: Source,
  15. position: number,
  16. ): SourceLocation;