UNPKG

1.58 kBTypeScriptView Raw
1// Type definitions for gulp-sourcemaps
2// Project: https://github.com/gulp-sourcemaps/gulp-sourcemaps
3// Definitions by: Phips Peter <https://github.com/pspeter3>
4// Concision <https://github.com/concision>
5// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6
7/// <reference types="node"/>
8
9import File = require("vinyl");
10
11interface InitOptions {
12 loadMaps?: boolean | undefined;
13 debug?: boolean | undefined;
14}
15
16interface WriteMapper {
17 (file: string): string;
18}
19
20interface SourceMapMapper {
21 (sourcePath: string, file: File): string;
22}
23
24interface SourceUrlMapper {
25 (file: File): string;
26}
27
28interface MapFilenameMapper {
29 (mapFilePath: string): string;
30}
31
32interface CloneOptions {
33 contents?: boolean | undefined;
34 deep?: boolean | undefined;
35}
36
37interface WriteOptions {
38 addComment?: boolean | undefined;
39 includeContent?: boolean | undefined;
40 sourceRoot?: string | WriteMapper | undefined;
41 sourceMappingURLPrefix?: string | WriteMapper | undefined;
42 sourceMappingURL?: SourceUrlMapper | undefined;
43 destPath?: string | undefined;
44 mapFile?: MapFilenameMapper | undefined;
45 charset?: BufferEncoding | undefined;
46 clone?: boolean | CloneOptions | undefined;
47}
48
49export declare function init(opts?: InitOptions): NodeJS.ReadWriteStream;
50export declare function mapSources(mapper?: SourceMapMapper): NodeJS.ReadWriteStream;
51export declare function write(path?: string, opts?: WriteOptions): NodeJS.ReadWriteStream;
52export declare function write(opts?: WriteOptions): NodeJS.ReadWriteStream;