Skip to content

Commit 0361008

Browse files
feat: add type definition
1 parent ed47d79 commit 0361008

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

index.d.ts

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
type VinRawInfo = {
2+
madeIn: string;
3+
manufacturer: string;
4+
details: string;
5+
securityCode: string;
6+
year: string;
7+
assemblyPlant: string;
8+
serialNumber: string;
9+
};
10+
11+
type VinDecodedCarInfo = {
12+
country: string;
13+
serialNumber: string;
14+
manufacturer: string;
15+
modelYear: Array<string>;
16+
};
17+
18+
declare module "vin-decoder" {
19+
export function validate(vin: string, checksumParam?: string): boolean;
20+
21+
export function split(vin: string): VinRawInfo;
22+
export function decode(): VinDecodedCarInfo;
23+
}

tsconfig.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es2016",
4+
"module": "commonjs",
5+
"allowJs": true,
6+
"forceConsistentCasingInFileNames": true,
7+
"strict": true,
8+
"skipLibCheck": true,
9+
"noEmit": true
10+
},
11+
"exclude": ["test", "node_modules"]
12+
}

0 commit comments

Comments
 (0)