mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
Add types for barbellweights module (#27302)
* Add types for barbellweights * Add types for barbellweights
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { BarbellWeight } from "barbellweights";
|
||||
|
||||
let calculator: BarbellWeight;
|
||||
let results: any;
|
||||
|
||||
calculator = new BarbellWeight(200, "bench press");
|
||||
results = calculator.getResults();
|
||||
|
||||
calculator = new BarbellWeight(500, "deadlift");
|
||||
results = calculator.getResults();
|
||||
|
||||
calculator = new BarbellWeight(400, "squat");
|
||||
results = calculator.getResults();
|
||||
|
||||
calculator = new BarbellWeight(400, "deadlift", { program: "QUARTER" });
|
||||
results = calculator.getResults();
|
||||
|
||||
calculator = new BarbellWeight(400, "deadlift", { bar: 45 });
|
||||
results = calculator.getResults();
|
||||
|
||||
calculator = new BarbellWeight(400, "deadlift", { plates: [45, 10, 5] });
|
||||
results = calculator.getResults();
|
||||
|
||||
calculator = new BarbellWeight(400, "deadlift", { warmup_round_to: 5 });
|
||||
results = calculator.getResults();
|
||||
|
||||
calculator = new BarbellWeight(300, "squat", {
|
||||
program: "STARTING_STRENGTH",
|
||||
bar: 45,
|
||||
plates: [45, 25, 10, 5],
|
||||
warmup_round_to: 5
|
||||
});
|
||||
results = calculator.getResults();
|
||||
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
// Type definitions for barbellweights 0.4
|
||||
// Project: https://github.com/toddhibbs/barbellweight#readme
|
||||
// Definitions by: evelijn <https://github.com/evelijn>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface options {
|
||||
program?: string;
|
||||
bar?: number;
|
||||
plates?: number[];
|
||||
warmup_round_to?: number;
|
||||
}
|
||||
|
||||
export class BarbellWeight {
|
||||
constructor(workingWeight: number, lift: string, options?: options);
|
||||
getResults(): any;
|
||||
}
|
||||
|
||||
export namespace BarbellWeight {
|
||||
namespace BarbellWeight {
|
||||
function getResults(): void;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"barbellweights-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user