Skip to content

Commit

Permalink
feat: add TypeScript declarations
Browse files Browse the repository at this point in the history
Closes #122
  • Loading branch information
dkaraush authored and kenany committed Mar 26, 2023
1 parent 398a873 commit ef22831
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 'glicko2-lite' {
export = (
rating: number,
rd: number,
vol: number,
opponents: [
number, // rating
number, // rd
number // score 0..1
][],
options?: {
rating?: number,
tau?: number
}
) => ({
rating: number,
rd: number,
vol: number
});
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"license": "MIT",
"author": "Kenan Yildirim <kenan@kenany.me> (https://kenany.me/)",
"main": "index.js",
"type": "index.d.ts",
"engines": {
"node": "14 || 16 || >=18"
},
Expand Down

0 comments on commit ef22831

Please sign in to comment.