mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Merge pull request #32753 from apavlinovic/master
Adds elo-rank typings
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
import EloRank from "elo-rank";
|
||||
|
||||
const test = new EloRank();
|
||||
|
||||
test.getKFactor(); // $ExpectType number
|
||||
test.getExpected(1200, 1500); // $ExpectType number
|
||||
test.updateRating(test.getExpected(1200, 1500), 1300, 1500); // $ExpectType number
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// Type definitions for elo-rank 1.0
|
||||
// Project: https://github.com/dmamills/elo-rank#readme
|
||||
// Definitions by: Antonio Pavlinovic <https://github.com/apavlinovic>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.7
|
||||
|
||||
declare class EloRank {
|
||||
constructor(kFactor?: number);
|
||||
setKFactor(kFactor: number): void;
|
||||
getKFactor(): number;
|
||||
getExpected(a: number, b: number): number;
|
||||
updateRating(expected: number, actual: number, current: number): number;
|
||||
}
|
||||
|
||||
export = EloRank;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"elo-rank-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user