@types/combine-source-map
@types/combine-source-map
npm i @types/combine-source-map
@types/combine-source-map

@types/combine-source-map

The repository for high quality TypeScript type definitions.

by DefinitelyTyped

0.8.2 (see all)License:MITTypeScript:Built-In
npm i @types/combine-source-map
Readme

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

// Type definitions for combine-source-map 0.8
// Project: https://github.com/thlorenz/combine-source-map
// Definitions by: TeamworkGuy2 <https://github.com/TeamworkGuy2>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/**
 * 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: Thu, 08 Jul 2021 09:08:03 GMT
  • Dependencies: none
  • Global values: Combiner

Credits

These definitions were written by TeamworkGuy2.

Downloads/wk

1.7K

GitHub Stars

40.9K

LAST COMMIT

7mos ago

MAINTAINERS

1

CONTRIBUTORS

17,572

OPEN ISSUES

635

OPEN PRs

204
VersionTagPublished
0.8.2
latest
1yr ago
0.8.2
ts4.7
1yr ago
0.8.2
ts4.6
1yr ago
0.8.2
ts4.8
1yr ago
No alternatives found
No tutorials found
Add a tutorial

Rate & Review

100
No reviews found
Be the first to rate