1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | export = StackUtils;
|
8 |
|
9 | declare class StackUtils {
|
10 | static nodeInternals(): RegExp[];
|
11 | constructor(options?: StackUtils.Options);
|
12 | clean(stack: string | string[]): string;
|
13 | capture(limit?: number, startStackFunction?: Function): StackUtils.CallSite[];
|
14 | capture(startStackFunction: Function): StackUtils.CallSite[];
|
15 | captureString(limit?: number, startStackFunction?: Function): string;
|
16 | captureString(startStackFunction: Function): string;
|
17 | at(startStackFunction?: Function): StackUtils.CallSiteLike;
|
18 | parseLine(line: string): StackUtils.StackLineData | null;
|
19 | }
|
20 |
|
21 | declare namespace StackUtils {
|
22 | interface Options {
|
23 | internals?: RegExp[] | undefined;
|
24 | ignoredPackages?: string[] | undefined;
|
25 | cwd?: string | undefined;
|
26 | wrapCallSite?(callSite: CallSite): CallSite;
|
27 | }
|
28 |
|
29 | interface CallSite {
|
30 | getThis(): object | undefined;
|
31 | getTypeName(): string;
|
32 | getFunction(): Function | undefined;
|
33 | getFunctionName(): string;
|
34 | getMethodName(): string | null;
|
35 | getFileName(): string | undefined;
|
36 | getLineNumber(): number;
|
37 | getColumnNumber(): number;
|
38 | getEvalOrigin(): CallSite | string;
|
39 | isToplevel(): boolean;
|
40 | isEval(): boolean;
|
41 | isNative(): boolean;
|
42 | isConstructor(): boolean;
|
43 | }
|
44 |
|
45 | interface CallSiteLike extends StackData {
|
46 | type?: string | undefined;
|
47 | }
|
48 |
|
49 | interface StackLineData extends StackData {
|
50 | evalLine?: number | undefined;
|
51 | evalColumn?: number | undefined;
|
52 | evalFile?: string | undefined;
|
53 | }
|
54 |
|
55 | interface StackData {
|
56 | line?: number | undefined;
|
57 | column?: number | undefined;
|
58 | file?: string | undefined;
|
59 | constructor?: boolean | undefined;
|
60 | evalOrigin?: string | undefined;
|
61 | native?: boolean | undefined;
|
62 | function?: string | undefined;
|
63 | method?: string | undefined;
|
64 | }
|
65 | }
|