@types/combine-source-map
TypeScript icon, indicating that this package has built-in type declarations

0.8.4 • Public • Published

Installation

npm install --save @types/combine-source-map

Summary

This package contains type definitions for combine-source-map (https://github.com/thlorenz/combine-source-map).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/combine-source-map.

index.d.ts

/**
 * Add source maps of multiple files, offset them and then combine them into one source map.
 * (documentation based on project's README file)
 */
declare class Combiner {
    constructor(file?: string, sourceRoot?: string);

    /**
     * Adds map to underlying source map.
     * If source contains a source map comment that has the source of the original file inlined it will offset these
     * mappings and include them.
     * If no source map comment is found or it has no source inlined, mappings for the file will be generated and included
     * @param opts the 'sourceFile' path/name and the file's 'source' contents
     * @param offset the source file 'line' number and 'column' number offsets
     */
    addFile(opts: { sourceFile: string; source: string }, offset?: Combiner.Offset): Combiner;

    /**
     * output the combined source map in base64 format
     * @return base64 encoded combined source map
     */
    base64(): string;

    /**
     * generate a base64 encoded sourceMappingURL comment
     * @return base64 encoded sourceMappingUrl comment of the combined source map
     */
    comment(): string;

    _addGeneratedMap(sourceFile: string, source: string, offset?: Combiner.Offset): Combiner;

    _addExistingMap(sourceFile: string, source: string, existingMap: any, offset?: Combiner.Offset): Combiner;
}

declare namespace Combiner {
    /** An offset line and column number */
    interface Offset {
        line?: number | undefined;
        column?: number | undefined;
    }

    /**
     * Create a source map combiner that accepts multiple files, offsets them and then combines them into one source map.
     * @param file optional name of the generated file
     * @param sourceRoot optional sourceRoot of the map to be generated
     * @return Combiner instance to which source maps can be added and later combined
     */
    function create(file?: string, sourceRoot?: string): Combiner;

    /**
     * @return src with all sourceMappingUrl comments removed
     */
    function removeComments(src: string): string;
}

export = Combiner;

export as namespace Combiner;

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:05 GMT
  • Dependencies: none

Credits

These definitions were written by TeamworkGuy2.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/combine-source-map

Weekly Downloads

729

Version

0.8.4

License

MIT

Unpacked Size

6.87 kB

Total Files

5

Last publish

Collaborators

  • types