spacemap 0.1.17 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -233,6 +233,9 @@ declare interface CommonOptions {
233
233
  * production CDN serves none: without it a body draws its whole-globe
234
234
  * maps alone. */
235
235
  tilesUrl?: string;
236
+ /** Root of the extrasolar export, for a mirror that serves it. Without it
237
+ * the map has no stars. */
238
+ extrasolarUrl?: string;
236
239
  /** BCP-47 tag that picks localized names; English when omitted. */
237
240
  locale?: string;
238
241
  /** Replaces the English wording the map renders itself, one key at a time. */
@@ -242,8 +245,8 @@ declare interface CommonOptions {
242
245
  * one. Turning it on covers the Uranus map, which otherwise renders in
243
246
  * its fallback colour, the Huygens descent panorama of Titan, which is
244
247
  * otherwise a place on the map with no sphere to open, and the models of
245
- * a few craft (Buran, Vostok, Lunokhod), which otherwise stay markers;
246
- * the page accepts each one's terms by asking for it, and the credit line
248
+ * a few craft (Buran, Vostok, Lunokhod), which otherwise stay markers, and
249
+ * the stars from Gaia, which otherwise stay off the map; the page accepts each one's terms by asking for it, and the credit line
247
250
  * naming its author is a condition of them, not a courtesy. Some maps are
248
251
  * ours for spacemap.co alone and this does not reach them. */
249
252
  includeNonCommercial?: boolean;
@@ -287,6 +290,7 @@ export declare interface CoreMessages {
287
290
  scene_canvas_label: () => string;
288
291
  attribution_orbits: () => string;
289
292
  attribution_imagery: () => string;
293
+ attribution_stars: () => string;
290
294
  credits_see_all: () => string;
291
295
  layer_surface: () => string;
292
296
  layer_clouds: () => string;
@@ -619,7 +623,7 @@ export declare class FlatMap {
619
623
  /** The moment the map is of. Moves the clouds and, on Earth, the season. */
620
624
  setTime(jd: number): void;
621
625
  setBody(bodyId: string): Promise<void>;
622
- /** Screen pixel for a place, relative to the map's own box. */
626
+ /** Screen pixel for the visible copy of a place. */
623
627
  project(lon: number, lat: number): [number, number] | null;
624
628
  /** The place under a pixel of the map's box, or null off the world. */
625
629
  unproject(px: number, py: number): LonLat | null;
@@ -940,13 +944,17 @@ export declare interface Host {
940
944
  * data export's host. Empty where none is served: bodies then draw their
941
945
  * whole-globe tiers alone. */
942
946
  tilesUrl: string;
947
+ /** Root of the extrasolar export, which holds the star render nodes and
948
+ * the record tiles. Empty where none is served, and the map then has no
949
+ * stars. */
950
+ extrasolarUrl: string;
943
951
  /** BCP-47 tag of the reading language: picks localized names and drives Intl. */
944
952
  locale: () => string;
945
953
  messages: CoreMessages;
946
954
  /** Link target of a body's scene label. */
947
955
  bodyHref: (id: string, name: string) => string;
948
956
  /** How far down the `distribution` ladder this embed may draw surface maps,
949
- * panoramas and craft models (docs/export-format/textures.md). `open` is
957
+ * panoramas, craft models and stars (docs/export-format/textures.md). `open` is
950
958
  * what anyone may serve, `non-commercial` adds works whose licence bars
951
959
  * commercial reuse, and `site-only` adds those cleared for spacemap.co
952
960
  * alone. A bare embed gets `open`: it cannot accept a licence for the page
@@ -1085,7 +1093,7 @@ export declare interface LonLat {
1085
1093
 
1086
1094
  /** Every layer, in the order a switcher should offer them: the objects first,
1087
1095
  * then the chrome drawn around them. */
1088
- export declare const MAP_LAYERS: readonly ["planets", "dwarfPlanets", "moons", "asteroids", "comets", "spacecraft", "satellites", "debris", "orbits", "labels", "halos", "nomenclature", "stars"];
1096
+ export declare const MAP_LAYERS: readonly ["planets", "dwarfPlanets", "moons", "asteroids", "comets", "spacecraft", "satellites", "debris", "starfield", "orbits", "labels", "halos", "nomenclature", "stars"];
1089
1097
 
1090
1098
  export declare interface MapEvents {
1091
1099
  focuschange: (e: FocusChange) => void;
@@ -1373,7 +1381,7 @@ export declare interface PanoramaEntry {
1373
1381
  * `unknown` means the sphere sits at an arbitrary azimuth, so nothing
1374
1382
  * may be drawn or written as a heading. The full set `export/panoramas.py`
1375
1383
  * writes — a wider union would erase the literals and stop checking. */
1376
- orientation?: 'unknown' | 'caption-aligned' | 'matched to an archival sphere' | 'matched to a controlled mosaic';
1384
+ orientation?: 'unknown' | 'caption-aligned' | 'matched to an archival sphere' | 'matched to a controlled mosaic' | 'matched to a terrain model' | 'fitted to the Sun';
1377
1385
  /** `estimated` where the sphere's angular bounds were fitted to a
1378
1386
  * published flat image rather than read from an archive label. */
1379
1387
  geometry?: 'estimated';
@@ -1853,6 +1861,8 @@ export declare class SimClock {
1853
1861
  private prevScale;
1854
1862
  private stops;
1855
1863
  private settleTimer;
1864
+ /** The promises of {@link jumpTo} that wait for a frame at their date. */
1865
+ private arrivals;
1856
1866
  constructor(initialJd: number, live?: boolean);
1857
1867
  /* Excluded from this release type: tick */
1858
1868
  /* Excluded from this release type: setBoundaryStops */
@@ -1860,9 +1870,12 @@ export declare class SimClock {
1860
1870
  setTimeScale(magnitude: number): void;
1861
1871
  toggleDirection(): void;
1862
1872
  /* Excluded from this release type: setJD */
1863
- /** Seek, and mark it as a discrete jump so listeners can react to the one
1864
- * move rather than to a stream of them. */
1865
- jumpTo(jd: number): void;
1873
+ /** Move the clock to `jd` in one jump, so that listeners react to it once.
1874
+ * The promise resolves when a frame shows the bodies at that date. Until
1875
+ * the data of the date loads, the map shows the date before the jump, and
1876
+ * the measures answer for that date. */
1877
+ jumpTo(jd: number): Promise<void>;
1878
+ /* Excluded from this release type: placed */
1866
1879
  /** Rest the settled date on where the clock stands now. */
1867
1880
  private settle;
1868
1881
  /** The same, once a drag holds still. A clock still playing is left alone: it
@@ -1877,8 +1890,9 @@ export declare class SimClock {
1877
1890
  get playing(): boolean;
1878
1891
  /** The moment the map is showing. */
1879
1892
  get date(): Date;
1880
- /** Show another moment, as one deliberate move. */
1881
- setDate(date: Date): void;
1893
+ /** Move the clock to `date` in one jump. The promise resolves as the promise
1894
+ * of {@link jumpTo} does. */
1895
+ setDate(date: Date): Promise<void>;
1882
1896
  }
1883
1897
 
1884
1898
  /**
@@ -1922,9 +1936,13 @@ export declare class SpaceMap {
1922
1936
  private canvas;
1923
1937
  private labelLayer;
1924
1938
  private stopWatching;
1939
+ private stopExtrasolarStale;
1925
1940
  private controls;
1926
1941
  private lostPanelTimer;
1927
1942
  private cooperative;
1943
+ /** Whether a click on a star takes the focus. A host's map has no page to
1944
+ * open for a star, so it is off unless the app turns it on. */
1945
+ private starSelectEnabled;
1928
1946
  private limits;
1929
1947
  private initialFocusPending;
1930
1948
  private pendingFocusId;
@@ -2018,9 +2036,17 @@ export declare class SpaceMap {
2018
2036
  * the move a click on its label makes. Resolves when the camera comes
2019
2037
  * round. */
2020
2038
  panTo(target: FeatureTarget): Promise<void>;
2021
- /** Put the camera somewhere at once, with no flight: what a page restoring a
2022
- * stored view wants, where a flight from nowhere would read as a lurch. */
2023
- jumpTo(target: JumpTarget): this;
2039
+ /**
2040
+ * Put the camera at a place at once, with no flight. Use it to restore a
2041
+ * stored view. A body that the map has not loaded loads first. The promise
2042
+ * resolves one frame after the camera is in its place. It rejects when the
2043
+ * data of the body does not load. A later move stops this move.
2044
+ */
2045
+ jumpTo(target: JumpTarget): Promise<void>;
2046
+ /** Whether `id` is in the scene, with a place at the date it shows. */
2047
+ private placedNow;
2048
+ /** The placement of {@link jumpTo}, on a body in the scene. */
2049
+ private snap;
2024
2050
  /** Where the camera is now. Null before the first frame, and while nothing
2025
2051
  * is focused. */
2026
2052
  getCamera(): CameraState | null;
@@ -2052,6 +2078,7 @@ export declare class SpaceMap {
2052
2078
  getLimits(): CameraLimits;
2053
2079
  private applyLimits;
2054
2080
  private applyGestures;
2081
+ /* Excluded from this release type: setStarSelectEnabled */
2055
2082
  /** A wheel the page is to keep never reaches the orbit controls. It is not
2056
2083
  * cancelled, so the page scrolls as it would over any other element. */
2057
2084
  private readonly onWheelCapture;
@@ -2072,6 +2099,7 @@ export declare class SpaceMap {
2072
2099
  private cameraDistance;
2073
2100
  /* Excluded from this release type: focusOnBody */
2074
2101
  /* Excluded from this release type: snapToBody */
2102
+ /* Excluded from this release type: snapToBodyFrom */
2075
2103
  /* Excluded from this release type: snapToBodyFacing */
2076
2104
  /* Excluded from this release type: focusOnFeature */
2077
2105
  /* Excluded from this release type: setFocusTarget */
@@ -2473,7 +2501,7 @@ export declare class Viewport {
2473
2501
  fromScreen(px: number, py: number): [number, number];
2474
2502
  /** Screen pixel for a place, or null where it is not on the map. */
2475
2503
  project(lon: number, lat: number): [number, number] | null;
2476
- /** Place under a screen pixel, or null where the pixel is off the world. */
2504
+ /** Place under a screen pixel, including repeated copies of the world. */
2477
2505
  unproject(px: number, py: number): [number, number] | null;
2478
2506
  /** How wide the whole world is in pixels — the jump that tells a drawn line
2479
2507
  * it has crossed the seam rather than moved. */
@@ -2484,6 +2512,8 @@ export declare class Viewport {
2484
2512
  * the map's own always first. Anything drawn on the map is drawn once per
2485
2513
  * offset, so a shape near the seam shows on both sides of it. */
2486
2514
  get repeatShifts(): number[];
2515
+ /** Offset that places this world position in the frame. */
2516
+ shiftInFrame(x: number): number;
2487
2517
  }
2488
2518
 
2489
2519
  export declare interface ViewState {