You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.6 KiB

4 years ago
  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;