index.d.ts 536 B

123456789101112131415161718192021222324
  1. /**
  2. Returns the filename and line number of the caller in the call stack
  3. @param depth - The distance from the location function in the call stack. Defaults to 1 (caller).
  4. @return an object with the filename and line number.
  5. */
  6. export function location(depth?: number): location.Location;
  7. declare namespace location {
  8. interface Location {
  9. /**
  10. The fully qualified filename.
  11. */
  12. readonly filename: string;
  13. /**
  14. The file line number.
  15. */
  16. readonly line: number;
  17. }
  18. }