line-mappings.d.ts 736 B

123456789101112131415161718192021
  1. /**
  2. * @license
  3. * Copyright Google LLC All Rights Reserved.
  4. *
  5. * Use of this source code is governed by an MIT-style license that can be
  6. * found in the LICENSE file at https://angular.dev/license
  7. */
  8. export interface LineAndCharacter {
  9. character: number;
  10. line: number;
  11. }
  12. /** Gets the line and character for the given position from the line starts map. */
  13. export declare function getLineAndCharacterFromPosition(lineStartsMap: number[], position: number): {
  14. character: number;
  15. line: number;
  16. };
  17. /**
  18. * Computes the line start map of the given text. This can be used in order to
  19. * retrieve the line and character of a given text position index.
  20. */
  21. export declare function computeLineStartsMap(text: string): number[];