import type { CatalogueRecord } from "./pack.ts"; /** * What `readCatalogueRecords` found: the records that can be used, and how many were left out (a number missing or not a number, or an orbit that is not an ellipse). * * @example * ```ts * import type { CatalogueRead } from "@johnmorrisdotca/chikyu-earth/catalogue"; * * const say = (read: CatalogueRead): string => `${read.records.length} kept, ${read.skipped} left out`; * console.log(typeof say); * ``` */ export interface CatalogueRead { records: CatalogueRecord[]; skipped: number; } /** * Read catalogue records from OMM text, as JSON (a list of objects) or CSV (a header row, then a row for each object). Each row's elements are read as `parseElements` reads them, and `OBJECT_TYPE` (`PAYLOAD`, `ROCKET BODY`, `DEBRIS`, * `UNKNOWN`, `TBA`), `COUNTRY_CODE`, `LAUNCH_DATE` and `RCS_SIZE` give the kind, owner, launch and radar size where the row has them. Six-digit and longer catalogue numbers are read as they are: OMM carries them where a TLE cannot. * It throws if the text is neither JSON nor CSV with a header. * * @param input - What the source answered. * @returns The records, and the count left out. * * @example * ```ts * import { readCatalogueRecords } from "@johnmorrisdotca/chikyu-earth/catalogue"; * * const csv = [ * "OBJECT_NAME,OBJECT_ID,EPOCH,MEAN_MOTION,ECCENTRICITY,INCLINATION,RA_OF_ASC_NODE,ARG_OF_PERICENTER,MEAN_ANOMALY,NORAD_CAT_ID,BSTAR,MEAN_MOTION_DOT,MEAN_MOTION_DDOT,OBJECT_TYPE,COUNTRY_CODE,LAUNCH_DATE,RCS_SIZE", * "MADE-UP DEB,2026-002B,2026-11-08T04:12:35,14.9,0.01,82,10,90,20,1000001,0.0001,0.00001,0,DEBRIS,US,2026-02-01,SMALL", * ].join("\n"); * const { records } = readCatalogueRecords(csv); * console.log(records[0]?.set.NORAD_CAT_ID, records[0]?.kind, records[0]?.owner, records[0]?.size); * ``` */ export declare function readCatalogueRecords(input: string): CatalogueRead; /** * The records in rows already read from JSON: the same as `readCatalogueRecords` without the text step. Not part of the entry point; the refresh script uses it on Space-Track's answer. * * @param rows - OMM objects with their text or number fields. * @returns The records and the count left out. */ export declare function catalogueRecordsFromRows(rows: readonly unknown[]): CatalogueRead;