sejm-calculator/src/types.ts

22 wiersze
438 B
TypeScript

type PastCommiteeId = 'pis' | 'ko' | 'td' | 'lewica' | 'konfederacja';
export type PastSupport = {
[pastCommitteeId in PastCommiteeId]: number;
};
export type Committee = {
id: string,
name: string,
shortName: string,
threshold: number,
pastSupportEquivalence: Array<[PastCommiteeId, number]>,
};
export type Constituency = {
name: string,
size: number,
pastSupport: PastSupport,
support?: number[],
mandates?: number[],
};