@types/stack-mapper
TypeScript icon, indicating that this package has built-in type declarations

0.2.31 • Public • Published

Installation

npm install --save @types/stack-mapper

Summary

This package contains type definitions for stack-mapper (https://github.com/thlorenz/stack-mapper).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/stack-mapper.

index.d.ts

declare namespace 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
 */
declare function stackMapper(sourcemap: any): stackMapper.StackMapper;

export = stackMapper;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by Rogier Schouten.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/stack-mapper

Weekly Downloads

6

Version

0.2.31

License

MIT

Unpacked Size

5.08 kB

Total Files

5

Last publish

Collaborators

  • types