Skip to content

Commit b194bea

Browse files
committed
Add definitions for error-stack-parser
1 parent e8f8e74 commit b194bea

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/// <reference path="error-stack-parser.d.ts" />
2+
3+
ErrorStackParser.parse(new Error('Boom'));
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Type definitions for ErrorStackParser v1.3.3
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+
6+
declare module ErrorStackParser {
7+
export interface StackFrame {
8+
constructor(functionName: string, args: any, fileName: string, lineNumber: number, columnNumber: number, source: string): StackFrame;
9+
10+
functionName?: string;
11+
args?: any[];
12+
fileName?: string;
13+
lineNumber?: number;
14+
columnNumber?: number;
15+
source?: string;
16+
toString(): string;
17+
}
18+
19+
/**
20+
* Given an Error object, extract the most information from it.
21+
*
22+
* @param {Error} error object
23+
* @return {Array} of StackFrames
24+
*/
25+
export function parse(error: Error): StackFrame[];
26+
}

0 commit comments

Comments
 (0)