stack-trace-parser.d.ts 529 B

1234567891011121314151617
  1. import { LiteralUnion } from 'type-fest';
  2. export interface StackFrame {
  3. file: string | null;
  4. methodName: LiteralUnion<'<unknown>', string>;
  5. arguments: string[];
  6. lineNumber: number | null;
  7. column: number | null;
  8. }
  9. /**
  10. * This parser parses a stack trace from any browser or Node.js and returns an array of hashes representing a line.
  11. *
  12. * @param stackString - The stack to parse, usually from `error.stack` property.
  13. * @returns The parsed stack frames.
  14. */
  15. export function parse(stackString: string): StackFrame[];