error-stack-parser.d.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Type definitions for ErrorStackParser v2.0.0
  2. // Project: https://github.com/stacktracejs/error-stack-parser
  3. // Definitions by: Eric Wendelin <https://www.eriwen.com>
  4. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
  5. declare module ErrorStackParser {
  6. export interface StackFrame {
  7. constructor(object: StackFrame): StackFrame;
  8. isConstructor?: boolean;
  9. getIsConstructor(): boolean;
  10. setIsConstructor(): void;
  11. isEval?: boolean;
  12. getIsEval(): boolean;
  13. setIsEval(): void;
  14. isNative?: boolean;
  15. getIsNative(): boolean;
  16. setIsNative(): void;
  17. isTopLevel?: boolean;
  18. getIsTopLevel(): boolean;
  19. setIsTopLevel(): void;
  20. columnNumber?: number;
  21. getColumnNumber(): number;
  22. setColumnNumber(): void;
  23. lineNumber?: number;
  24. getLineNumber(): number;
  25. setLineNumber(): void;
  26. fileName?: string;
  27. getFileName(): string;
  28. setFileName(): void;
  29. functionName?: string;
  30. getFunctionName(): string;
  31. setFunctionName(): void;
  32. source?: string;
  33. getSource(): string;
  34. setSource(): void;
  35. args?: any[];
  36. getArgs(): any[];
  37. setArgs(): void;
  38. evalOrigin?: StackFrame;
  39. getEvalOrigin(): StackFrame;
  40. setEvalOrigin(): void;
  41. toString(): string;
  42. }
  43. /**
  44. * Given an Error object, extract the most information from it.
  45. *
  46. * @param {Error} error object
  47. * @return {Array} of StackFrames
  48. */
  49. export function parse(error: Error): StackFrame[];
  50. }
  51. export = ErrorStackParser;