Skip to content

Commit 4d8b3d0

Browse files
committed
Add TypeScript types
1 parent 9cb45b0 commit 4d8b3d0

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

index.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
interface Options {
2+
context: string,
3+
hashPrefix: string,
4+
}
5+
6+
type Generator = (localName: string, filepath: string) => string;
7+
8+
declare function createGenerator(pattern: string, options?: Partial<Options>): Generator;
9+
10+
export = createGenerator;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.0.2",
44
"description": "Helper for building generic names, similar to webpack",
55
"main": "index.js",
6+
"types": "index.d.ts",
67
"scripts": {
78
"test": "tape test/*.js"
89
},

0 commit comments

Comments
 (0)