UNPKG

highest-averages

Version:

Zero-dependency and extensible set of highest averages methods for allocating seats in a parliament. ### Install ```shell npm i highest-averages ``` ### Pure Example - Define the candidates with their vote ```typescript const a = new Candidate('A', 200) c

12 lines (11 loc) 313 B
import { Candidate } from './candidate'; export declare class CandidateResult { readonly candidate: Candidate; readonly percentage: number; seat: number; constructor(candidate: Candidate, totalVote: number); name(): string; vote(): number; select(): void; selectable(): boolean; }