From b194beaf9dace52cdb14e89698becf042808ec59 Mon Sep 17 00:00:00 2001 From: Eric Wendelin Date: Fri, 1 Apr 2016 18:52:47 -0700 Subject: [PATCH] Add definitions for error-stack-parser --- .../error-stack-parser-tests.ts | 3 +++ error-stack-parser/error-stack-parser.d.ts | 26 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 error-stack-parser/error-stack-parser-tests.ts create mode 100644 error-stack-parser/error-stack-parser.d.ts diff --git a/error-stack-parser/error-stack-parser-tests.ts b/error-stack-parser/error-stack-parser-tests.ts new file mode 100644 index 0000000000..b0fa8e4cc3 --- /dev/null +++ b/error-stack-parser/error-stack-parser-tests.ts @@ -0,0 +1,3 @@ +/// + +ErrorStackParser.parse(new Error('Boom')); diff --git a/error-stack-parser/error-stack-parser.d.ts b/error-stack-parser/error-stack-parser.d.ts new file mode 100644 index 0000000000..ad722b0f2b --- /dev/null +++ b/error-stack-parser/error-stack-parser.d.ts @@ -0,0 +1,26 @@ +// Type definitions for ErrorStackParser v1.3.3 +// Project: https://github.com/stacktracejs/error-stack-parser +// Definitions by: Eric Wendelin +// 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[]; +}