forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stack-mapper.d.ts
46 lines (38 loc) · 1.44 KB
/
stack-mapper.d.ts
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
// Type definitions for stack-mapper 0.2.2
// Project: https://github.com/thlorenz/stack-mapper
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "stack-mapper" {
module stackMapper {
export class StackMapper {
/**
* Maps the trace statements of the given error stack and replaces locations
* referencing code in the generated file with the locations inside the original files.
*
* @name map
* @function
* @param {Array} array of callsite objects (see readme for details about Callsite object)
* @return {Array.<Object>} info about the error stack with adapted locations, each with the following properties
* - filename: original filename
* - line: origial line in that filename of the trace
* - column: origial column on that line of the trace
*/
public map(stack: Callsite[]): Callsite[];
}
export interface Callsite {
filename: string;
line: number;
column: number;
}
}
/**
* Returns a Stackmapper that will use the given source map to map error trace locations.
*
* @name stackMapper
* @function
* @param {Object} sourcemap source map for the generated file
* @return {StackMapper} stack mapper for the particular source map
*/
function stackMapper(sourcemap: any): stackMapper.StackMapper;
export = stackMapper;
}