spacemap 0.1.18 → 0.1.20

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,8 @@ export declare interface CoreMessages {
287
290
  scene_canvas_label: () => string;
288
291
  attribution_orbits: () => string;
289
292
  attribution_imagery: () => string;
293
+ attribution_stars: () => string;
294
+ attribution_constellations: () => string;
290
295
  credits_see_all: () => string;
291
296
  layer_surface: () => string;
292
297
  layer_clouds: () => string;
@@ -619,7 +624,7 @@ export declare class FlatMap {
619
624
  /** The moment the map is of. Moves the clouds and, on Earth, the season. */
620
625
  setTime(jd: number): void;
621
626
  setBody(bodyId: string): Promise<void>;
622
- /** Screen pixel for a place, relative to the map's own box. */
627
+ /** Screen pixel for the visible copy of a place. */
623
628
  project(lon: number, lat: number): [number, number] | null;
624
629
  /** The place under a pixel of the map's box, or null off the world. */
625
630
  unproject(px: number, py: number): LonLat | null;
@@ -940,13 +945,20 @@ export declare interface Host {
940
945
  * data export's host. Empty where none is served: bodies then draw their
941
946
  * whole-globe tiers alone. */
942
947
  tilesUrl: string;
948
+ /** Root of the extrasolar export, which holds the star render nodes and
949
+ * the record tiles. Empty where none is served, and the map then has no
950
+ * stars. */
951
+ extrasolarUrl: string;
943
952
  /** BCP-47 tag of the reading language: picks localized names and drives Intl. */
944
953
  locale: () => string;
945
954
  messages: CoreMessages;
946
955
  /** Link target of a body's scene label. */
947
956
  bodyHref: (id: string, name: string) => string;
957
+ /** Link target of a collection page's scene label, or of a figure of the
958
+ * sky culture `slug`. */
959
+ groupHref: (slug: string, name: string, figure?: string | null) => string;
948
960
  /** How far down the `distribution` ladder this embed may draw surface maps,
949
- * panoramas and craft models (docs/export-format/textures.md). `open` is
961
+ * panoramas, craft models and stars (docs/export-format/textures.md). `open` is
950
962
  * what anyone may serve, `non-commercial` adds works whose licence bars
951
963
  * commercial reuse, and `site-only` adds those cleared for spacemap.co
952
964
  * alone. A bare embed gets `open`: it cannot accept a licence for the page
@@ -1085,7 +1097,7 @@ export declare interface LonLat {
1085
1097
 
1086
1098
  /** Every layer, in the order a switcher should offer them: the objects first,
1087
1099
  * 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"];
1100
+ export declare const MAP_LAYERS: readonly ["planets", "dwarfPlanets", "moons", "asteroids", "comets", "spacecraft", "satellites", "debris", "starfield", "orbits", "labels", "halos", "nomenclature", "stars"];
1089
1101
 
1090
1102
  export declare interface MapEvents {
1091
1103
  focuschange: (e: FocusChange) => void;
@@ -1093,6 +1105,12 @@ export declare interface MapEvents {
1093
1105
  camera: (view: CameraState) => void;
1094
1106
  /** A nomenclature label was clicked; carries what a fly-to needs. */
1095
1107
  featureselect: (e: FeatureSelect) => void;
1108
+ /** A constellation's name was clicked; `slug` is its collection page. */
1109
+ constellationselect: (e: {
1110
+ slug: string;
1111
+ figure: string;
1112
+ name: string;
1113
+ }) => void;
1096
1114
  /** User-promoted bodies that can be cleared (the focused one excluded). */
1097
1115
  userpromoted: (count: number) => void;
1098
1116
  contextlost: () => void;
@@ -1315,6 +1333,18 @@ export declare interface OutOfRangeNotice {
1315
1333
  } | null;
1316
1334
  }
1317
1335
 
1336
+ /** The sky of a page. It leaves the reader's own layer settings alone. */
1337
+ export declare interface PageSky {
1338
+ /** The culture to draw. */
1339
+ culture: string;
1340
+ /** The figure to aim at, by its `slug`. */
1341
+ figure: string | null;
1342
+ /** Aim at once: the page opened the map. */
1343
+ opening: boolean;
1344
+ /** The reader turned the layer off on this page. */
1345
+ hidden: boolean;
1346
+ }
1347
+
1318
1348
  /** The product id, which names one panorama and no other. A stop held for
1319
1349
  * days leaves several mosaics sharing a time and a place, so the time and
1320
1350
  * place together do not. */
@@ -1777,11 +1807,22 @@ export declare interface SamplesOptions {
1777
1807
  * this structurally; an embed passes its own or takes the default. One per
1778
1808
  * page, registered through {@link setSceneSettings}: the tier and quality
1779
1809
  * helpers run deep in material code with no map instance at hand.
1810
+ *
1811
+ * A field added after a release is optional, so a host's own object stays
1812
+ * valid. {@link defaultSceneSettings} shows the default of each.
1780
1813
  */
1781
1814
  export declare interface SceneSettings {
1782
1815
  resolvedReducedMotion: boolean;
1783
1816
  viewMode: 'map' | 'immersive';
1784
1817
  showClouds: boolean;
1818
+ showConstellations?: boolean;
1819
+ /** Key of the sky culture the constellation layer draws. */
1820
+ constellationCulture?: string;
1821
+ /** What a constellation or culture page shows of the sky, for that view. */
1822
+ pageSky?: PageSky | null;
1823
+ /** The constellation layer hides the asteroids, comets and probes, and the
1824
+ * cloud of Earth satellites, which bury its faint figures. */
1825
+ clearSky?: boolean;
1785
1826
  showAtmospheres: boolean;
1786
1827
  atmosphereQuality: AtmosphereQualityTier;
1787
1828
  atmosphereAutoTier: ResolvedAtmosphereTier | null;
@@ -1836,9 +1877,13 @@ export declare interface ShapeStyle {
1836
1877
  /**
1837
1878
  * Simulation clock. Advances Julian Date by real elapsed time × timeScale;
1838
1879
  * timeScale === 0 means paused. `play()` re-resumes the previous non-zero scale.
1880
+ *
1881
+ * The clock holds only dates that a `Date` holds. A seek past them stops it at
1882
+ * the end of that range.
1839
1883
  */
1840
1884
  export declare class SimClock {
1841
1885
  jd: number;
1886
+ /* Excluded from this release type: askedJd */
1842
1887
  timeScale: number;
1843
1888
  direction: 1 | -1;
1844
1889
  /* Excluded from this release type: seeked */
@@ -1857,6 +1902,8 @@ export declare class SimClock {
1857
1902
  private arrivals;
1858
1903
  constructor(initialJd: number, live?: boolean);
1859
1904
  /* Excluded from this release type: tick */
1905
+ /** Put the clock on `jd`, or on the nearest date it can hold. */
1906
+ private move;
1860
1907
  /* Excluded from this release type: setBoundaryStops */
1861
1908
  /** Caller passes the unsigned magnitude; direction is applied here. */
1862
1909
  setTimeScale(magnitude: number): void;
@@ -1875,6 +1922,7 @@ export declare class SimClock {
1875
1922
  private settleAfterPause;
1876
1923
  /* Excluded from this release type: sweepTo */
1877
1924
  pause(): void;
1925
+ /* Excluded from this release type: hold */
1878
1926
  play(): void;
1879
1927
  /** Back to wall-clock time; live again only if playback is at 1×, since a
1880
1928
  * paused or fast clock drifts off it at once. */
@@ -1928,9 +1976,14 @@ export declare class SpaceMap {
1928
1976
  private canvas;
1929
1977
  private labelLayer;
1930
1978
  private stopWatching;
1979
+ private stopExtrasolarStale;
1931
1980
  private controls;
1932
1981
  private lostPanelTimer;
1933
1982
  private cooperative;
1983
+ /** Whether a click on a star takes the focus. A host's map has no page to
1984
+ * open for a star, so it is off unless the app turns it on. */
1985
+ private starSelectEnabled;
1986
+ private tripPins;
1934
1987
  private limits;
1935
1988
  private initialFocusPending;
1936
1989
  private pendingFocusId;
@@ -2031,6 +2084,7 @@ export declare class SpaceMap {
2031
2084
  * data of the body does not load. A later move stops this move.
2032
2085
  */
2033
2086
  jumpTo(target: JumpTarget): Promise<void>;
2087
+ /* Excluded from this release type: haloOnScreen */
2034
2088
  /** Whether `id` is in the scene, with a place at the date it shows. */
2035
2089
  private placedNow;
2036
2090
  /** The placement of {@link jumpTo}, on a body in the scene. */
@@ -2066,6 +2120,8 @@ export declare class SpaceMap {
2066
2120
  getLimits(): CameraLimits;
2067
2121
  private applyLimits;
2068
2122
  private applyGestures;
2123
+ /* Excluded from this release type: setStarSelectEnabled */
2124
+ /* Excluded from this release type: setTripPins */
2069
2125
  /** A wheel the page is to keep never reaches the orbit controls. It is not
2070
2126
  * cancelled, so the page scrolls as it would over any other element. */
2071
2127
  private readonly onWheelCapture;
@@ -2086,7 +2142,9 @@ export declare class SpaceMap {
2086
2142
  private cameraDistance;
2087
2143
  /* Excluded from this release type: focusOnBody */
2088
2144
  /* Excluded from this release type: snapToBody */
2145
+ /* Excluded from this release type: snapToBodyFrom */
2089
2146
  /* Excluded from this release type: snapToBodyFacing */
2147
+ /* Excluded from this release type: tripView */
2090
2148
  /* Excluded from this release type: focusOnFeature */
2091
2149
  /* Excluded from this release type: setFocusTarget */
2092
2150
  /** Where the camera is and what it orbits, as anchors a host can store,
@@ -2487,7 +2545,7 @@ export declare class Viewport {
2487
2545
  fromScreen(px: number, py: number): [number, number];
2488
2546
  /** Screen pixel for a place, or null where it is not on the map. */
2489
2547
  project(lon: number, lat: number): [number, number] | null;
2490
- /** Place under a screen pixel, or null where the pixel is off the world. */
2548
+ /** Place under a screen pixel, including repeated copies of the world. */
2491
2549
  unproject(px: number, py: number): [number, number] | null;
2492
2550
  /** How wide the whole world is in pixels — the jump that tells a drawn line
2493
2551
  * it has crossed the seam rather than moved. */
@@ -2498,6 +2556,8 @@ export declare class Viewport {
2498
2556
  * the map's own always first. Anything drawn on the map is drawn once per
2499
2557
  * offset, so a shape near the seam shows on both sides of it. */
2500
2558
  get repeatShifts(): number[];
2559
+ /** Offset that places this world position in the frame. */
2560
+ shiftInFrame(x: number): number;
2501
2561
  }
2502
2562
 
2503
2563
  export declare interface ViewState {