Add definitions for error-stack-parser

This commit is contained in:
Eric Wendelin
2016-04-01 18:52:47 -07:00
parent e8f8e7471b
commit b194beaf9d
2 changed files with 29 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
/// <reference path="error-stack-parser.d.ts" />
ErrorStackParser.parse(new Error('Boom'));

View File

@@ -0,0 +1,26 @@
// Type definitions for ErrorStackParser v1.3.3
// Project: https://github.com/stacktracejs/error-stack-parser
// Definitions by: Eric Wendelin <https://www.eriwen.com>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module ErrorStackParser {
export interface StackFrame {
constructor(functionName: string, args: any, fileName: string, lineNumber: number, columnNumber: number, source: string): StackFrame;
functionName?: string;
args?: any[];
fileName?: string;
lineNumber?: number;
columnNumber?: number;
source?: string;
toString(): string;
}
/**
* Given an Error object, extract the most information from it.
*
* @param {Error} error object
* @return {Array} of StackFrames
*/
export function parse(error: Error): StackFrame[];
}