/** * The interactive picker behind `tdcv2 pack`. * * The catalogue is 108 bundles and growing. As one flat checkbox it was unusable: seven rows * visible at a time, languages and countries interleaved, and finding Brazil meant paging through * the alphabet. So it is browsed the way the catalogue is actually shaped — the locale-agnostic * set, then languages, then countries reached through a continent — with search from anywhere and * a basket you review before anything is downloaded. * * The map is not decoration. A continent lights up when you are on it, and every pick burns a * spark where that country actually is, so "what have I taken so far" is answerable at a glance. * Coordinates come from the registry index, not from a table kept here: the same picker exists in * three languages, and three copies of world geography would be three copies that disagree. * * This module draws and returns a decision. It never touches the network or the disk — the caller * installs and removes, which keeps the download progress, the digests and the config writing in * one place instead of two. */ /** A catalogue entry, as much of it as the picker cares about. */ export interface PickerBundle { readonly id: string; readonly name: string; readonly description: string; readonly bytes: number; readonly locale: string | undefined; readonly country: string | undefined; /** Continent keys. A list because Russia is honestly in two of them. */ readonly regions: readonly string[] | undefined; /** [longitude, latitude], roughly the middle of the country. */ readonly point: readonly [number, number] | undefined; } /** What the user decided. `null` means they left without confirming. */ export interface PickerResult { readonly install: readonly string[]; readonly remove: readonly string[]; } /** * The largest map that still leaves room for the list, or null when nothing sensible fits. * * `halfBlocks` is passed rather than read off the module, because it is the one thing here that * depends on the terminal: with half-blocks two map rows share one screen row, so the same map * costs half the height. A parameter makes the whole function a function of its arguments, which * is what lets the answer be pinned across implementations instead of being taken on trust. */ export declare function mapSize(columns: number, rows: number, reserved: number, halfBlocks: boolean): { w: number; h: number; } | null; /** * Where a country's point lands on a map of this size, or null when it falls outside. * * This is what puts each pick's spark where the country actually is, so it has to agree * everywhere: a map that lights Portugal for Spain is worse than no map. */ export declare function mapCell(lon: number, lat: number, w: number, h: number): { col: number; row: number; } | null; /** * The rasterised map as text, one character per pixel — the whole of the map's geometry in a * form a person can read and a fixture can hold. * * `.` is sea, a lower-case letter is inland, an upper-case letter is a coastline pixel. Five * implementations each carry their own copy of the continent outlines, and nothing compared * them: identical today, measured, with no test standing between them and a quiet edit. */ export declare function mapRows(w: number, h: number): readonly string[]; export declare function runPicker(bundles: readonly PickerBundle[], installedNow: ReadonlySet): Promise; //# sourceMappingURL=pack-picker.d.ts.map