Skip to content

Commit

Permalink
add typescript type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
mfedderly committed Dec 7, 2017
1 parent 18cb651 commit 5753991
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
declare module "iso-639-1" {
interface ISO6391 {
getName: (code: string) => string;
getAllNames: () => Array<string>;
getNativeName: (code: string) => string;
getAllNativeNames: () => Array<string>;
getCode: (name: string) => string;
getAllCodes: () => Array<string>;
validate: (code: string) => boolean;
getLanguages: (codes: Array<string>) => Array<{
code: string;
name: string;
nativeName: string;
}>;
}

let localeCode: ISO6391;

export = localeCode;
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "2.0.1",
"description": "ISO-639-1 codes",
"main": "build/index.js",
"typings": "index.d.ts",
"scripts": {
"build": "babel src --out-dir build",
"test": "mocha"
Expand Down

0 comments on commit 5753991

Please sign in to comment.