kaabalah 0.1.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.
package/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Kaabalah - Esoteric Calculations and Tools Library
2
+ Copyright (C) 2024 Mateus Moura
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as published by
6
+ the Free Software Foundation, either version 3 of the License, or
7
+ (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program under agpl-3.0.txt. If not, see <https://www.gnu.org/licenses/>.
16
+
17
+ Additional Note:
18
+ This project includes Swiss Ephemeris, which is used under its dual licensing system.
19
+ The Swiss Ephemeris portion is used under the GNU Affero General Public License (AGPL).
20
+ For more information about Swiss Ephemeris licensing, see the LICENSE file in the wasm/swisseph directory or check their website.
package/README.md ADDED
@@ -0,0 +1,88 @@
1
+ # Kaabalah
2
+
3
+ A comprehensive TypeScript library for numerology, astrology, kaabalah, and tarot calculations and interpretations.
4
+
5
+ ## Features
6
+
7
+ - **Numerology**: Calculate life path numbers and other numerological values
8
+ - **Astrology**: Generate birth charts and planetary positions using Swiss Ephemeris
9
+ - **Kaabalah**: Hebrew gematria calculations and mystical interpretations
10
+ - **Tarot**: Card meanings, spreads, and interpretations
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install kaabalah
16
+ ```
17
+
18
+ ## Usage Examples
19
+
20
+ ### Full Library
21
+
22
+ ```typescript
23
+ import * as Kaabalah from 'kaabalah';
24
+
25
+ // Calculate life path number
26
+ const lifePath = Kaabalah.calculateLifePath(new Date('1990-01-15'));
27
+ console.log(`Life Path Number: ${lifePath}`);
28
+
29
+ // Get a random tarot spread
30
+ const spread = Kaabalah.getRandomSpread(3);
31
+ console.log('Tarot Spread:', spread);
32
+ ```
33
+
34
+ ### Direct Module Imports (Tree-Shakable)
35
+
36
+ ```typescript
37
+ // Only import what you need
38
+ import { calculateLifePath } from 'kaabalah/numerology';
39
+ import { getBirthChart } from 'kaabalah/astrology';
40
+ import { calculateGematria } from 'kaabalah/kaabalah';
41
+ import { getRandomSpread } from 'kaabalah/tarot';
42
+
43
+ // Calculate life path number
44
+ const lifePath = calculateLifePath(new Date('1990-01-15'));
45
+
46
+ // Generate a birth chart (with Swiss Ephemeris)
47
+ const birthChart = getBirthChart({
48
+ date: new Date('1990-01-15T12:30:00Z'),
49
+ latitude: 40.7128,
50
+ longitude: -74.0060,
51
+ timezone: -5
52
+ });
53
+
54
+ // Calculate Hebrew gematria
55
+ const gematriaValue = calculateGematria('שלום');
56
+
57
+ // Get a tarot spread
58
+ const spread = getRandomSpread(3, true);
59
+ ```
60
+
61
+ ## Development
62
+
63
+ This project uses TypeScript and WebAssembly for the Swiss Ephemeris calculations.
64
+
65
+ ### Building the Project
66
+
67
+ ```bash
68
+ npm run build
69
+ ```
70
+
71
+ ### Development Mode
72
+
73
+ ```bash
74
+ npm run dev
75
+ ```
76
+
77
+ ## Swiss Ephemeris Integration
78
+
79
+ The astrological calculations use the Swiss Ephemeris library, compiled to WebAssembly for use in both Node.js and browser environments.
80
+
81
+ ## License
82
+
83
+ This project is licensed under the AGPL-3.0 license. See the LICENSE file for details.
84
+
85
+ ## Acknowledgments
86
+
87
+ - [Swiss Ephemeris](https://www.astro.com/swisseph/) for providing the astronomical calculation library
88
+ - [Astro.com](https://www.astro.com/) for the Swiss Ephemeris data
@@ -0,0 +1,104 @@
1
+ /**
2
+ * TypeScript wrapper for Swiss Ephemeris WebAssembly module
3
+ */
4
+ declare enum Planet {
5
+ SUN = 0,
6
+ MOON = 1,
7
+ MERCURY = 2,
8
+ VENUS = 3,
9
+ MARS = 4,
10
+ JUPITER = 5,
11
+ SATURN = 6,
12
+ URANUS = 7,
13
+ NEPTUNE = 8,
14
+ PLUTO = 9,
15
+ MEAN_NODE = 10,
16
+ TRUE_NODE = 11,
17
+ CHIRON = 15
18
+ }
19
+ declare enum HouseSystem {
20
+ PLACIDUS = "P",
21
+ KOCH = "K",
22
+ PORPHYRIUS = "O",
23
+ REGIOMONTANUS = "R",
24
+ CAMPANUS = "C",
25
+ EQUAL = "E",
26
+ WHOLE_SIGN = "W",
27
+ MERIDIAN = "X",
28
+ MORINUS = "M",
29
+ KRUSINSKI = "U",
30
+ ALCABITIUS = "B"
31
+ }
32
+ declare enum CalcFlag {
33
+ SWISS_EPH = 2,
34
+ MOSHIER = 4,
35
+ HELIOCENTRIC = 8,
36
+ TRUE_POS = 16,
37
+ SPEED = 32
38
+ }
39
+
40
+ /**
41
+ * Integration with the Swiss Ephemeris WebAssembly module
42
+ */
43
+
44
+ /**
45
+ * Get the Swiss Ephemeris instance, initializing it if needed
46
+ */
47
+ declare function getSwissEph(ephePath?: string): Promise<void>;
48
+ /**
49
+ * Clean up Swiss Ephemeris resources
50
+ */
51
+ declare function closeSwissEph(): void;
52
+
53
+ /**
54
+ * Astrological calculations using Swiss Ephemeris
55
+ */
56
+
57
+ interface BirthChartOptions {
58
+ date: Date;
59
+ latitude: number;
60
+ longitude: number;
61
+ timezone: number;
62
+ houseSystem?: HouseSystem;
63
+ }
64
+ interface BirthChart {
65
+ dateUtc: Date;
66
+ planets: Record<string, {
67
+ longitude: number;
68
+ latitude: number;
69
+ distance: number;
70
+ }>;
71
+ houses: {
72
+ houses: number[];
73
+ ascendant: number;
74
+ mc: number;
75
+ };
76
+ }
77
+ /**
78
+ * Calculate a birth chart using Swiss Ephemeris
79
+ *
80
+ * @param options Chart calculation options
81
+ * @returns Birth chart data
82
+ */
83
+ declare function getBirthChart(options: BirthChartOptions): Promise<BirthChart>;
84
+ /**
85
+ * Convert decimal degrees to degrees and minutes format
86
+ *
87
+ * @param decimalDegrees Decimal degrees (e.g., 9.8)
88
+ * @returns Formatted string (e.g., "9°48'")
89
+ */
90
+ declare function formatDegreeMinutes(decimalDegrees: number): string;
91
+ /**
92
+ * Convert decimal degrees to zodiac position (sign and degrees)
93
+ *
94
+ * @param longitude Longitude in decimal degrees (0-360)
95
+ * @returns Formatted zodiac position with both decimal and traditional format
96
+ */
97
+ declare function getZodiacPosition(longitude: number): {
98
+ sign: string;
99
+ decimalDegrees: number;
100
+ traditionalFormat: string;
101
+ decimal: string;
102
+ };
103
+
104
+ export { type BirthChart, type BirthChartOptions, CalcFlag, HouseSystem, Planet, closeSwissEph, formatDegreeMinutes, getBirthChart, getSwissEph, getZodiacPosition };
@@ -0,0 +1,104 @@
1
+ /**
2
+ * TypeScript wrapper for Swiss Ephemeris WebAssembly module
3
+ */
4
+ declare enum Planet {
5
+ SUN = 0,
6
+ MOON = 1,
7
+ MERCURY = 2,
8
+ VENUS = 3,
9
+ MARS = 4,
10
+ JUPITER = 5,
11
+ SATURN = 6,
12
+ URANUS = 7,
13
+ NEPTUNE = 8,
14
+ PLUTO = 9,
15
+ MEAN_NODE = 10,
16
+ TRUE_NODE = 11,
17
+ CHIRON = 15
18
+ }
19
+ declare enum HouseSystem {
20
+ PLACIDUS = "P",
21
+ KOCH = "K",
22
+ PORPHYRIUS = "O",
23
+ REGIOMONTANUS = "R",
24
+ CAMPANUS = "C",
25
+ EQUAL = "E",
26
+ WHOLE_SIGN = "W",
27
+ MERIDIAN = "X",
28
+ MORINUS = "M",
29
+ KRUSINSKI = "U",
30
+ ALCABITIUS = "B"
31
+ }
32
+ declare enum CalcFlag {
33
+ SWISS_EPH = 2,
34
+ MOSHIER = 4,
35
+ HELIOCENTRIC = 8,
36
+ TRUE_POS = 16,
37
+ SPEED = 32
38
+ }
39
+
40
+ /**
41
+ * Integration with the Swiss Ephemeris WebAssembly module
42
+ */
43
+
44
+ /**
45
+ * Get the Swiss Ephemeris instance, initializing it if needed
46
+ */
47
+ declare function getSwissEph(ephePath?: string): Promise<void>;
48
+ /**
49
+ * Clean up Swiss Ephemeris resources
50
+ */
51
+ declare function closeSwissEph(): void;
52
+
53
+ /**
54
+ * Astrological calculations using Swiss Ephemeris
55
+ */
56
+
57
+ interface BirthChartOptions {
58
+ date: Date;
59
+ latitude: number;
60
+ longitude: number;
61
+ timezone: number;
62
+ houseSystem?: HouseSystem;
63
+ }
64
+ interface BirthChart {
65
+ dateUtc: Date;
66
+ planets: Record<string, {
67
+ longitude: number;
68
+ latitude: number;
69
+ distance: number;
70
+ }>;
71
+ houses: {
72
+ houses: number[];
73
+ ascendant: number;
74
+ mc: number;
75
+ };
76
+ }
77
+ /**
78
+ * Calculate a birth chart using Swiss Ephemeris
79
+ *
80
+ * @param options Chart calculation options
81
+ * @returns Birth chart data
82
+ */
83
+ declare function getBirthChart(options: BirthChartOptions): Promise<BirthChart>;
84
+ /**
85
+ * Convert decimal degrees to degrees and minutes format
86
+ *
87
+ * @param decimalDegrees Decimal degrees (e.g., 9.8)
88
+ * @returns Formatted string (e.g., "9°48'")
89
+ */
90
+ declare function formatDegreeMinutes(decimalDegrees: number): string;
91
+ /**
92
+ * Convert decimal degrees to zodiac position (sign and degrees)
93
+ *
94
+ * @param longitude Longitude in decimal degrees (0-360)
95
+ * @returns Formatted zodiac position with both decimal and traditional format
96
+ */
97
+ declare function getZodiacPosition(longitude: number): {
98
+ sign: string;
99
+ decimalDegrees: number;
100
+ traditionalFormat: string;
101
+ decimal: string;
102
+ };
103
+
104
+ export { type BirthChart, type BirthChartOptions, CalcFlag, HouseSystem, Planet, closeSwissEph, formatDegreeMinutes, getBirthChart, getSwissEph, getZodiacPosition };