kaabalah
Version:
The de-facto library for any esoteric calculations and tooling
232 lines (228 loc) • 11.9 kB
TypeScript
import { a6 as NodeId, _ as KaabalahTypes, aa as Node, a0 as WesternAstrologyTypes, $ as LetterTypes, a5 as NodeType, a1 as TarotTypes } from '../correspondence-model-DWXbAjC-.js';
import { TarotCard } from '../tarot/index.js';
import { SIGNS, HydratedPlanet, BirthChart, HydratedNode } from '../astrology/index.js';
import { calculateGematria } from '../gematria/index.js';
import { calculateKaabalisticLifePath, calculateStraightAcrossReductionLifePath } from '../numerology/index.js';
type KaabalisticTargetId = NodeId<KaabalahTypes.SPHERE> | NodeId<KaabalahTypes.PATH>;
type KaabalisticTargetType = "sphere" | "path";
type KaabalisticMarkerKind = "astrology" | "numerology" | "gematria";
type KaabalisticMarkerSourceType = "planet" | "angle" | "node" | "number" | "letter";
type KaabalisticMarkerMapping = "sign-sphere" | "sign-path" | "element-sphere" | "element-path" | "carrier-sphere" | "planet-sign-path" | "number-sphere" | "number-path" | "letter-path";
interface KaabalisticMarkerDescriptor {
kind: KaabalisticMarkerKind;
targetId: KaabalisticTargetId;
targetType: KaabalisticTargetType;
sourceType: KaabalisticMarkerSourceType;
sourceName: string;
mapping: KaabalisticMarkerMapping;
label: string;
sign?: string;
element?: string;
planet?: string;
}
interface KaabalisticCountsEntry {
astro: number;
numerology: number;
gematria: number;
total: number;
}
interface KaabalisticSummaryTarget {
id: KaabalisticTargetId;
type: KaabalisticTargetType;
name: string;
count: number;
}
interface KaabalisticItemConnection {
itemLabel: string;
targets: readonly KaabalisticSummaryTarget[];
}
interface KaabalisticMapData {
spheres: readonly Node<KaabalahTypes.SPHERE>[];
paths: readonly Node<KaabalahTypes.PATH>[];
markers: readonly KaabalisticMarkerDescriptor[];
sphereMarkers: Partial<Record<NodeId<KaabalahTypes.SPHERE>, readonly KaabalisticMarkerDescriptor[]>>;
pathMarkers: Partial<Record<NodeId<KaabalahTypes.PATH>, readonly KaabalisticMarkerDescriptor[]>>;
countsById: Partial<Record<KaabalisticTargetId, KaabalisticCountsEntry>>;
itemConnections: {
astrology: readonly KaabalisticItemConnection[];
numerology: readonly KaabalisticItemConnection[];
gematria: readonly KaabalisticItemConnection[];
};
}
interface KaabalisticSymbolMetadata {
kind: "planet" | "sign" | "angle" | "node";
key: string;
label: string;
shortLabel: string;
glyph: string;
id?: NodeId<WesternAstrologyTypes.PLANET> | NodeId<WesternAstrologyTypes.WESTERN_ZODIAC_SIGN> | NodeId<WesternAstrologyTypes.HOUSE>;
}
type KaabalisticSignLookup = (typeof SIGNS)[number] | NodeId<WesternAstrologyTypes.WESTERN_ZODIAC_SIGN> | string;
interface KaabalisticSignCorrespondenceLookup {
kind: "sign";
sign: KaabalisticSignLookup;
}
interface KaabalisticPlanetCorrespondenceLookup {
kind: "planet";
planet: string;
sign: KaabalisticSignLookup;
}
interface KaabalisticAngleCorrespondenceLookup {
kind: "angle";
angle: string;
sign: KaabalisticSignLookup;
}
interface KaabalisticNodeCorrespondenceLookup {
kind: "node";
node: string;
sign: KaabalisticSignLookup;
}
interface KaabalisticNumberCorrespondenceLookup {
kind: "number";
number: number;
sourceName?: string;
}
interface KaabalisticHebrewLetterCorrespondenceLookup {
kind: "hebrewLetter";
hebrewLetterId: NodeId<LetterTypes.HEBREW_LETTER>;
sourceName?: string;
}
type KaabalisticCorrespondenceLookup = KaabalisticSignCorrespondenceLookup | KaabalisticPlanetCorrespondenceLookup | KaabalisticAngleCorrespondenceLookup | KaabalisticNodeCorrespondenceLookup | KaabalisticNumberCorrespondenceLookup | KaabalisticHebrewLetterCorrespondenceLookup;
interface KaabalisticCorrespondenceTarget {
targetId: KaabalisticTargetId;
targetType: KaabalisticTargetType;
targetName: string;
mapping: KaabalisticMarkerMapping;
distance: number;
sign?: string;
element?: string;
planet?: string;
}
interface KaabalisticCorrespondenceSource {
kind: KaabalisticCorrespondenceLookup["kind"];
key: string;
label: string;
shortLabel: string;
glyph: string;
sign?: string;
element?: string;
planet?: string;
number?: number;
hebrewLetterId?: NodeId<LetterTypes.HEBREW_LETTER>;
}
interface KaabalisticCorrespondenceResult {
source: KaabalisticCorrespondenceSource;
targets: readonly KaabalisticCorrespondenceTarget[];
}
interface AstrologyTreeChartInput {
planets: readonly HydratedPlanet[] | Record<string, HydratedPlanet>;
houses: BirthChart["houses"];
nodes?: readonly HydratedNode[] | Record<string, HydratedNode>;
aspects?: BirthChart["aspects"];
}
interface NumerologyTreeInput {
birthDate: Date;
kaabalisticLifePath?: ReturnType<typeof calculateKaabalisticLifePath>;
straightAcrossReductionLifePath?: ReturnType<typeof calculateStraightAcrossReductionLifePath>;
}
interface GematriaTreeInput {
phrase?: string;
result?: ReturnType<typeof calculateGematria>;
}
interface BuildKaabalisticMapDataInput {
astrology?: BirthChart | AstrologyTreeChartInput | null;
numerology?: Date | NumerologyTreeInput | null;
gematria?: string | GematriaTreeInput | null;
}
declare function listPlanetSymbolMetadata(): readonly KaabalisticSymbolMetadata[];
declare function listZodiacSignSymbolMetadata(): readonly KaabalisticSymbolMetadata[];
declare function listAngleSymbolMetadata(): readonly KaabalisticSymbolMetadata[];
declare function listNodeSymbolMetadata(): readonly KaabalisticSymbolMetadata[];
declare function getPlanetSymbolMetadata(lookup: string): KaabalisticSymbolMetadata | undefined;
declare function getZodiacSignSymbolMetadata(lookup: KaabalisticSignLookup): KaabalisticSymbolMetadata | undefined;
declare function getAngleSymbolMetadata(lookup: string): KaabalisticSymbolMetadata | undefined;
declare function getNodeSymbolMetadata(lookup: string): KaabalisticSymbolMetadata | undefined;
declare function getKaabalisticCorrespondenceTargets(lookup: KaabalisticCorrespondenceLookup): KaabalisticCorrespondenceResult | undefined;
declare function getAstrologyTreeMarkers(input: BirthChart | AstrologyTreeChartInput): KaabalisticMarkerDescriptor[];
declare function getNumerologyTreeMarkers(input: Date | NumerologyTreeInput): KaabalisticMarkerDescriptor[];
declare function getGematriaTreeMarkers(input: string | GematriaTreeInput): KaabalisticMarkerDescriptor[];
declare function buildKaabalisticMapData(input: BuildKaabalisticMapDataInput): KaabalisticMapData;
declare const OCCULT_THEME_STOPWORDS: readonly ["the", "and", "for", "with", "that", "this", "was", "were", "been", "have", "has", "had", "just", "from", "into", "about", "over", "under", "very", "more", "less", "then", "than", "when", "what", "where", "which", "while", "would", "could", "should", "again", "still", "really", "gotta", "lota", "lotta", "para", "com", "sem", "por", "uma", "um", "uns", "das", "dos", "del", "que", "não", "nao", "isso", "essa", "este", "esta", "como", "mais", "menos", "muito", "muita", "their", "your", "mine", "ours", "onto", "sobre", "entre", "depois", "antes"];
interface TokenizeOccultThemeTextOptions {
minTokenLength?: number;
stopwords?: readonly string[];
}
interface OccultThemeCorrespondence<T extends NodeType> {
id: NodeId<T>;
label: string;
distance: number;
}
interface OccultThemeCorrespondences {
planets: readonly OccultThemeCorrespondence<WesternAstrologyTypes.PLANET>[];
signs: readonly OccultThemeCorrespondence<WesternAstrologyTypes.WESTERN_ZODIAC_SIGN>[];
elements: readonly OccultThemeCorrespondence<WesternAstrologyTypes.WESTERN_ELEMENT>[];
spheres: readonly OccultThemeCorrespondence<KaabalahTypes.SPHERE>[];
paths: readonly OccultThemeCorrespondence<KaabalahTypes.PATH>[];
}
type HouseThemeScope = "personal" | "transition" | "transpersonal";
interface HouseThemeAxis {
key: "self-other" | "resources-initiation" | "communication-journey" | "private-public" | "pleasure-friendship" | "health-occult";
label: string;
oppositeHouseNumber: HouseNumber;
}
type HouseNumber = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
type HouseThemeLookup = HouseNumber | NodeId<WesternAstrologyTypes.HOUSE>;
interface HouseThemeProfile {
kind: "house";
id: NodeId<WesternAstrologyTypes.HOUSE>;
houseNumber: HouseNumber;
houseLabel: string;
primaryLabel: string;
scope: HouseThemeScope;
axis: HouseThemeAxis;
aliases: readonly string[];
keywords: readonly string[];
tokens: readonly string[];
correspondences: OccultThemeCorrespondences;
}
interface TarotMajorArchetypeReference {
pathId: NodeId<KaabalahTypes.PATH>;
pathNumber: number;
pathSlug: string;
hebrewLetter: string;
}
interface TarotThemeCorrespondences extends OccultThemeCorrespondences {
suits: readonly OccultThemeCorrespondence<TarotTypes.TAROT_SUIT>[];
}
type TarotThemeLookup = number | string | {
tarotCardNumber: number;
} | {
tarotCardFilename: string;
} | {
tarotCardName: string;
} | {
tarotArkAnnuId: NodeId<TarotTypes.TAROT_ARK_ANNU>;
} | {
pathId: NodeId<KaabalahTypes.PATH>;
} | {
pathSlug: string;
};
interface TarotThemeProfile {
kind: "tarot";
id: NodeId<TarotTypes.TAROT_ARK_ANNU>;
cardNumber: number;
cardType: TarotCard["type"];
tarotCardFilename: string;
primaryLabel: string;
aliases: readonly string[];
keywords: readonly string[];
tokens: readonly string[];
correspondences: TarotThemeCorrespondences;
majorArchetype?: TarotMajorArchetypeReference;
}
declare function tokenizeOccultThemeText(input: string | null | undefined | readonly (string | null | undefined)[], options?: TokenizeOccultThemeTextOptions): string[];
declare function listHouseThemeProfiles(): readonly HouseThemeProfile[];
declare function getHouseThemeProfile(lookup: HouseThemeLookup): HouseThemeProfile | undefined;
declare function listTarotThemeProfiles(): readonly TarotThemeProfile[];
declare function getTarotThemeProfile(lookup: TarotThemeLookup): TarotThemeProfile | undefined;
export { type AstrologyTreeChartInput, type BuildKaabalisticMapDataInput, type GematriaTreeInput, type HouseNumber, type HouseThemeAxis, type HouseThemeLookup, type HouseThemeProfile, type HouseThemeScope, type KaabalisticAngleCorrespondenceLookup, type KaabalisticCorrespondenceLookup, type KaabalisticCorrespondenceResult, type KaabalisticCorrespondenceSource, type KaabalisticCorrespondenceTarget, type KaabalisticCountsEntry, type KaabalisticHebrewLetterCorrespondenceLookup, type KaabalisticItemConnection, type KaabalisticMapData, type KaabalisticMarkerDescriptor, type KaabalisticMarkerKind, type KaabalisticMarkerMapping, type KaabalisticMarkerSourceType, type KaabalisticNodeCorrespondenceLookup, type KaabalisticNumberCorrespondenceLookup, type KaabalisticPlanetCorrespondenceLookup, type KaabalisticSignCorrespondenceLookup, type KaabalisticSignLookup, type KaabalisticSummaryTarget, type KaabalisticSymbolMetadata, type KaabalisticTargetId, type KaabalisticTargetType, type NumerologyTreeInput, OCCULT_THEME_STOPWORDS, type OccultThemeCorrespondence, type OccultThemeCorrespondences, type TarotMajorArchetypeReference, type TarotThemeCorrespondences, type TarotThemeLookup, type TarotThemeProfile, type TokenizeOccultThemeTextOptions, buildKaabalisticMapData, getAngleSymbolMetadata, getAstrologyTreeMarkers, getGematriaTreeMarkers, getHouseThemeProfile, getKaabalisticCorrespondenceTargets, getNodeSymbolMetadata, getNumerologyTreeMarkers, getPlanetSymbolMetadata, getTarotThemeProfile, getZodiacSignSymbolMetadata, listAngleSymbolMetadata, listHouseThemeProfiles, listNodeSymbolMetadata, listPlanetSymbolMetadata, listTarotThemeProfiles, listZodiacSignSymbolMetadata, tokenizeOccultThemeText };