Reference · Sky cultures: the figure and culture types, and your own culture
Culturetype
A sky culture: a named set of figures. Import one from its own entry point and pass it to constellations, constellation, starsIn, figures and figureOf.
Import it
import type { Culture } from "@johnmorrisdotca/hoshi-stars/culture";
Also exported from: @johnmorrisdotca/hoshi-stars/sky-labels
Definition
interface Culture {
readonly id: string;
readonly names: Readonly<{
en: string;
ja: string;
}>;
asterisms(): readonly Asterism[];
find(text: string): Asterism | undefined;
}
Members
| Name | Type | Description |
|---|---|---|
id | string | A short key for an address or a setting: |
names | Readonly<{ en: string; ja: string; }> | The culture's name in English and in Japanese. |
asterisms | (): readonly Asterism[] | The culture's figures, in a fixed order. Parsed once. |
find | (text: string): Asterism | undefined | One figure by any of its names (ignoring case, accents, tone marks and katakana against hiragana), its reading or its id; |
Examples
import { japanese } from "@johnmorrisdotca/hoshi-stars/cultures/japanese";
console.log(japanese.id, japanese.names.ja, japanese.asterisms().length);japanese 日本の伝統 106What it prints (run when this page was built)