Skip to content

Commit 06a7ca2

Browse files
committed
Import the TypeScript definition for StackFrame from stackframe
The slight incompatibility of the old definition was necessitating unsafe casts between StackTrace.StackFrame and StackFrame. Signed-off-by: Anders Kaseorg <[email protected]>
1 parent c12fccd commit 06a7ca2

File tree

1 file changed

+6
-52
lines changed

1 file changed

+6
-52
lines changed

Diff for: stacktrace-js.d.ts

+6-52
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// Definitions by: Eric Wendelin <https://github.com/exceptionless>
44
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
55

6+
import StackFrame = require("stackframe");
7+
68
declare namespace StackTrace {
79

810
export interface SourceCache {
@@ -15,55 +17,7 @@ declare namespace StackTrace {
1517
offline?: boolean;
1618
}
1719

18-
export interface StackFrame {
19-
constructor(object: StackFrame): StackFrame;
20-
21-
isConstructor?: boolean;
22-
getIsConstructor(): boolean;
23-
setIsConstructor(): void;
24-
25-
isEval?: boolean;
26-
getIsEval(): boolean;
27-
setIsEval(): void;
28-
29-
isNative?: boolean;
30-
getIsNative(): boolean;
31-
setIsNative(): void;
32-
33-
isTopLevel?: boolean;
34-
getIsTopLevel(): boolean;
35-
setIsTopLevel(): void;
36-
37-
columnNumber?: number;
38-
getColumnNumber(): number;
39-
setColumnNumber(): void;
40-
41-
lineNumber?: number;
42-
getLineNumber(): number;
43-
setLineNumber(): void;
44-
45-
fileName?: string;
46-
getFileName(): string;
47-
setFileName(): void;
48-
49-
functionName?: string;
50-
getFunctionName(): string;
51-
setFunctionName(): void;
52-
53-
source?: string;
54-
getSource(): string;
55-
setSource(): void;
56-
57-
args?: any[];
58-
getArgs(): any[];
59-
setArgs(): void;
60-
61-
evalOrigin?: StackFrame;
62-
getEvalOrigin(): StackFrame;
63-
setEvalOrigin(): void;
64-
65-
toString(): string;
66-
}
20+
export {StackFrame};
6721

6822
/**
6923
* Get a backtrace from invocation point.
@@ -129,6 +83,6 @@ declare namespace StackTrace {
12983
export function report(stackframes: StackFrame[], url: string, errorMsg?: string, requestOptions?: object): Promise<any>;
13084
}
13185

132-
declare module "stacktrace-js" {
133-
export = StackTrace;
134-
}
86+
export = StackTrace;
87+
88+
export as namespace StackTrace; // global for non-module UMD users

0 commit comments

Comments
 (0)