UNPKG

kaabalah

Version:

The de-facto library for any esoteric calculations and tooling

269 lines (265 loc) 12.5 kB
import { R as SystemKey, a0 as WesternAstrologyTypes, a6 as NodeId, _ as KaabalahTypes, $ as LetterTypes, a1 as TarotTypes } from '../correspondence-model-DWXbAjC-.js'; /** * Tarot interpretation functions */ type Deck = "papus_pt" | "papus" | "mythic" | "egyptian" | "rider-waite"; type TarotDeckId = Deck; type TarotTreeId = SystemKey; declare const DEFAULT_TAROT_TREE_ID: TarotTreeId; declare const TAROT_TREE_IDS: readonly ["kaabalah", "hermetic-qabalah", "lurianic-kabbalah"]; type MajorArcana = "01_the_magician" | "02_the_high_priestess" | "03_the_empress" | "04_the_emperor" | "05_the_hierophant" | "06_the_lover" | "07_the_chariot" | "08_justice" | "09_the_hermit" | "10_the_wheel_of_fortune" | "11_strength" | "12_the_hanged_man" | "13_death" | "14_temperance" | "15_the_devil" | "16_the_house_of_god" | "17_the_star" | "18_the_moon" | "19_the_sun" | "20_judgement" | "21_the_fool" | "22_the_world"; type TarotCard = { number: number; tarotCard: string; tarotCardFilename: string; egyptianCardName?: string; meaning: string; papusMeaning?: string; type: "major" | "minor" | "daat+royalship"; deck: Deck; suit?: string; isInverted?: boolean; }; declare const majorArcana: MajorArcana[]; /** * Shuffles a deck of tarot cards and optionally includes inverted cards * @param cards - Array of tarot cards to shuffle * @param includeInvertedCards - Whether to include inverted cards in the shuffle * @param shuffleCount - Number of times to shuffle the deck (default: 6) * @param shuffleDelay - Delay between shuffles in milliseconds (default: 300) * @returns Promise that resolves to the shuffled deck */ declare function shuffleTarotDeck(cards: TarotCard[], includeInvertedCards?: boolean, shuffleCount?: number, shuffleDelay?: number): Promise<TarotCard[]>; interface TarotDeckMetadata { id: TarotDeckId; label: string; } interface TarotDeckDescription { name?: string; meaning?: string; reversedMeaning?: string; keywords?: string[]; } type TarotAstrologyCorrespondenceType = WesternAstrologyTypes.PLANET | WesternAstrologyTypes.WESTERN_ZODIAC_SIGN | WesternAstrologyTypes.WESTERN_ELEMENT; interface TarotAstrologyCorrespondence { type: TarotAstrologyCorrespondenceType; id: NodeId<TarotAstrologyCorrespondenceType>; label: string; } interface TarotArchetype { canonicalId: NodeId<KaabalahTypes.PATH>; kind: "major"; pathId: NodeId<KaabalahTypes.PATH>; pathNumber: number; pathSlug: string; hebrewLetterId: NodeId<LetterTypes.HEBREW_LETTER>; hebrewLetter: string; pathMeaning?: string; tarotArkAnnuId: NodeId<TarotTypes.TAROT_ARK_ANNU>; tarotCardNumber: number; tarotCardName: string; tarotCardFilename: MajorArcana; tarotMeaning?: string; astrology: TarotAstrologyCorrespondence[]; availableDeckIds: TarotDeckId[]; descriptionsByDeck: Partial<Record<TarotDeckId, TarotDeckDescription>>; } type TarotArchetypeLookup = { pathSlug: string; } | { pathId: NodeId<KaabalahTypes.PATH>; } | { tarotCardFilename: MajorArcana | string; } | { tarotCardNumber: number; }; type TarotCardKind = "major" | "court" | "minor"; type TarotCourtRank = "king" | "queen" | "knight" | "page"; type TarotAssetPathType = "major" | "minor" | "daat+royalship"; interface TarotCardProfile { tarotArkAnnuId: NodeId<TarotTypes.TAROT_ARK_ANNU>; tarotCardNumber: number; tarotCardName: string; tarotCardFilename: string; tarotMeaning?: string; kind: TarotCardKind; assetPathType: TarotAssetPathType; suit?: string; courtRank?: TarotCourtRank; availableDeckIds: TarotDeckId[]; descriptionsByDeck: Partial<Record<TarotDeckId, TarotDeckDescription>>; } type TarotImageLookup = TarotArchetypeLookup | { tarotArkAnnuId: NodeId<TarotTypes.TAROT_ARK_ANNU>; } | { tarotCardName: string; }; type TarotCorrespondenceNodeType = KaabalahTypes.SPHERE | LetterTypes.HEBREW_LETTER | WesternAstrologyTypes.PLANET | WesternAstrologyTypes.WESTERN_ZODIAC_SIGN | WesternAstrologyTypes.WESTERN_ELEMENT; interface TarotCorrespondenceNode<T extends TarotCorrespondenceNodeType> { id: NodeId<T>; label: string; } interface TarotPathCorrespondence { pathId: NodeId<KaabalahTypes.PATH>; pathNumber: number; pathSlug: string; meaning?: string; hebrewLetter: TarotCorrespondenceNode<LetterTypes.HEBREW_LETTER>; fromSphere: TarotCorrespondenceNode<KaabalahTypes.SPHERE>; toSphere: TarotCorrespondenceNode<KaabalahTypes.SPHERE>; } interface TarotCorrespondenceProfileBase { tarotArkAnnuId: NodeId<TarotTypes.TAROT_ARK_ANNU>; tarotCardNumber: number; tarotCardName: string; tarotCardFilename: string; tarotMeaning?: string; suit?: string; } interface TarotMajorCorrespondenceProfile extends TarotCorrespondenceProfileBase { kind: "major"; correspondences: { astrology: TarotAstrologyCorrespondence[]; path: TarotPathCorrespondence; }; } interface TarotPageCorrespondenceProfile extends TarotCorrespondenceProfileBase { kind: "court"; courtRank: "page"; correspondences: { element: TarotCorrespondenceNode<WesternAstrologyTypes.WESTERN_ELEMENT>; }; } interface TarotCourtAstrologyCorrespondenceProfile extends TarotCorrespondenceProfileBase { kind: "court"; courtRank: Exclude<TarotCourtRank, "page">; correspondences: { sign: TarotCorrespondenceNode<WesternAstrologyTypes.WESTERN_ZODIAC_SIGN>; planets: TarotCorrespondenceNode<WesternAstrologyTypes.PLANET>[]; }; } interface TarotMinorCorrespondenceProfile extends TarotCorrespondenceProfileBase { kind: "minor"; correspondences: { sphere: TarotCorrespondenceNode<KaabalahTypes.SPHERE>; planets: TarotCorrespondenceNode<WesternAstrologyTypes.PLANET>[]; }; } type TarotCorrespondenceProfile = TarotMajorCorrespondenceProfile | TarotPageCorrespondenceProfile | TarotCourtAstrologyCorrespondenceProfile | TarotMinorCorrespondenceProfile; interface TarotRepresentation { card: TarotCardProfile; archetype?: TarotArchetype; deck: TarotDeckMetadata; assetPath: string; imageUrl: string; label: string; altText: string; cardLabel: string; description?: TarotDeckDescription; } declare const TAROT_IMAGE_BASE_URL = "https://kaabalah-app.s3.us-east-1.amazonaws.com/tarot"; declare const ARKANNUS: TarotCard[]; declare function getTarotCardProfile(lookup: TarotImageLookup): TarotCardProfile | undefined; declare function listTarotDecks(): TarotDeckMetadata[]; declare function listTarotTrees(): TarotTreeId[]; declare function getTarotCardNumber(lookup: TarotImageLookup, treeId?: TarotTreeId): number | undefined; declare function getTarotCardByNumber(cardNumber: number, treeId?: TarotTreeId): TarotCardProfile | undefined; declare function getTarotArchetype(lookup: TarotArchetypeLookup): TarotArchetype | undefined; declare function getTarotCorrespondenceProfile(lookup: TarotImageLookup, treeId?: TarotTreeId): TarotCorrespondenceProfile | undefined; declare function getTarotRepresentations(lookup: TarotImageLookup): TarotRepresentation[]; declare function getTarotRepresentation(lookup: TarotImageLookup, deckId: TarotDeckId): TarotRepresentation | undefined; declare function resolveTarotImageUrl(lookup: TarotImageLookup, deckId: TarotDeckId): string | undefined; type TarotSpreadId = "quick-insight" | "conscious-reading" | "time-reading" | "dialectic-reading" | "tree-of-life-reading" | "celtic-cross" | "event-reading"; type TarotSpreadContextKey = "inquirerGender"; type TarotInquirerGender = "man" | "woman"; type TarotSpreadCardType = TarotCard["type"]; type TarotSpreadMinorRank = "ace" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10"; interface TarotSpreadCardConstraint { allowedTypes?: TarotSpreadCardType[]; requiredRank?: TarotSpreadMinorRank; allowedCardFilenames?: string[]; excludedCardFilenames?: string[]; } interface TarotSpreadSlotMetadata { displayLabel?: string; groupKey?: string; note?: string; orientation?: "upright" | "sideways"; temporalPhase?: "past" | "present" | "future"; } interface TarotSpreadSlotDefinition { slotKey: string; label: string; order: number; minCards: number; maxCards: number; validationRules?: TarotSpreadCardConstraint; manualSelectionRules?: TarotSpreadCardConstraint; drawRules?: TarotSpreadCardConstraint; metadata?: TarotSpreadSlotMetadata; } interface TarotSpreadInquirerRule { slotKey: string; sourceSlotKeys: string[]; cardNumbersByGender: Record<TarotInquirerGender, number>; } interface TarotSpreadDefinition { spreadId: TarotSpreadId; label: string; description?: string; contextRequirements?: TarotSpreadContextKey[]; slots: TarotSpreadSlotDefinition[]; specialRules?: { inquirerCard?: TarotSpreadInquirerRule; }; } interface TarotSpreadSelectionContext { inquirerGender?: TarotInquirerGender; } interface TarotSpreadSelectionCard { slotKey: string; cardNumber: number; isInverted?: boolean; } interface TarotSpreadResolvedSelectionCard extends TarotSpreadSelectionCard { card: TarotCard; slot: TarotSpreadSlotDefinition; } type TarotSpreadValidationErrorCode = "UNKNOWN_SPREAD" | "UNKNOWN_SLOT" | "CARD_NOT_FOUND" | "DUPLICATE_CARD" | "MISSING_REQUIRED_CARDS" | "TOO_MANY_CARDS" | "INVALID_CARD_TYPE" | "INVALID_CARD_RANK" | "DISALLOWED_CARD" | "MISSING_CONTEXT" | "INVALID_INQUIRER_CARD"; interface TarotSpreadValidationIssue { code: TarotSpreadValidationErrorCode; message: string; slotKey?: string; cardNumber?: number; } interface TarotSpreadValidationResult { ok: boolean; isComplete: boolean; spread?: TarotSpreadDefinition; resolvedCards: TarotSpreadResolvedSelectionCard[]; errors: TarotSpreadValidationIssue[]; } interface TarotSpreadValidationInput { spreadId: TarotSpreadId; cards: TarotSpreadSelectionCard[]; context?: TarotSpreadSelectionContext; allowPartial?: boolean; } interface DrawTarotSpreadOptions { spreadId: TarotSpreadId; deckId?: TarotDeckId; includeInverted?: boolean; rng?: () => number; context?: TarotSpreadSelectionContext; } interface TarotSpreadDrawResult { spread: TarotSpreadDefinition; deckId: TarotDeckId; context?: TarotSpreadSelectionContext; cards: TarotSpreadResolvedSelectionCard[]; } declare function listTarotSpreads(): TarotSpreadDefinition[]; declare function getTarotSpread(spreadId: TarotSpreadId): TarotSpreadDefinition | undefined; declare function validateTarotSpreadSelection(input: TarotSpreadValidationInput): TarotSpreadValidationResult; declare function drawTarotSpread(options: DrawTarotSpreadOptions): TarotSpreadDrawResult; export { ARKANNUS, DEFAULT_TAROT_TREE_ID, type Deck, type DrawTarotSpreadOptions, type MajorArcana, TAROT_IMAGE_BASE_URL, TAROT_TREE_IDS, type TarotArchetype, type TarotArchetypeLookup, type TarotAssetPathType, type TarotAstrologyCorrespondence, type TarotAstrologyCorrespondenceType, type TarotCard, type TarotCardKind, type TarotCardProfile, type TarotCorrespondenceNode, type TarotCorrespondenceNodeType, type TarotCorrespondenceProfile, type TarotCorrespondenceProfileBase, type TarotCourtAstrologyCorrespondenceProfile, type TarotCourtRank, type TarotDeckDescription, type TarotDeckId, type TarotDeckMetadata, type TarotImageLookup, type TarotInquirerGender, type TarotMajorCorrespondenceProfile, type TarotMinorCorrespondenceProfile, type TarotPageCorrespondenceProfile, type TarotPathCorrespondence, type TarotRepresentation, type TarotSpreadCardConstraint, type TarotSpreadCardType, type TarotSpreadContextKey, type TarotSpreadDefinition, type TarotSpreadDrawResult, type TarotSpreadId, type TarotSpreadInquirerRule, type TarotSpreadMinorRank, type TarotSpreadResolvedSelectionCard, type TarotSpreadSelectionCard, type TarotSpreadSelectionContext, type TarotSpreadSlotDefinition, type TarotSpreadSlotMetadata, type TarotSpreadValidationErrorCode, type TarotSpreadValidationInput, type TarotSpreadValidationIssue, type TarotSpreadValidationResult, type TarotTreeId, drawTarotSpread, getTarotArchetype, getTarotCardByNumber, getTarotCardNumber, getTarotCardProfile, getTarotCorrespondenceProfile, getTarotRepresentation, getTarotRepresentations, getTarotSpread, listTarotDecks, listTarotSpreads, listTarotTrees, majorArcana, resolveTarotImageUrl, shuffleTarotDeck, validateTarotSpreadSelection };