UNPKG

western-signs

Version:

Simple interface for western astrological signs.

557 lines (551 loc) 17.6 kB
// Generated by dts-bundle-generator v9.5.1 export declare const SIGNS: { readonly ARIES: "aries"; readonly TAURUS: "taurus"; readonly GEMINI: "gemini"; readonly CANCER: "cancer"; readonly LEO: "leo"; readonly VIRGO: "virgo"; readonly LIBRA: "libra"; readonly SCORPIO: "scorpio"; readonly SAGITTARIUS: "sagittarius"; readonly CAPRICORN: "capricorn"; readonly AQUARIUS: "aquarius"; readonly PISCES: "pisces"; }; export declare const PLANETS: { readonly MARS: "mars"; readonly VENUS: "venus"; readonly MERCURY: "mercury"; readonly MOON: "moon"; readonly SUN: "sun"; readonly PLUTO: "pluto"; readonly JUPITER: "jupiter"; readonly SATURN: "saturn"; readonly URANUS: "uranus"; readonly NEPTUNE: "neptune"; }; export declare const MODALITIES: { readonly CARDINAL: "cardinal"; readonly FIXED: "fixed"; readonly MUTABLE: "mutable"; }; export declare const ELEMENTS: { readonly FIRE: "fire"; readonly EARTH: "earth"; readonly AIR: "air"; readonly WATER: "water"; }; declare const POLARITIES: { readonly POSITIVE: "positive"; readonly NEGATIVE: "negative"; }; declare const BODY_PARTS: { readonly HEAD: "head"; readonly THROAT: "throat"; readonly LUNGS: "lungs"; readonly STOMACH: "stomach"; readonly HEART: "heart"; readonly BOWELS: "bowels"; readonly REINS: "reins"; readonly SECRETS: "secrets"; readonly THIGHS: "thighs"; readonly KNEES: "knees"; readonly ANKLES: "ankles"; readonly FEET: "feet"; }; declare const CHARACTERS: { readonly RAM: "ram"; readonly BULL: "bull"; readonly TWINS: "twins"; readonly CRAB: "crab"; readonly LION: "lion"; readonly VIRGIN: "virgin"; readonly BALANCE: "balance"; readonly SCORPION: "scorpion"; readonly ARCHER: "archer"; readonly GOAT: "goat"; readonly THE_MAN: "the-man"; readonly THE_FISHES: "the-fishes"; }; declare const SEASONS: { readonly SPRING: "spring"; readonly SUMMER: "summer"; readonly AUTUMN: "autumn"; readonly WINTER: "winter"; }; declare const HOUSES: readonly [ "house1", "house2", "house3", "house4", "house5", "house6", "house7", "house8", "house9", "house10", "house11", "house12" ]; declare const HOUSE_TITLES: readonly [ "houseTitle1", "houseTitle2", "houseTitle3", "houseTitle4", "houseTitle5", "houseTitle6", "houseTitle7", "houseTitle8", "houseTitle9", "houseTitle10", "houseTitle11", "houseTitle12" ]; declare const HOUSE_KEYWORDS: readonly [ "houseKeywords1", "houseKeywords2", "houseKeywords3", "houseKeywords4", "houseKeywords5", "houseKeywords6", "houseKeywords7", "houseKeywords8", "houseKeywords9", "houseKeywords10", "houseKeywords11", "houseKeywords12" ]; export declare const HEMISPHERES: { readonly LOWER: "lower"; readonly UPPER: "upper"; }; export declare const HOUSE_MODALITIES: { readonly ANGULAR: "angular"; readonly SUCCEDENT: "succedent"; readonly CADENT: "cadent"; }; declare const PLANET_TYPE: { readonly LUMINARY: "luminary"; readonly PERSONAL: "personal"; readonly SOCIAL: "social"; readonly TRANSPERSONAL: "transpersonal"; readonly OTHER: "other"; }; export declare const ASPECTS: { readonly CONJUNCTION: "conjunction"; readonly SEMISEXTILE: "semisextile"; readonly SEXTILE: "sextile"; readonly QUADRATURE: "quadrature"; readonly TRIGONE: "trigone"; readonly QUINCUNX: "quincunx"; readonly OPPOSITION: "opposition"; }; declare const dictionaries: { en: Dictionary; es: Dictionary; ca: Dictionary; }; export type Language = keyof typeof dictionaries; export type ObjectValues<T> = T[keyof T]; export type Signs = ObjectValues<typeof SIGNS>; export type Elements = ObjectValues<typeof ELEMENTS>; export type Modalities = ObjectValues<typeof MODALITIES>; export type Planets = ObjectValues<typeof PLANETS>; export type Polarities = ObjectValues<typeof POLARITIES>; export type BodyParts = ObjectValues<typeof BODY_PARTS>; export type Characters = ObjectValues<typeof CHARACTERS>; export type Seasons = ObjectValues<typeof SEASONS>; export type Hemispheres = ObjectValues<typeof HEMISPHERES>; export type HouseModalities = ObjectValues<typeof HOUSE_MODALITIES>; export type PlanetType = ObjectValues<typeof PLANET_TYPE>; export type Aspects = ObjectValues<typeof ASPECTS>; export type HouseTitles = (typeof HOUSE_TITLES)[number]; export type HouseKeywords = (typeof HOUSE_KEYWORDS)[number]; export type Houses = (typeof HOUSES)[number]; export type Symbols = Signs | Planets | Aspects | "ascendant"; export interface Sign { /** * The body part associated with the zodiac sign. * Indicates the areas of the body influenced by the sign. * Examples: "Head" for Aries, "Throat" for Taurus. */ bodyPart: string; /** * The character associated with the zodiac sign. * A visual representation or icon associated with the sign. * Examples: "The Ram" for Aries, "The Bull" for Taurus. */ character: string; /** * The element associated with the zodiac sign. * Represents one of the four classical elements: Fire, Earth, Air, Water. * Also known as triplicities in astrology. * Examples: "Fire" for Aries, "Earth" for Taurus. */ element: Elements; /** * The end date of the zodiac sign period. * This date marks the end of the zodiac sign's influence for the given year. * Examples: new Date(2020, 3, 20) for Aries (April 20, 2020), new Date(2020, 4, 21) for Taurus (May 21, 2020). */ endDate: Date; /** * The glyph representing the zodiac sign. * A symbolic character or drawing associated with the sign. * Examples: "♈" for Aries, "♉" for Taurus. */ glyph: string; /** * The modality of the sign. * Indicates its mode of operation: Cardinal, Fixed, or Mutable. * Examples: "Cardinal" for Aries, "Fixed" for Taurus. */ modality: string; /** * The name of the zodiac sign. * Examples: "Aries", "Taurus". */ name: string; /** * The number associated with the zodiac sign. * Reflects its order in the zodiac cycle. * Examples: 1 for Aries (the first sign), 2 for Taurus (the second sign). */ number: number; /** * The polarity of the sign. * Indicates its active (Positive) or passive (Negative) nature. * Examples: "Positive" for Aries, "Negative" for Taurus. */ pole: string; /** * The ruling planet of the zodiac sign. * Represents the guiding celestial body influencing the sign. * Examples: "Mars" for Aries, "Venus" for Taurus. */ rulingPlanet: string; /** * The season in which the zodiac sign occurs. * Indicates the time of year the sign predominates. * Examples: "Spring" for Aries, "Spring" for Taurus. */ season: string; /** * The start date of the zodiac sign period. * This date marks the beginning of the zodiac sign's influence for the given year. * Examples: new Date(2020, 2, 20) for Aries (March 20, 2020), new Date(2020, 3, 21) for Taurus (April 21, 2020). */ startDate: Date; } export interface House { /** * Element associated with the house’s natural zodiac sign. * * Represents one of the four classical elements — Fire, Earth, Air, or Water — reflecting the essential nature and mode of expression of the house. * * Example: "Fire" for House 1 (Aries), "Earth" for House 2 (Taurus) */ element: Elements; /** * Hemisphere division based on the horizon line. * * - **Lower/Northern Hemisphere (Houses 1–6):** Known as the *Personal Houses*, these focus on individual development, personal identity, and foundational life needs. * - **Upper/Southern Hemisphere (Houses 7–12):** Known as the *Collective Houses*, these reflect relationships with others, society, and broader humanity. */ hemisphere: Hemispheres; /** * Key themes and associated concepts. * * Represents the core ideas or psychological themes governed by the house. * Example: ['Self-image', 'Identity', 'Impressions on others', 'Personality'] */ keywords: string[] | string; /** * Number of the astrological house (1–12). * * Each house corresponds to a specific domain of life experience. * Example: 1 = Self and identity, 7 = Partnerships and relating. */ number: number; /** * Developmental phase grouping. * * - **Phase I (Houses 1–4):** Focus on self-awareness and personal foundation — the “me-in-here”. * - **Phase II (Houses 5–8):** Development of the autonomous self in relationship — the “me” meets the “you”. * - **Phase III (Houses 9–12):** Expansion of self toward collective consciousness and universal understanding. */ phase: 1 | 2 | 3; /** * Quadrant of the chart based on the intersection of horizon and meridian axes. * * - **Quadrant I (Houses 1–3):** Formation of personal identity through the body, possessions, and environment. * - **Quadrant II (Houses 4–6):** Further development of self via family, creativity, and refinement of skills. * - **Quadrant III (Houses 7–9):** Expansion through relationships, transformation, and new vision of self. * - **Quadrant IV (Houses 10–12):** Integration into society and pursuit of collective and spiritual purpose. */ quadrant: 1 | 2 | 3 | 4; /** * Ruling planet of the house. * * Indicates the primary planetary influence over the house’s themes. * Example: "Mars", "Venus" */ rulingPlanet: string; /** * Zodiac sign associated with the house. * * Reflects the natural energy or archetype that aligns with the house. * Example: "Aries", "Taurus" */ sign: string; /** * Title or name of the house. * * A formal or descriptive label that captures the house’s core function or domain. * Example: "The Individual Personality", "Values and Possessions" */ title: string; /** * Modalities of the houses (Angular, Succedent, Cadent). * * Traditional classification describing the house’s dynamic strength and function: * - **Angular (Houses 1, 4, 7, 10):** Active, initiating, most powerful. * - **Succedent (Houses 2, 5, 8, 11):** Stabilizing, sustaining what was initiated. * - **Cadent (Houses 3, 6, 9, 12):** Transitional, preparatory, often more internal or mental. */ modality: HouseModalities; /** * The name of the astrological house. * Refers to its designated number in the zodiac cycle, such as "First House", "Second House", etc. * Examples: "First House", "Second House", "Third House", ... "Twelfth House". */ name: Houses; } export interface Planet { /** * The name of the celestial body. * Examples: "Sun", "Moon". */ name: string; /** * The glyph or symbol associated with the celestial body. * Examples: "☉" for the Sun, "☽" for the Moon, "♂" for Mars. */ glyph: string; /** * The type or category of the celestial body. * Examples: "Personal", "Luminary". */ type: PlanetType; } export type Dictionary = { [key in Signs | Elements | Modalities | Planets | Polarities | BodyParts | Characters | Seasons | Hemispheres | HouseModalities | PlanetType | Houses | HouseTitles | HouseKeywords]: string; }; export type SymbolOptions = { width?: number | string; height?: number | string; stroke?: string; strokeWidth?: number | string; }; /** * Get all astrological houses with their translations for a specified language. * * @param {Language} [language='en'] - The language code for which translations are needed. Defaults to 'en'. * @returns {House[]} An array of House objects with translated values based on the specified language. * * @example * import { getHouses } from 'western-houses'; * * // Retrieve information about all houses in English * const data = getHouses(); * console.log(data); * // Output: * // [ * // { * // number: 1, * // title: 'The individual personality', * // sign: 'Aries', * // rulingPlanet: 'Mars', * // keywords: [ * // 'Self-image', * // 'Identity', * // 'Impressions on others', * // 'Personality' * // ] * // }, * // ... * // ] */ export declare function getHouses(language?: Language): House[]; /** * Get a single planet with its translated properties for a specified language. * * @param {Planets} planetKey - The key corresponding to the desired planet. * @param {Language} [language='en'] - The language code to use for translations. Defaults to 'en'. * @returns {Planet | null} An object with translated values based on the specified language, or null if the planet key is invalid. * * @example * import { getPlanet, PLANETS } from 'western-signs'; * * // Retrieve information about Mars in English * const mars = getPlanet(PLANETS.MARS); * console.log(mars); * // Output: * // { * // name: 'Mars', * // glyph: '♂', * // type: 'Personal' * // } */ export declare function getPlanet(planetKey: Planets, language?: Language): Planet | null; /** * Get all planets with their translated properties for a specified language. * * @param {Language} [language='en'] - The language code for which translations are needed. Defaults to `'en'`. * @returns {Planet[]} An array of Planet objects with translated values based on the specified language. * * @example * import { getPlanets } from 'western-signs'; * * // Retrieve information about all planets in English * const data = getPlanets(); * console.log(data); * // Output: * // [ * // { * // name: 'Mercury', * // glyph: '☿', * // type: 'Personal' * // }, * // { * // name: 'Venus', * // glyph: '♀', * // type: 'Personal' * // }, * // ... * // ] */ export declare function getPlanets(language?: Language): Planet[]; /** * Retrieve the astrological sign corresponding to a given date, with optional translations for the specified language. * * @param {Date} date - The date for which the corresponding astrological sign is to be retrieved. * @param {Language} [language='en'] - The language code for which translations are needed. Defaults to 'en'. * @throws {Error} Will throw an error if the provided date is invalid. * @returns {Sign | null} An object representing the astrological sign with translated values or null if the sign is not found. * * @example * import { getSignByDate } from 'western-signs'; * * // Retrieve the sign for May 15 in English * const signData = getSignByDate(new Date(1813, 4, 5)); * console.log(signData); * // Output: * // { * // name: 'Taurus', * // element: 'Earth', * // modality: 'Fixed', * // rulingPlanet: 'Venus', * // symbol: '♉', * // [...] * // } */ export declare function getSignByDate(date: Date, language?: Language): Sign | null; /** * Get the astrological sign by its name with translations for the specified language. * * @param {Signs} signKey - The name of the astrological sign to retrieve. * @param {Language} [language='en'] - The language code for which translations are needed. Defaults to 'en'. * @returns {Sign | null} An object representing the sign with translated values or null if the sign or dictionary is not found. * * @example * import { getSignByName, SIGNS } from 'western-signs'; * * // Retrieve information about Taurus in English * const taurusData = getSignByName(SIGNS.TAURUS); * console.log(taurusData); * // Output: * // { * // name: 'Taurus', * // element: 'Earth', * // modality: 'Fixed', * // rulingPlanet: 'Venus', * // symbol: '♉' * // [...] * // } */ export declare function getSignByName(signKey: Signs, language?: Language): Sign | null; /** * Get all astrological signs with their translations for a specified language. * * @param {Language} [language='en'] - The language code for which translations are needed. Defaults to 'en'. * @returns {Sign[]} An array of Sign objects with translated values based on the specified language. * * @example * import { getSigns } from 'western-signs'; * * // Retrieve information about all signs in English * const data = getSigns(); * console.log(data); * // Output: * // [ * // { * // name: 'Aries', * // element: 'Air', * // modality: 'Cardinal', * // rulingPlanet: 'Mars', * // symbol: '♈' * // }, * // { * // name: 'Taurus', * // element: 'Earth', * // modality: 'Fixed', * // rulingPlanet: 'Venus', * // symbol: '♉' * // }, * // ... * // ] */ export declare function getSigns(language?: Language): Sign[]; /** * Gets an SVG as a string or as a Data URL, with option to modify attributes. * * @param {Symbols} symbolName Name of the icon without extension .svg * @param {SymbolOptions} options Options to modify attributes or return as a Data URL * @returns SVG as string or Data URL * * @example * import { getSymbol } from 'western-signs' * * // Get the symbol with initial options * const initialSymbol = getSymbol('taurus', { stroke: 'blue', strokeWidth: 2 }) * // Modify attributes using method chaining * const modifiedSymbol = initialSymbol.setStroke('green').setStrokeWidth(3) * * // Log the modified SVG as a string * console.log(symbol.toString()) * * // Log the modified SVG as a Data URL * console.log(symbol.toDataURL()) * * @throws Will throw an error if the specified SVG file is not found */ export declare function getSymbol(symbolName: Symbols, options?: SymbolOptions): { setStroke: (stroke: string) => any; setStrokeWidth: (strokeWidth: number | string) => any; setWidth: (width: number | string) => any; setHeight: (height: number | string) => any; toString: () => string; toDataURL: () => string; }; declare function setLanguage(language: Language): void; declare function getLanguage(): Language; declare function t(strings: TemplateStringsArray, ...values: string[]): string; declare namespace i18n { export { getLanguage, setLanguage, t }; } export { i18n, }; export {};