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