@johnmorrisdotca/chikyu-earth 0.18.0 → 0.20.0

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.
@@ -0,0 +1,216 @@
1
+ // The day and night sheet and the seasons sheet: the Earth with the Sun's light on one half (hatched where it is night), and the Earth at four points round the Sun with its tilt. Pure: a string of SVG measured in millimetres.
2
+ import { geoCircle, geoDistance, geoOrthographic, geoPath } from "d3-geo";
3
+ import { subsolarPoint } from "../realistic/sun.js";
4
+ import { hatchPath } from "./hatch.js";
5
+ import { continentLines } from "./land.js";
6
+ import { thickPath } from "./outline.js";
7
+ import { SAY, TILT_DEGREES, TITLES, dayNightFacts, seasonsFacts } from "./text.js";
8
+ import { TYPES, factsBlock, haloText, innerMm, labelMm, nameBlock, outlineMm, svgOpen, textWidth } from "./common.js";
9
+ const GAP = 5;
10
+ const RAD = Math.PI / 180;
11
+ /** How far the view of the day and night globe is tipped to show the north (degrees): the line between day and night is then a curve. */
12
+ export const DAY_NIGHT_TIP = 20;
13
+ /**
14
+ * The turn of the globe on the day and night sheet for a moment: the Sun's longitude less 90 degrees at the middle, so the lit half is on the right, tipped to show the north.
15
+ * @param ms - The moment, in milliseconds since the Unix epoch.
16
+ * @returns The place at the middle of the globe, the place where the Sun is straight overhead and the roll of the globe about the line of sight, in degrees.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * import { dayNightView } from "@johnmorrisdotca/chikyu-earth/sheets";
21
+ *
22
+ * const view = dayNightView(Date.UTC(2026, 5, 21, 12));
23
+ * console.log(view.sun.lat.toFixed(1));
24
+ * ```
25
+ */
26
+ export function dayNightView(ms) {
27
+ const sun = subsolarPoint(ms);
28
+ const centre = [sun.lon - 90, DAY_NIGHT_TIP];
29
+ // the globe is rolled a little about the line of sight so the Sun is straight to the right of it (the Earth's axis then leans, as it does)
30
+ const flat = geoOrthographic().rotate([-centre[0], -centre[1]]).translate([0, 0]).scale(1);
31
+ const at = flat([sun.lon, sun.lat]) ?? [1, 0];
32
+ const roll = (Math.atan2(-at[1], at[0]) * 180) / Math.PI;
33
+ const side = (g) => Math.abs(geoOrthographic().rotate([-centre[0], -centre[1], g]).translate([0, 0]).scale(1)([sun.lon, sun.lat])?.[1] ?? 1);
34
+ return { centre, sun, roll: side(roll) <= side(-roll) ? roll : -roll };
35
+ }
36
+ /**
37
+ * The line between day and night at a moment: the points 90 degrees from where the Sun is straight overhead, as longitude and latitude.
38
+ * @param ms - The moment, in milliseconds since the Unix epoch.
39
+ * @param points - How many points (at least 3, default 72).
40
+ * @returns The points in order round the Earth.
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * import { terminator } from "@johnmorrisdotca/chikyu-earth/sheets";
45
+ *
46
+ * console.log(terminator(Date.UTC(2026, 2, 20, 12), 8).length);
47
+ * ```
48
+ */
49
+ export function terminator(ms, points = 72) {
50
+ const sun = subsolarPoint(ms);
51
+ const ring = geoCircle().center([sun.lon + 180, -sun.lat]).radius(90).precision(360 / Math.max(3, points))();
52
+ return ring.coordinates[0].slice(0, -1);
53
+ }
54
+ /** The Sun as a drawing: a disc with rays. */
55
+ function sunIcon(x, y, radius, thick) {
56
+ const rays = [];
57
+ for (let i = 0; i < 8; i += 1) {
58
+ const a = (Math.PI / 4) * i;
59
+ rays.push(`M${(x + Math.cos(a) * (radius + thick * 1.6)).toFixed(2)} ${(y + Math.sin(a) * (radius + thick * 1.6)).toFixed(2)}L${(x + Math.cos(a) * (radius + thick * 1.6 + 3)).toFixed(2)} ${(y + Math.sin(a) * (radius + thick * 1.6 + 3)).toFixed(2)}`);
60
+ }
61
+ return `<circle cx="${x}" cy="${y}" r="${radius}" fill="none" stroke="#000" stroke-width="${thick}" data-sun-icon=""/><path d="${rays.join("")}" fill="none" stroke="#000" stroke-width="${thick}" stroke-linecap="round"/>`;
62
+ }
63
+ /** An arrow from (x0, y0) to (x1, y1) with a head. */
64
+ function arrow(x0, y0, x1, y1, thick) {
65
+ const a = Math.atan2(y1 - y0, x1 - x0);
66
+ const head = thick * 2;
67
+ const hx = (k) => (x1 - Math.cos(a + k) * head).toFixed(2);
68
+ const hy = (k) => (y1 - Math.sin(a + k) * head).toFixed(2);
69
+ return `<path d="M${x0.toFixed(2)} ${y0.toFixed(2)}L${x1.toFixed(2)} ${y1.toFixed(2)}M${hx(0.55)} ${hy(0.55)}L${x1.toFixed(2)} ${y1.toFixed(2)}L${hx(-0.55)} ${hy(-0.55)}" fill="none" stroke="#000" stroke-width="${thick}" stroke-linecap="round" stroke-linejoin="round"/>`;
70
+ }
71
+ /**
72
+ * The day and night sheet: the Earth with the Sun's light coming from the right, the lit half left white (day) and the dark half hatched (night), the line between them thick, and three facts, for the date and time you give. The line is worked out from the package's own sun position.
73
+ * @param ms - The moment, in milliseconds since the Unix epoch.
74
+ * @param options - The room, the language and the type.
75
+ * @returns The `<svg>` markup, carrying the place of the Sun as `data-sun`.
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * import { dayNightSvg } from "@johnmorrisdotca/chikyu-earth/sheets";
80
+ *
81
+ * const svg = dayNightSvg(Date.UTC(2026, 5, 21, 12), { widthMm: 184.6, heightMm: 180 });
82
+ * console.log(svg.includes("data-sun="), svg.includes("Night"));
83
+ * ```
84
+ */
85
+ export function dayNightSvg(ms, options) {
86
+ const { widthMm: w, heightMm: h } = options;
87
+ const lang = options.lang ?? "en";
88
+ const type = options.type ?? "kid";
89
+ const outline = outlineMm(type);
90
+ const inner = innerMm(type);
91
+ const facts = factsBlock(dayNightFacts(ms, lang), w, 0, type);
92
+ const free = h - facts.height - GAP;
93
+ const zone = type === "kid" ? 40 : 28;
94
+ const reachOut = type === "kid" ? 22 : 14;
95
+ const diameter = Math.min(w - zone - reachOut, free);
96
+ const radius = diameter / 2 - outline / 2;
97
+ const left = (w - (diameter + zone + reachOut)) / 2;
98
+ const cx = left + diameter / 2;
99
+ const cy = free / 2;
100
+ const { centre, sun, roll } = dayNightView(ms);
101
+ const projection = geoOrthographic().rotate([-centre[0], -centre[1], roll]).translate([cx, cy]).scale(radius).clipAngle(90).precision(0.3);
102
+ const path = geoPath(projection);
103
+ const sunAt = [sun.lon, sun.lat];
104
+ const night = (x, y) => {
105
+ if (Math.hypot(x - cx, y - cy) > radius)
106
+ return false;
107
+ const place = projection.invert?.([x, y]);
108
+ return place !== null && place !== undefined && Number.isFinite(place[0]) && geoDistance(place, sunAt) > Math.PI / 2;
109
+ };
110
+ const shade = hatchPath({ x0: cx - radius, y0: cy - radius, x1: cx + radius, y1: cy + radius }, type === "kid" ? 3.2 : 1.6, 45, night);
111
+ const coast = thickPath(path({ type: "MultiLineString", coordinates: continentLines(0.0006) }) ?? "", outline * 0.4, outline * 3.5);
112
+ const line = path(geoCircle().center([sun.lon + 180, -sun.lat]).radius(90).precision(1)()) ?? "";
113
+ const size = labelMm(type);
114
+ const dayWord = nameBlock([SAY[lang].day], cx + radius * 0.5, cy - radius * 0.12, size, ' data-say="day"');
115
+ const nightWord = nameBlock([SAY[lang].night], cx - radius * 0.5, cy - radius * 0.12, size, ' data-say="night"');
116
+ const sx = left + diameter + reachOut + zone / 2;
117
+ const sunRadius = type === "kid" ? 11 : 7;
118
+ const arrows = [-0.5, 0, 0.5].map((k) => arrow(sx - zone / 2 - 1, cy + k * radius * 0.7, cx + Math.sqrt(Math.max(0, 1 - (k * 0.7) ** 2)) * radius + 4, cy + k * radius * 0.7, inner)).join("");
119
+ const sunWord = nameBlock([SAY[lang].sun], sx, cy + sunRadius + 20, size);
120
+ const picture = `<path d="${shade}" fill="none" stroke="#000" stroke-width="${type === "kid" ? 0.9 : 0.35}" stroke-linecap="round" data-night=""/>` +
121
+ `<path d="${line}" fill="none" stroke="#000" stroke-width="${inner}" data-terminator=""/>` +
122
+ `<path d="${coast}" fill="none" stroke="#000" stroke-width="${outline}" stroke-linecap="round" stroke-linejoin="round" data-coast=""/>` +
123
+ `<circle cx="${cx}" cy="${cy}" r="${radius}" fill="none" stroke="#000" stroke-width="${outline}" data-rim=""/>` +
124
+ `${dayWord.markup}${nightWord.markup}${arrows}${sunIcon(sx, cy, sunRadius, inner)}${sunWord.markup}`;
125
+ return `${svgOpen(w, h, TITLES.daynight(lang), "daynight").replace("<svg ", `<svg data-sun="${sun.lon.toFixed(3)} ${sun.lat.toFixed(3)}" data-view="${centre[0].toFixed(3)} ${centre[1]} ${roll.toFixed(3)}" data-disc="${cx.toFixed(3)} ${cy.toFixed(3)} ${radius.toFixed(3)}" `)}${picture}<g transform="translate(0 ${h - facts.height})">${facts.markup}</g></svg>`;
126
+ }
127
+ /** One Earth of the seasons sheet: a disc with the night half hatched, the equator and the tilted axis with a dot at the north. */
128
+ function earth(x, y, radius, towardSun, type) {
129
+ const outline = outlineMm(type);
130
+ const inner = innerMm(type);
131
+ const tilt = TILT_DEGREES;
132
+ const dark = (px, py) => Math.hypot(px - x, py - y) <= radius && (px - x) * towardSun[0] + (py - y) * towardSun[1] < 0;
133
+ const shade = hatchPath({ x0: x - radius, y0: y - radius, x1: x + radius, y1: y + radius }, type === "kid" ? 2.8 : 1.4, 45, dark);
134
+ const sin = Math.sin(tilt * RAD);
135
+ const cos = Math.cos(tilt * RAD);
136
+ const reach = radius * 1.4;
137
+ const north = [x + sin * reach, y - cos * reach];
138
+ const south = [x - sin * reach, y + cos * reach];
139
+ const dot = type === "kid" ? 2.6 : 1.4;
140
+ return (`<path d="${shade}" fill="none" stroke="#000" stroke-width="${type === "kid" ? 0.8 : 0.3}" stroke-linecap="round" data-night=""/>` +
141
+ `<path d="M${south[0].toFixed(2)} ${south[1].toFixed(2)}L${north[0].toFixed(2)} ${north[1].toFixed(2)}" fill="none" stroke="#000" stroke-width="${inner}" stroke-linecap="round" data-axis=""/>` +
142
+ `<circle cx="${north[0].toFixed(2)}" cy="${north[1].toFixed(2)}" r="${dot}" fill="#000"/>` +
143
+ `<circle cx="${x}" cy="${y}" r="${radius}" fill="none" stroke="#000" stroke-width="${outline}" data-earth=""/>`);
144
+ }
145
+ /**
146
+ * The seasons sheet: the Sun in the middle, the Earth's orbit as a ring, and the Earth at four points of it (March, June, September and December), each with its tilt, the dark half hatched, the season of the northern half named, and three facts.
147
+ * The axis leans the same way at all four, so in June the north leans toward the Sun and in December away from it.
148
+ * @param options - The room, the language and the type.
149
+ * @returns The `<svg>` markup.
150
+ *
151
+ * @example
152
+ * ```ts
153
+ * import { seasonsSvg } from "@johnmorrisdotca/chikyu-earth/sheets";
154
+ *
155
+ * const svg = seasonsSvg({ widthMm: 184.6, heightMm: 180, lang: "en" });
156
+ * console.log(svg.includes("Summer"), svg.includes("Winter"));
157
+ * ```
158
+ */
159
+ export function seasonsSvg(options) {
160
+ const { widthMm: w, heightMm: h } = options;
161
+ const lang = options.lang ?? "en";
162
+ const type = options.type ?? "kid";
163
+ const inner = innerMm(type);
164
+ const facts = factsBlock(seasonsFacts(lang), w, 0, type);
165
+ const free = h - facts.height - GAP;
166
+ const size = labelMm(type);
167
+ const month = TYPES[type].bodyMm;
168
+ const radius = Math.max(6, Math.min(type === "kid" ? 13 : 8, free * 0.1));
169
+ const cx = w / 2;
170
+ const cy = free / 2;
171
+ const ry = Math.max(radius * 2, free / 2 - radius - 4 - size * 1.15 - 2);
172
+ const rx = Math.min(cx - radius - (type === "kid" ? 22 : 14), ry * 2.8);
173
+ const sunRadius = Math.max(4, Math.min(type === "kid" ? 10 : 6, ry - radius - inner * 1.6 - 6));
174
+ const say = SAY[lang];
175
+ // the Earth at the right is December, at the top March, at the left June, at the bottom September, one way round
176
+ const stops = [
177
+ { angle: 0, season: say.winter, month: say.months[3] },
178
+ { angle: 90, season: say.spring, month: say.months[0] },
179
+ { angle: 180, season: say.summer, month: say.months[1] },
180
+ { angle: 270, season: say.autumn, month: say.months[2] },
181
+ ];
182
+ const at = (angle) => [cx + rx * Math.cos(angle * RAD), cy - ry * Math.sin(angle * RAD)];
183
+ const parts = [];
184
+ parts.push(`<ellipse cx="${cx}" cy="${cy}" rx="${rx}" ry="${ry}" fill="none" stroke="#000" stroke-width="${inner}" stroke-dasharray="${inner * 2.4} ${inner * 1.6}" data-orbit=""/>`);
185
+ for (const angle of [60, 120, 240, 300]) {
186
+ const [px, py] = at(angle);
187
+ const tx = -rx * Math.sin(angle * RAD);
188
+ const ty = -ry * Math.cos(angle * RAD);
189
+ const length = Math.hypot(tx, ty);
190
+ const ux = tx / length;
191
+ const uy = ty / length;
192
+ const head = inner * 1.8;
193
+ parts.push(`<polygon points="${(px + ux * head).toFixed(2)},${(py + uy * head).toFixed(2)} ${(px - ux * head - uy * head * 0.8).toFixed(2)},${(py - uy * head + ux * head * 0.8).toFixed(2)} ${(px - ux * head + uy * head * 0.8).toFixed(2)},${(py - uy * head - ux * head * 0.8).toFixed(2)}" fill="#000" data-way=""/>`);
194
+ }
195
+ parts.push(sunIcon(cx, cy, sunRadius, inner));
196
+ for (const stop of stops) {
197
+ const [px, py] = at(stop.angle);
198
+ const toSun = [(cx - px) / Math.hypot(cx - px, cy - py), (cy - py) / Math.hypot(cx - px, cy - py)];
199
+ parts.push(`<g data-season="${stop.angle}">${earth(px, py, radius, toSun, type)}</g>`);
200
+ if (stop.angle === 90 || stop.angle === 270) {
201
+ // above the top Earth and below the bottom one the season and the month are one line
202
+ const seasonW = textWidth(stop.season, size);
203
+ const monthW = textWidth(stop.month, month);
204
+ const left = px - (seasonW + 3 + monthW) / 2;
205
+ const base = stop.angle === 90 ? py - radius - 4 : py + radius + 4 + size * 0.8;
206
+ parts.push(haloText(left + seasonW / 2, base, size, stop.season, ' data-say="season"'));
207
+ parts.push(haloText(left + seasonW + 3 + monthW / 2, base, month, stop.month, ' data-say="month"'));
208
+ }
209
+ else {
210
+ const first = py + radius + 4 + size * 0.8;
211
+ parts.push(haloText(px, first, size, stop.season, ' data-say="season"'));
212
+ parts.push(haloText(px, first + month * 1.3, month, stop.month, ' data-say="month"'));
213
+ }
214
+ }
215
+ return `${svgOpen(w, h, TITLES.seasons(lang), "seasons")}${parts.join("")}<g transform="translate(0 ${h - facts.height})">${facts.markup}</g></svg>`;
216
+ }
@@ -0,0 +1,213 @@
1
+ import { type ContinentId } from "./land.ts";
2
+ import type { Lang } from "./common.ts";
3
+ /** The Earth's size, from the IAU nominal values (mean radius 6,371 km) and WGS84 (equatorial circumference 40,075 km), rounded: kilometres across, and round the equator. */
4
+ export declare const EARTH_KM: {
5
+ readonly across: 12742;
6
+ readonly round: 40075;
7
+ };
8
+ /**
9
+ * The tilt of the Earth's axis to its orbit, in degrees (the IAU's obliquity of the ecliptic at J2000: 23.4393).
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * import { TILT_DEGREES } from "@johnmorrisdotca/chikyu-earth/sheets";
14
+ *
15
+ * console.log(TILT_DEGREES.toFixed(1));
16
+ * ```
17
+ */
18
+ export declare const TILT_DEGREES = 23.4393;
19
+ export type PlaceKind = "continent" | "ocean";
20
+ /**
21
+ * A continent or an ocean, with where its name is written on a globe and on the flat map.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * import { PLACES, type Place } from "@johnmorrisdotca/chikyu-earth/sheets";
26
+ *
27
+ * const africa: Place | undefined = PLACES.find((place) => place.id === "africa");
28
+ * console.log(africa?.en, africa?.ja);
29
+ * ```
30
+ */
31
+ export interface Place {
32
+ id: string;
33
+ kind: PlaceKind;
34
+ /** The name in lines of words that are written one under the other. */
35
+ en: readonly string[];
36
+ /** The Japanese name as a child reads it (the reading), and the kanji with it for a title. */
37
+ ja: readonly string[];
38
+ kanji: string;
39
+ /** Longitude and latitude where the name is centred. */
40
+ at: readonly [number, number];
41
+ /** Where it is centred on the flat world map, when that is not `at`. */
42
+ mapAt?: readonly [number, number];
43
+ /** On the flat map the name is one line, for the narrow band of sea it is written in. */
44
+ oneLine?: boolean;
45
+ }
46
+ /**
47
+ * The seven continents and the five oceans the sheets name, with the longitude and latitude where each name is written.
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * import { PLACES } from "@johnmorrisdotca/chikyu-earth/sheets";
52
+ *
53
+ * console.log(PLACES.filter((place) => place.kind === "ocean").map((place) => place.en.join(" ")));
54
+ * ```
55
+ */
56
+ export declare const PLACES: readonly Place[];
57
+ /** A continent's name for a sentence, in one line; Japanese with its kanji. */
58
+ export declare function continentName(id: ContinentId, lang: Lang): string;
59
+ /**
60
+ * The package's name, the credits and the words a sheet carries, by language (the brand in a sheet's header is the page's to pass in).
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * import { SAY } from "@johnmorrisdotca/chikyu-earth/sheets";
65
+ *
66
+ * console.log(SAY.en.pack, SAY.ja.day);
67
+ * ```
68
+ */
69
+ export declare const SAY: {
70
+ readonly en: {
71
+ readonly pack: "Chikyu Earth";
72
+ readonly credits: "Outlines: Natural Earth (public domain). Names: kuni. The Sun's place: Meeus, Astronomical Algorithms.";
73
+ readonly day: "Day";
74
+ readonly night: "Night";
75
+ readonly sun: "Sun";
76
+ readonly flag: "Draw the flag!";
77
+ readonly star: "Capital";
78
+ readonly light: "Sunlight";
79
+ readonly spring: "Spring";
80
+ readonly summer: "Summer";
81
+ readonly autumn: "Autumn";
82
+ readonly winter: "Winter";
83
+ readonly months: readonly ["March", "June", "September", "December"];
84
+ readonly colour: "Colour the continents, then the oceans.";
85
+ };
86
+ readonly ja: {
87
+ readonly pack: "Chikyu Earth 地球";
88
+ readonly credits: "ちずの せん: Natural Earth (パブリックドメイン)。なまえ: kuni。たいようの いち: Meeus の けいさん。";
89
+ readonly day: "ひる";
90
+ readonly night: "よる";
91
+ readonly sun: "たいよう";
92
+ readonly flag: "はたを かこう!";
93
+ readonly star: "しゅと";
94
+ readonly light: "ひかり";
95
+ readonly spring: "はる";
96
+ readonly summer: "なつ";
97
+ readonly autumn: "あき";
98
+ readonly winter: "ふゆ";
99
+ readonly months: readonly ["3がつ", "6がつ", "9がつ", "12がつ"];
100
+ readonly colour: "たいりくと うみに いろを ぬろう。";
101
+ };
102
+ };
103
+ /**
104
+ * The three views of the globe sheet: the Americas, Europe and Africa, and Asia and Oceania.
105
+ *
106
+ * @example
107
+ * ```ts
108
+ * import { GLOBE_VIEWS } from "@johnmorrisdotca/chikyu-earth/sheets";
109
+ *
110
+ * console.log(GLOBE_VIEWS.join(", "));
111
+ * ```
112
+ */
113
+ export declare const GLOBE_VIEWS: readonly ["americas", "europe-africa", "asia-oceania"];
114
+ /**
115
+ * The name of a view of the globe sheet.
116
+ *
117
+ * @example
118
+ * ```ts
119
+ * import { globeSheetSvg, type GlobeView } from "@johnmorrisdotca/chikyu-earth/sheets";
120
+ *
121
+ * const view: GlobeView = "asia-oceania";
122
+ * console.log(globeSheetSvg(view, { widthMm: 184.6, heightMm: 170 }).includes("Asia"));
123
+ * ```
124
+ */
125
+ export type GlobeView = (typeof GLOBE_VIEWS)[number];
126
+ /** The place at the middle of each view, in longitude and latitude. */
127
+ export declare const VIEW_CENTRES: Readonly<Record<GlobeView, readonly [number, number]>>;
128
+ /** Where each name is written on each view of the globe, by place; a name not listed is not on that view. */
129
+ export declare const VIEW_LABELS: Readonly<Record<GlobeView, Readonly<Record<string, readonly [number, number]>>>>;
130
+ /**
131
+ * The title of each kind of sheet, in a language.
132
+ *
133
+ * @example
134
+ * ```ts
135
+ * import { TITLES } from "@johnmorrisdotca/chikyu-earth/sheets";
136
+ *
137
+ * console.log(TITLES.globe("americas", "en"), TITLES.country("Japan", "en"), TITLES.seasons("ja"));
138
+ * ```
139
+ */
140
+ export declare const TITLES: {
141
+ globe: (view: GlobeView, lang: Lang) => string;
142
+ map: (lang: Lang) => string;
143
+ country: (name: string, lang: Lang) => string;
144
+ daynight: (lang: Lang) => string;
145
+ seasons: (lang: Lang) => string;
146
+ };
147
+ /**
148
+ * The three facts of the globe sheet and of the world map, in plain words. The map's are the share of the land the biggest and the smallest continents have (from the outlines) and the Pacific.
149
+ * @param kind - `globe` or `map`.
150
+ * @param lang - `en` or `ja`.
151
+ * @returns Three sentences.
152
+ *
153
+ * @example
154
+ * ```ts
155
+ * import { earthFacts } from "@johnmorrisdotca/chikyu-earth/sheets";
156
+ *
157
+ * console.log(earthFacts("map", "en")[0]);
158
+ * ```
159
+ */
160
+ export declare function earthFacts(kind: "globe" | "map", lang: Lang): string[];
161
+ /** The moment as words, in UTC: `2026-06-21 12:00 UTC`. */
162
+ export declare const momentText: (ms: number) => string;
163
+ /**
164
+ * The three facts of the day and night sheet for a moment, with the place the Sun is straight overhead then.
165
+ * @param ms - The moment, in milliseconds since the Unix epoch.
166
+ * @param lang - `en` or `ja`.
167
+ * @returns Three sentences.
168
+ *
169
+ * @example
170
+ * ```ts
171
+ * import { dayNightFacts } from "@johnmorrisdotca/chikyu-earth/sheets";
172
+ *
173
+ * console.log(dayNightFacts(Date.UTC(2026, 5, 21, 12), "en")[1]);
174
+ * ```
175
+ */
176
+ export declare function dayNightFacts(ms: number, lang: Lang): string[];
177
+ /**
178
+ * The three facts of the seasons sheet.
179
+ * @param lang - `en` or `ja`.
180
+ * @returns Three sentences.
181
+ *
182
+ * @example
183
+ * ```ts
184
+ * import { seasonsFacts } from "@johnmorrisdotca/chikyu-earth/sheets";
185
+ *
186
+ * console.log(seasonsFacts("en")[0]);
187
+ * ```
188
+ */
189
+ export declare function seasonsFacts(lang: Lang): string[];
190
+ /**
191
+ * The three facts of a "my country" sheet: the continent it is in, the countries it touches and its capital.
192
+ * @param shape - The country's name and Japanese name, its continent and the names of its neighbours.
193
+ * @param capital - The capital's name, or `undefined` for a sheet that asks the child to find it.
194
+ * @param lang - `en` or `ja`.
195
+ * @returns Three sentences.
196
+ *
197
+ * @example
198
+ * ```ts
199
+ * import { countryFacts, countryShape } from "@johnmorrisdotca/chikyu-earth/sheets";
200
+ *
201
+ * const france = countryShape("FR")!;
202
+ * console.log(countryFacts(france, "Paris", "en")[1]);
203
+ * ```
204
+ */
205
+ export declare function countryFacts(shape: {
206
+ name: string;
207
+ ja: string;
208
+ continent: ContinentId;
209
+ neighbours: readonly {
210
+ name: string;
211
+ ja: string;
212
+ }[];
213
+ }, capital: string | undefined, lang: Lang): string[];