Skip to content

Commit 0fd1a2e

Browse files
rpetrichFlorian Reiterer
authored and
Florian Reiterer
committed
Add TypeScript types
1 parent dcfe52f commit 0fd1a2e

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

index.d.ts

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { RawSourceMap } from "source-map";
2+
3+
declare module "concat-with-sourcemaps" {
4+
5+
export default class Concat {
6+
constructor(generateSourceMap: boolean, fileName: string, separator?: string);
7+
add(filePath: string | null, content: string | Buffer, sourceMap?: string | RawSourceMap): void;
8+
readonly content: Buffer;
9+
readonly sourceMap: string | undefined;
10+
}
11+
12+
}

index.js

+1
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,6 @@ function bufferFrom(content) {
129129
}
130130
}
131131
Concat.bufferFrom = bufferFrom;
132+
Concat.default = Concat;
132133

133134
module.exports = Concat;

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"homepage": "http://github.com/floridoo/concat-with-sourcemaps",
66
"repository": "git://github.com/floridoo/concat-with-sourcemaps.git",
77
"main": "index.js",
8+
"types": "index.d.ts",
89
"scripts": {
910
"test": "jshint *.js test/*.js && faucet test/*.js",
1011
"tap": "tape test/*.js",

0 commit comments

Comments
 (0)