import { type BallotFileFormat, type VoteFileFormat } from "./parser.js"; import type { PathOrFileDescriptor } from "fs"; import VoteResult from "./votingMethods/VoteResult.js"; import CondorcetResult from "./votingMethods/CondorcetResult.js"; import SingleRoundResult from "./votingMethods/SingleRoundResult.js"; import type { ElectionSummaryOptions } from "./summary/electionSummary.js"; export interface Actor { id: string; } export type VoteCandidate = string; export type VoteMethod = "MajorityJudgment" | "Condorcet" | "InstantRunoff" | "Scored" | "SingleRound"; export type Rank = number; export interface Ballot { voter: Actor; preferences: Map; } export declare function getVoteResultImplementation(method: VoteMethod): typeof CondorcetResult | typeof SingleRoundResult; export interface VoteCommit { sha: string; author: string; signatureStatus: string; files: string[]; } export default class Vote { #private; subject: string; private result; private textDecoder; voteFileData: VoteFileFormat; constructor(options?: { candidates?: VoteCandidate[]; authorizedVoters?: Actor[]; votes?: Ballot[]; targetMethod?: VoteMethod; subject?: string; }); loadFromFile(voteFilePath: PathOrFileDescriptor): void; loadFromString(voteFileContents: string): void; private voteFromVoteData; set targetMethod(method: VoteMethod); addCandidate(candidate: VoteCandidate, checkUniqueness?: boolean): void; reasonToDiscardCommit(commit: VoteCommit): string; addBallotFile(ballotData: BallotFileFormat, author?: string): Ballot; addFakeBallot(author: string): void; addBallotFromBufferSource(data: BufferSource, author?: string): void; addBallot(ballot: Ballot): void; count(options?: Partial & { method?: VoteMethod; }): VoteResult; }