/** * Voting Systems * * Models different electoral systems and seat allocation * * Research Foundation: * - Lijphart (1999): Patterns of Democracy * - Gallagher & Mitchell (2005): The Politics of Electoral Systems * - IPU PARLINE database: Electoral systems worldwide * * Main Systems: * - First-Past-The-Post (FPTP): USA, UK, India * - Proportional Representation (PR): Netherlands, Israel, Nordic countries * - Mixed systems: Germany, New Zealand, Japan * * @module elections/VotingSystem */ /** * Voting system types */ export declare enum VotingSystemType { /** First-Past-The-Post (winner takes all) */ FPTP = "FPTP", /** Proportional Representation (seats proportional to votes) */ PROPORTIONAL = "PROPORTIONAL", /** Mixed-Member Proportional (Germany-style) */ MIXED = "MIXED", /** Two-Round System (France) */ TWO_ROUND = "TWO_ROUND", /** Single Transferable Vote (Ireland) */ STV = "STV" } /** * Voting system configuration */ export interface VotingSystemConfig { /** System type */ type: VotingSystemType; /** Electoral threshold (% of votes needed for seats) */ threshold?: number; /** District magnitude (avg seats per district) */ districtMagnitude?: number; /** Number of total seats in parliament */ totalSeats?: number; } /** * Election results * Maps party ID to vote share (0-1) */ export type VoteShares = Record; /** * Seat allocation results * Maps party ID to seat share (0-1) */ export type SeatShares = Record; /** * Allocate seats based on vote shares * * @param voteShares - Vote shares by party * @param config - Voting system configuration * @returns Seat shares by party */ export declare function allocateSeats(voteShares: VoteShares, config: VotingSystemConfig): SeatShares; /** * Calculate disproportionality index (Gallagher index) * * Measures how much seat shares deviate from vote shares * 0 = perfectly proportional, higher = more disproportional * * Research: Gallagher (1991) * - Pure PR: 1-3 * - Mixed systems: 3-8 * - FPTP: 10-20 */ export declare function calculateDisproportionality(voteShares: VoteShares, seatShares: SeatShares): number; /** * Get typical electoral threshold by country */ export declare const TYPICAL_THRESHOLDS: Record; /** * Get typical voting system by country */ export declare const TYPICAL_VOTING_SYSTEMS: Record;