/** * @fileoverview Domain types for the Gutendex catalog API and normalized book records. * @module services/gutendex/types */ /** Raw person record from the Gutendex API (author, translator, editor). */ export interface RawPerson { birth_year: number | null; death_year: number | null; name: string; } /** Raw book record from the Gutendex API. */ export interface RawBook { authors: RawPerson[]; bookshelves: string[]; copyright: boolean | null; download_count: number; /** Absent on records Gutendex has no editor credit for; present as `[]` on most. */ editors?: RawPerson[]; formats: Record; id: number; languages: string[]; media_type: string; subjects: string[]; summaries?: string[]; title: string; translators: RawPerson[]; } /** Raw paginated list response from Gutendex. */ export interface RawBooksPage { count: number; next: string | null; previous: string | null; results: RawBook[]; } /** Normalized person (author / translator / editor). */ export interface Person { birth_year: number | null; death_year: number | null; name: string; } /** Normalized book record with computed fields. */ export interface Book { authors: Person[]; bookshelves: string[]; copyright: boolean | null; download_count: number; editors: Person[]; formats: Record; /** True when media_type is "Text" and a UTF-8 text/plain format is available. */ has_plain_text: boolean; id: number; languages: string[]; media_type: string; subjects: string[]; /** Every upstream summary, in upstream order. Empty when there are none. */ summaries: string[]; /** First entry of {@link summaries}, or null when upstream sent none. */ summary: string | null; title: string; translators: Person[]; } /** Parameters for a Gutendex book search. */ export interface SearchParams { author_year_end?: number | undefined; author_year_start?: number | undefined; ids?: number[] | undefined; languages?: string[] | undefined; page?: number | undefined; query?: string | undefined; sort?: 'popular' | 'ascending' | 'descending' | undefined; topic?: string | undefined; } /** * Whether gutenberg_get_text can serve this book as plain text: media_type * "Text" with a UTF-8 text/plain format present. US-ASCII-only entries are * excluded — they have no path on the sanctioned mirror and resolve to * no_text_format — so the flag never advertises text the reader tool can't * deliver. (HTML-fallback-only books are likewise not counted here; the flag * tracks plain-text availability, not HTML-derived readability.) */ export declare function hasPlainText(book: RawBook): boolean; //# sourceMappingURL=types.d.ts.map