ecclesia
Version:
Framework for political and electoral simulations
13 lines (12 loc) • 728 B
TypeScript
import { Approval, Ranked, Score, Single } from "./ballot";
import { Simple, Order, Scores } from "./tally";
export declare function tallySingleToSimple<Candidate>(ballots: Iterable<Single<Candidate>>): Simple<Candidate>;
export declare function tallyApprovalToSimple<Candidate>(ballots: Iterable<Approval<Candidate>>): Simple<Candidate>;
export declare function tallyRankedToOrder<Candidate>(ballots: Iterable<Ranked<Candidate>>): Order<Candidate>;
/**
* This function assumes that the scores in each ballot are 0-based,
* going from 0, inclusive, to nScores, exclusive.
*/
export declare function tallyScoreToScores<Candidate>(ballots: Iterable<Score<Candidate>>, { nScores }: {
nScores: number;
}): Scores<Candidate>;