/** * @fileoverview Types for OpenFEC API responses and service return values. * Covers the three pagination models (page-based, keyset/SEEK, legal search) * and normalized result shapes returned by the service layer. * @module src/services/openfec/types */ /** Page-based pagination metadata (candidates, committees, filings, elections, calendar). */ export interface FecPagePagination { count: number; is_count_exact?: boolean; page: number; pages: number; per_page: number; } /** * Keyset (SEEK) pagination metadata (Schedule A/B/E). * * `last_indexes` values are scalars whose JSON type follows the sorted column: * amounts and dates come back quoted, but some numeric columns (Schedule E's * `office_total_ytd`) come back as raw numbers. */ export interface FecSeekPagination { count: number; is_count_exact?: boolean; last_indexes?: Record; per_page: number; } /** Standard FEC API response envelope with page-based pagination. */ export interface FecPageEnvelope> { api_version: string; pagination: FecPagePagination; results: T[]; } /** FEC API response envelope with keyset pagination. */ export interface FecSeekEnvelope> { api_version: string; pagination: FecSeekPagination; results: T[]; } /** * Legal search response — type-keyed result arrays instead of a * uniform `results` array. Each type has its own array and total count. */ export interface FecLegalEnvelope { admin_fines: Record[]; adrs: Record[]; advisory_opinions: Record[]; murs: Record[]; statutes: Record[]; total_admin_fines: number; total_adrs: number; total_advisory_opinions: number; total_all: number; total_murs: number; total_statutes: number; } /** Normalized result from page-based endpoints. */ export interface PageResult> { pagination: { page: number; pages: number; count: number; per_page: number; }; results: T[]; } /** Normalized result from keyset (SEEK) endpoints. */ export interface SeekResult> { nextCursor: string | null; pagination: { count: number; per_page: number; }; results: T[]; } /** Normalized legal search result with a flat results array. */ export interface LegalResult { results: Array & { document_type: string; }>; totalCount: number; } /** Flat response from the /elections/summary/ endpoint (no pagination wrapper). */ export interface ElectionSummary { count: number; disbursements: number; /** * Unreconciled upstream aggregate from /elections/summary/ — may be wildly inflated * due to double-counting across reporting periods. Surface with a caveat; use * /schedules/schedule_e/by_candidate/ for verified per-committee totals. */ independent_expenditures: number; receipts: number; } /** Query params passed to FEC API methods. Undefined values are stripped. Arrays serialize as repeated query params. */ export type FecParams = Record; //# sourceMappingURL=types.d.ts.map