@lakea/core
Purpose
Section titled “Purpose”@lakea/core contains framework-agnostic code that can be used anywhere:
- Types — TypeScript interfaces for all astronomical objects
- App registry — Configuration for all Lakea apps
- Routing — Cross-app link utilities (
getAppLink) - Data fetchers — API clients (currently NASA, more planned)
Installation
Section titled “Installation”import { Star, Galaxy, Exoplanet } from '@lakea/core';Structure
Section titled “Structure”packages/core/src/├── types/ # All TypeScript interfaces├── apps/ # App registry and configuration├── routing/ # Cross-app link utilities├── data-fetchers/ # API clients│ └── nasa/ # NASA Exoplanet Archive (implemented)│ # Planned:│ # ├── static/ # JSON imports│ # ├── tap/ # TAP protocol (Gaia, VizieR)│ # └── sdss/ # SDSS SkyServer# Planned directories:# ├── transforms/ # Coordinate math# ├── streaming/ # Web Worker utils# └── utils/ # Math, stats helpersCoordinates
Section titled “Coordinates”interface Coordinates { ra: number; // Right Ascension (degrees) dec: number; // Declination (degrees) distance?: number; // Parsecs parallax?: number; // Milliarcseconds}Celestial Objects
Section titled “Celestial Objects”// All objects extend CelestialObjectinterface Star extends CelestialObject { type: 'star'; /* ... */ }interface Galaxy extends CelestialObject { type: 'galaxy'; /* ... */ }interface Exoplanet extends CelestialObject { type: 'exoplanet'; /* ... */ }
// Union type for any objecttype AstronomicalObject = Star | Galaxy | Exoplanet;Query Results
Section titled “Query Results”interface QueryResult<T> { data: T[]; totalCount: number; source: DataSource; pagination?: { offset: number; limit: number; hasMore: boolean };}Design Principles
Section titled “Design Principles”- No framework dependencies — Works in Node, browsers, workers
- Strict types — No
any, complete interfaces - Pure functions — No side effects in transforms
- Async-first — All data fetching is async