kaabalah 1.1.5 → 2.0.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/dist/core/index.d.mts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +3736 -1636
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +3725 -1619
- package/dist/core/index.mjs.map +1 -1
- package/dist/gematria/index.d.mts +18 -16
- package/dist/gematria/index.d.ts +18 -16
- package/dist/gematria/index.js +3843 -1709
- package/dist/gematria/index.js.map +1 -1
- package/dist/gematria/index.mjs +3843 -1709
- package/dist/gematria/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3919 -1758
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3909 -1742
- package/dist/index.mjs.map +1 -1
- package/dist/registry-BQH4yZIX.d.mts +338 -0
- package/dist/registry-BQH4yZIX.d.ts +338 -0
- package/package.json +1 -1
- package/dist/registry-BEf1897h.d.mts +0 -485
- package/dist/registry-BEf1897h.d.ts +0 -485
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
interface HermeticQabalahSphereData {
|
|
2
|
+
/**
|
|
3
|
+
* In Atziluth
|
|
4
|
+
*/
|
|
5
|
+
divineName: string;
|
|
6
|
+
/**
|
|
7
|
+
* In Briah
|
|
8
|
+
*/
|
|
9
|
+
archangelicName: string;
|
|
10
|
+
/**
|
|
11
|
+
* In Yetzirah
|
|
12
|
+
*/
|
|
13
|
+
angelicName: string;
|
|
14
|
+
/**
|
|
15
|
+
* In Assiah
|
|
16
|
+
*/
|
|
17
|
+
mundaneName: string;
|
|
18
|
+
}
|
|
19
|
+
type SphereData = {
|
|
20
|
+
hebrewSpelling: string;
|
|
21
|
+
englishName: string;
|
|
22
|
+
magicalImage?: string;
|
|
23
|
+
} & Partial<HermeticQabalahSphereData>;
|
|
24
|
+
type PathData = {
|
|
25
|
+
meaning?: string;
|
|
26
|
+
from: NodeId<KaabalahTypes.SPHERE>;
|
|
27
|
+
to: NodeId<KaabalahTypes.SPHERE>;
|
|
28
|
+
};
|
|
29
|
+
type WorldData = {
|
|
30
|
+
englishName: string;
|
|
31
|
+
};
|
|
32
|
+
type HebrewLetterData = {
|
|
33
|
+
type: "mother" | "double" | "simple";
|
|
34
|
+
gematriaValue: number;
|
|
35
|
+
gematriaValueWhenEnding?: number;
|
|
36
|
+
symbol: string;
|
|
37
|
+
hieroglyph: string;
|
|
38
|
+
yvritMeaning: string;
|
|
39
|
+
character: string;
|
|
40
|
+
characterWhenEnding?: string;
|
|
41
|
+
};
|
|
42
|
+
type LatinLetterData = {
|
|
43
|
+
isVowel: boolean;
|
|
44
|
+
};
|
|
45
|
+
type ColorData = {
|
|
46
|
+
colorDescription: string;
|
|
47
|
+
colorNames: string[];
|
|
48
|
+
colorHexCodes: string[];
|
|
49
|
+
};
|
|
50
|
+
type MusicalNoteData = {
|
|
51
|
+
note: string;
|
|
52
|
+
noteDescription: string;
|
|
53
|
+
frequencies?: [string, string, string, string, string, string, string, string, string];
|
|
54
|
+
};
|
|
55
|
+
type WesternZodiacSignData = {
|
|
56
|
+
element: Exclude<(typeof WESTERN_ELEMENTS)[keyof typeof WESTERN_ELEMENTS], "Ether">;
|
|
57
|
+
type: "cardinal" | "fixed" | "mutable";
|
|
58
|
+
rulingPlanets: Array<Exclude<(typeof PLANETS)[keyof typeof PLANETS], "Earth">>;
|
|
59
|
+
};
|
|
60
|
+
type TarotArkAnnuData = {
|
|
61
|
+
type: "major" | "minor" | "court";
|
|
62
|
+
suit?: (typeof TAROT_SUITS)[keyof typeof TAROT_SUITS];
|
|
63
|
+
descriptiveData: {
|
|
64
|
+
deck: string;
|
|
65
|
+
name?: string;
|
|
66
|
+
meaning?: string;
|
|
67
|
+
reversedMeaning?: string;
|
|
68
|
+
keywords?: string[];
|
|
69
|
+
}[];
|
|
70
|
+
};
|
|
71
|
+
declare const PLANETS: {
|
|
72
|
+
readonly EARTH: "Earth";
|
|
73
|
+
readonly MOON: "Moon";
|
|
74
|
+
readonly SUN: "Sun";
|
|
75
|
+
readonly MERCURY: "Mercury";
|
|
76
|
+
readonly VENUS: "Venus";
|
|
77
|
+
readonly MARS: "Mars";
|
|
78
|
+
readonly JUPITER: "Jupiter";
|
|
79
|
+
readonly SATURN: "Saturn";
|
|
80
|
+
readonly URANUS: "Uranus";
|
|
81
|
+
readonly NEPTUNE: "Neptune";
|
|
82
|
+
readonly PLUTO: "Pluto";
|
|
83
|
+
};
|
|
84
|
+
declare const WESTERN_ELEMENTS: {
|
|
85
|
+
readonly FIRE: "Fire";
|
|
86
|
+
readonly AIR: "Air";
|
|
87
|
+
readonly WATER: "Water";
|
|
88
|
+
readonly EARTH: "Earth";
|
|
89
|
+
readonly ETHER: "Ether";
|
|
90
|
+
};
|
|
91
|
+
declare const TAROT_SUITS: {
|
|
92
|
+
readonly WANDS: "Wands";
|
|
93
|
+
readonly CUPS: "Cups";
|
|
94
|
+
readonly SWORDS: "Swords";
|
|
95
|
+
readonly PENTACLES: "Pentacles";
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
declare enum KaabalahTypes {
|
|
99
|
+
SPHERE = "sphere",
|
|
100
|
+
PATH = "path",
|
|
101
|
+
WORLD = "world"
|
|
102
|
+
}
|
|
103
|
+
declare enum LetterTypes {
|
|
104
|
+
HEBREW_LETTER = "hebrewLetter",
|
|
105
|
+
LATIN_LETTER = "latinLetter",
|
|
106
|
+
SANSKRIT_LETTER = "sanskritLetter",
|
|
107
|
+
ARCHEOMETER_LETTER = "archeometerLetter"
|
|
108
|
+
}
|
|
109
|
+
declare enum WesternAstrologyTypes {
|
|
110
|
+
PLANET = "planet",
|
|
111
|
+
WESTERN_ZODIAC_SIGN = "westernZodiacSign",
|
|
112
|
+
WESTERN_ELEMENT = "westernElement"
|
|
113
|
+
}
|
|
114
|
+
declare enum TarotTypes {
|
|
115
|
+
TAROT_ARK_ANNU = "tarotArkAnnu",
|
|
116
|
+
TAROT_SUIT = "tarotSuit"
|
|
117
|
+
}
|
|
118
|
+
declare enum TantraTypes {
|
|
119
|
+
CHAKRA = "chakra",
|
|
120
|
+
SUBTLE_BODY = "subtleBody"
|
|
121
|
+
}
|
|
122
|
+
declare enum NumerologyTypes {
|
|
123
|
+
NUMBER = "number"
|
|
124
|
+
}
|
|
125
|
+
declare enum MiscTypes {
|
|
126
|
+
COLOR = "color",
|
|
127
|
+
MUSICAL_NOTE = "musicalNote",
|
|
128
|
+
UNCATEGORIZED = "uncategorized"
|
|
129
|
+
}
|
|
130
|
+
type NodeType = typeof KaabalahTypes[keyof typeof KaabalahTypes] | typeof LetterTypes[keyof typeof LetterTypes] | typeof NumerologyTypes[keyof typeof NumerologyTypes] | typeof MiscTypes[keyof typeof MiscTypes] | typeof TarotTypes[keyof typeof TarotTypes] | typeof TantraTypes[keyof typeof TantraTypes] | typeof WesternAstrologyTypes[keyof typeof WesternAstrologyTypes];
|
|
131
|
+
type Branded<T, B> = T & {
|
|
132
|
+
readonly __brand: B;
|
|
133
|
+
};
|
|
134
|
+
type NodeId<T extends NodeType> = Branded<`${T}:${string}`, T>;
|
|
135
|
+
declare const id: <T extends NodeType>(type: T, value: string | number) => NodeId<T>;
|
|
136
|
+
declare const parseId: <T extends NodeType>(nodeId: NodeId<T>) => string;
|
|
137
|
+
interface DataMap {
|
|
138
|
+
sphere: SphereData;
|
|
139
|
+
path: PathData;
|
|
140
|
+
world: WorldData;
|
|
141
|
+
hebrewLetter: HebrewLetterData;
|
|
142
|
+
latinLetter: LatinLetterData;
|
|
143
|
+
color: ColorData;
|
|
144
|
+
musicalNote: MusicalNoteData;
|
|
145
|
+
westernZodiacSign: WesternZodiacSignData;
|
|
146
|
+
tarotArkAnnu: TarotArkAnnuData;
|
|
147
|
+
}
|
|
148
|
+
type NodeData<T extends NodeType> = T extends keyof DataMap ? DataMap[T] : never;
|
|
149
|
+
interface Node<T extends NodeType> {
|
|
150
|
+
id: NodeId<T>;
|
|
151
|
+
type: T;
|
|
152
|
+
data?: NodeData<T>;
|
|
153
|
+
name?: string;
|
|
154
|
+
}
|
|
155
|
+
declare class BaseNode<T extends NodeType> implements Node<T> {
|
|
156
|
+
id: NodeId<T>;
|
|
157
|
+
type: T;
|
|
158
|
+
data?: NodeData<T>;
|
|
159
|
+
_name?: string;
|
|
160
|
+
constructor({ id: idValue, type, data, name }: Omit<Node<T>, "id"> & {
|
|
161
|
+
id: string | number;
|
|
162
|
+
});
|
|
163
|
+
get name(): string;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* TreeOfLife represents a graph structure for mapping Kaabalah, Tarot, Astrology and other
|
|
168
|
+
* esoteric correspondences. It can be used to create multiple independent instances
|
|
169
|
+
* for different use cases or to isolate different sets of correspondences.
|
|
170
|
+
*/
|
|
171
|
+
declare class TreeOfLife {
|
|
172
|
+
private nodes;
|
|
173
|
+
private adjacent;
|
|
174
|
+
private modules;
|
|
175
|
+
/**
|
|
176
|
+
* Loads the tree of life system to be used
|
|
177
|
+
* @param systemKey - the key of the system to load
|
|
178
|
+
*/
|
|
179
|
+
loadSystem(systemKey: SystemKey): void;
|
|
180
|
+
/**
|
|
181
|
+
* Loads a part of a system into the tree of life
|
|
182
|
+
* @param partKey - the key of the part to load
|
|
183
|
+
*/
|
|
184
|
+
loadPart(partKey: PartKey): void;
|
|
185
|
+
/**
|
|
186
|
+
* Unloads the tree of life system and all its parts
|
|
187
|
+
*/
|
|
188
|
+
unloadSystem(): void;
|
|
189
|
+
get activeSystem(): SystemKey | null;
|
|
190
|
+
get availableParts(): string[];
|
|
191
|
+
get loadedParts(): PartKey[];
|
|
192
|
+
get availableBridges(): Bridge[];
|
|
193
|
+
get bridgedParts(): string[];
|
|
194
|
+
/**
|
|
195
|
+
* Upserts a node to the tree
|
|
196
|
+
* @param node - the node to upsert
|
|
197
|
+
* @returns the id of the added node
|
|
198
|
+
*/
|
|
199
|
+
upsertNode<T extends NodeType>(node: Node<T>): NodeId<T>;
|
|
200
|
+
getNode<T extends NodeType>(id: NodeId<T>): Node<T> | undefined;
|
|
201
|
+
getNodes(): Node<NodeType>[];
|
|
202
|
+
/**
|
|
203
|
+
* Links two nodes bi-directionally
|
|
204
|
+
* @param firstNode - the id of the first node
|
|
205
|
+
* @param secondNode - the id of the second node
|
|
206
|
+
*/
|
|
207
|
+
link(firstNode: NodeId<NodeType>, secondNode: NodeId<NodeType>): void;
|
|
208
|
+
/**
|
|
209
|
+
* Gets the current node and all its direct relations, or, when filtered by node type, only the direct relations of that type.
|
|
210
|
+
* @param id - the id of the node to get the relations for
|
|
211
|
+
* @param nodeType - the node type to filter the relations by
|
|
212
|
+
* @returns the current node and all its direct relations
|
|
213
|
+
*/
|
|
214
|
+
related<T extends NodeType, U extends NodeType>(id: NodeId<T>, nodeType?: U): Node<U>[];
|
|
215
|
+
/**
|
|
216
|
+
* Sugar for `related(id, type)[0]`
|
|
217
|
+
* @param id - the id of the node to get the related node for
|
|
218
|
+
* @param type - the type of the node to get the related node for
|
|
219
|
+
* @returns the related node
|
|
220
|
+
*/
|
|
221
|
+
relatedFirst<T extends NodeType, U extends NodeType>(id: NodeId<T>, type: U): Node<U> | undefined;
|
|
222
|
+
/**
|
|
223
|
+
* Gets all the types of nodes that are directly connected to the given node
|
|
224
|
+
* @param id - the id of the node to get related types for
|
|
225
|
+
* @returns array of node types that are directly connected
|
|
226
|
+
*/
|
|
227
|
+
relatedTypes<T extends NodeType>(id: NodeId<T>): T[];
|
|
228
|
+
/**
|
|
229
|
+
* BFS up to depth k, optional type filter for the result set
|
|
230
|
+
* @param id - the id of the node to get the extended relations for
|
|
231
|
+
* @param depth - the depth of the walk
|
|
232
|
+
* @param type - the type of the nodes to filter the result set by
|
|
233
|
+
* @returns the current node and all its extended relations
|
|
234
|
+
*/
|
|
235
|
+
walk<T extends NodeType, U extends NodeType>(id: NodeId<T>, depth?: number, type?: U): Node<U>[];
|
|
236
|
+
/**
|
|
237
|
+
* Removes a node and all its relations from the graph, cleaning up adjacency sets.
|
|
238
|
+
* @param id - the id of the node to remove
|
|
239
|
+
*/
|
|
240
|
+
removeNode(id: NodeId<NodeType>): void;
|
|
241
|
+
addNumber({ number, nodeId }: {
|
|
242
|
+
number: number;
|
|
243
|
+
nodeId?: NodeId<NodeType>;
|
|
244
|
+
}): NodeId<NumerologyTypes>;
|
|
245
|
+
/**
|
|
246
|
+
* Adds a sphere (sephirah) to the tree with its Hebrew and English names
|
|
247
|
+
* @param sphere - the identifier for the sphere
|
|
248
|
+
* @param data - the sphere's Hebrew and English names
|
|
249
|
+
* @returns the sphere's id
|
|
250
|
+
*/
|
|
251
|
+
addSphere({ sphere, data, relatedNumber, }: {
|
|
252
|
+
sphere: string;
|
|
253
|
+
data: NodeData<KaabalahTypes.SPHERE>;
|
|
254
|
+
relatedNumber: number;
|
|
255
|
+
}): NodeId<KaabalahTypes.SPHERE>;
|
|
256
|
+
/**
|
|
257
|
+
* Adds a path between two spheres with its associated number
|
|
258
|
+
* @param leftSphere - the id of the first sphere
|
|
259
|
+
* @param rightSphere - the id of the second sphere
|
|
260
|
+
* @param relatedNumber - the number associated with this path
|
|
261
|
+
* @returns the path's id
|
|
262
|
+
*/
|
|
263
|
+
addPath({ leftSphere, rightSphere, relatedNumber, data, }: {
|
|
264
|
+
leftSphere: NodeId<KaabalahTypes.SPHERE>;
|
|
265
|
+
rightSphere: NodeId<KaabalahTypes.SPHERE>;
|
|
266
|
+
relatedNumber: number;
|
|
267
|
+
data?: Omit<NodeData<KaabalahTypes.PATH>, "from" | "to">;
|
|
268
|
+
}): NodeId<KaabalahTypes.PATH>;
|
|
269
|
+
addLetters({ path, letters, }: {
|
|
270
|
+
path: NodeId<KaabalahTypes.PATH>;
|
|
271
|
+
letters: {
|
|
272
|
+
letter: string;
|
|
273
|
+
type: NodeType;
|
|
274
|
+
data?: NodeData<NodeType>;
|
|
275
|
+
}[];
|
|
276
|
+
}): void;
|
|
277
|
+
addWesternAstrologySign({ path, sign, data, relatedNumber, }: {
|
|
278
|
+
path: NodeId<KaabalahTypes.PATH>;
|
|
279
|
+
sign: string;
|
|
280
|
+
data: NodeData<WesternAstrologyTypes.WESTERN_ZODIAC_SIGN>;
|
|
281
|
+
relatedNumber: number;
|
|
282
|
+
}): NodeId<WesternAstrologyTypes.WESTERN_ZODIAC_SIGN>;
|
|
283
|
+
addTarotArkAnnu({ node, tarotArkAnnu, data, relatedNumber, suit, }: {
|
|
284
|
+
node: NodeId<NodeType>;
|
|
285
|
+
tarotArkAnnu: string;
|
|
286
|
+
data: NodeData<TarotTypes.TAROT_ARK_ANNU>;
|
|
287
|
+
relatedNumber: number;
|
|
288
|
+
suit?: string;
|
|
289
|
+
}): NodeId<TarotTypes.TAROT_ARK_ANNU>;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Loads the Hermetic Qabalah system into the tree of life
|
|
294
|
+
*/
|
|
295
|
+
declare function loadHermeticQabalah(tree: TreeOfLife): TreeOfLife;
|
|
296
|
+
declare function loadColors(tree: TreeOfLife): TreeOfLife;
|
|
297
|
+
declare function loadMusicalNotes(tree: TreeOfLife): TreeOfLife;
|
|
298
|
+
declare const LOADERS$2: {
|
|
299
|
+
base: typeof loadHermeticQabalah;
|
|
300
|
+
colors: typeof loadColors;
|
|
301
|
+
music: typeof loadMusicalNotes;
|
|
302
|
+
westernAstrology: Loader;
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
declare const LOADERS$1: {
|
|
306
|
+
base: Loader;
|
|
307
|
+
colors: Loader;
|
|
308
|
+
music: Loader;
|
|
309
|
+
westernAstrology: Loader;
|
|
310
|
+
tarot: Loader;
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Loads the Lurianic Kabbalah system into the tree of life
|
|
315
|
+
*/
|
|
316
|
+
declare function loadLurianicKabbalah(tree: TreeOfLife): TreeOfLife;
|
|
317
|
+
declare const LOADERS: {
|
|
318
|
+
base: typeof loadLurianicKabbalah;
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
type System = {
|
|
322
|
+
SYSTEM: "kaabalah" | "hermetic-qabalah" | "lurianic-kabbalah";
|
|
323
|
+
LOADERS: Record<string, Loader>;
|
|
324
|
+
UNLOADERS: Record<string, Unloader>;
|
|
325
|
+
BRIDGES: Bridge[];
|
|
326
|
+
};
|
|
327
|
+
declare const SYSTEMS: System[];
|
|
328
|
+
type SystemKey = typeof SYSTEMS[number]['SYSTEM'];
|
|
329
|
+
type PartKey = keyof typeof LOADERS$1 | keyof typeof LOADERS$2 | keyof typeof LOADERS;
|
|
330
|
+
type Loader = (t: TreeOfLife) => TreeOfLife;
|
|
331
|
+
type Unloader = (t: TreeOfLife) => void;
|
|
332
|
+
type Bridge = {
|
|
333
|
+
id: string;
|
|
334
|
+
needs: PartKey[];
|
|
335
|
+
run: (t: TreeOfLife) => void;
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
export { type Bridge as B, KaabalahTypes as K, type Loader as L, MiscTypes as M, NumerologyTypes as N, type PartKey as P, type System as S, TreeOfLife as T, type Unloader as U, WesternAstrologyTypes as W, SYSTEMS as a, type SystemKey as b, LetterTypes as c, TarotTypes as d, TantraTypes as e, type NodeType as f, type NodeId as g, type NodeData as h, id as i, type Node as j, BaseNode as k, parseId as p };
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
interface HermeticQabalahSphereData {
|
|
2
|
+
/**
|
|
3
|
+
* In Atziluth
|
|
4
|
+
*/
|
|
5
|
+
divineName: string;
|
|
6
|
+
/**
|
|
7
|
+
* In Briah
|
|
8
|
+
*/
|
|
9
|
+
archangelicName: string;
|
|
10
|
+
/**
|
|
11
|
+
* In Yetzirah
|
|
12
|
+
*/
|
|
13
|
+
angelicName: string;
|
|
14
|
+
/**
|
|
15
|
+
* In Assiah
|
|
16
|
+
*/
|
|
17
|
+
mundaneName: string;
|
|
18
|
+
}
|
|
19
|
+
type SphereData = {
|
|
20
|
+
hebrewSpelling: string;
|
|
21
|
+
englishName: string;
|
|
22
|
+
magicalImage?: string;
|
|
23
|
+
} & Partial<HermeticQabalahSphereData>;
|
|
24
|
+
type PathData = {
|
|
25
|
+
meaning?: string;
|
|
26
|
+
from: NodeId<KaabalahTypes.SPHERE>;
|
|
27
|
+
to: NodeId<KaabalahTypes.SPHERE>;
|
|
28
|
+
};
|
|
29
|
+
type WorldData = {
|
|
30
|
+
englishName: string;
|
|
31
|
+
};
|
|
32
|
+
type HebrewLetterData = {
|
|
33
|
+
type: "mother" | "double" | "simple";
|
|
34
|
+
gematriaValue: number;
|
|
35
|
+
gematriaValueWhenEnding?: number;
|
|
36
|
+
symbol: string;
|
|
37
|
+
hieroglyph: string;
|
|
38
|
+
yvritMeaning: string;
|
|
39
|
+
character: string;
|
|
40
|
+
characterWhenEnding?: string;
|
|
41
|
+
};
|
|
42
|
+
type LatinLetterData = {
|
|
43
|
+
isVowel: boolean;
|
|
44
|
+
};
|
|
45
|
+
type ColorData = {
|
|
46
|
+
colorDescription: string;
|
|
47
|
+
colorNames: string[];
|
|
48
|
+
colorHexCodes: string[];
|
|
49
|
+
};
|
|
50
|
+
type MusicalNoteData = {
|
|
51
|
+
note: string;
|
|
52
|
+
noteDescription: string;
|
|
53
|
+
frequencies?: [string, string, string, string, string, string, string, string, string];
|
|
54
|
+
};
|
|
55
|
+
type WesternZodiacSignData = {
|
|
56
|
+
element: Exclude<(typeof WESTERN_ELEMENTS)[keyof typeof WESTERN_ELEMENTS], "Ether">;
|
|
57
|
+
type: "cardinal" | "fixed" | "mutable";
|
|
58
|
+
rulingPlanets: Array<Exclude<(typeof PLANETS)[keyof typeof PLANETS], "Earth">>;
|
|
59
|
+
};
|
|
60
|
+
type TarotArkAnnuData = {
|
|
61
|
+
type: "major" | "minor" | "court";
|
|
62
|
+
suit?: (typeof TAROT_SUITS)[keyof typeof TAROT_SUITS];
|
|
63
|
+
descriptiveData: {
|
|
64
|
+
deck: string;
|
|
65
|
+
name?: string;
|
|
66
|
+
meaning?: string;
|
|
67
|
+
reversedMeaning?: string;
|
|
68
|
+
keywords?: string[];
|
|
69
|
+
}[];
|
|
70
|
+
};
|
|
71
|
+
declare const PLANETS: {
|
|
72
|
+
readonly EARTH: "Earth";
|
|
73
|
+
readonly MOON: "Moon";
|
|
74
|
+
readonly SUN: "Sun";
|
|
75
|
+
readonly MERCURY: "Mercury";
|
|
76
|
+
readonly VENUS: "Venus";
|
|
77
|
+
readonly MARS: "Mars";
|
|
78
|
+
readonly JUPITER: "Jupiter";
|
|
79
|
+
readonly SATURN: "Saturn";
|
|
80
|
+
readonly URANUS: "Uranus";
|
|
81
|
+
readonly NEPTUNE: "Neptune";
|
|
82
|
+
readonly PLUTO: "Pluto";
|
|
83
|
+
};
|
|
84
|
+
declare const WESTERN_ELEMENTS: {
|
|
85
|
+
readonly FIRE: "Fire";
|
|
86
|
+
readonly AIR: "Air";
|
|
87
|
+
readonly WATER: "Water";
|
|
88
|
+
readonly EARTH: "Earth";
|
|
89
|
+
readonly ETHER: "Ether";
|
|
90
|
+
};
|
|
91
|
+
declare const TAROT_SUITS: {
|
|
92
|
+
readonly WANDS: "Wands";
|
|
93
|
+
readonly CUPS: "Cups";
|
|
94
|
+
readonly SWORDS: "Swords";
|
|
95
|
+
readonly PENTACLES: "Pentacles";
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
declare enum KaabalahTypes {
|
|
99
|
+
SPHERE = "sphere",
|
|
100
|
+
PATH = "path",
|
|
101
|
+
WORLD = "world"
|
|
102
|
+
}
|
|
103
|
+
declare enum LetterTypes {
|
|
104
|
+
HEBREW_LETTER = "hebrewLetter",
|
|
105
|
+
LATIN_LETTER = "latinLetter",
|
|
106
|
+
SANSKRIT_LETTER = "sanskritLetter",
|
|
107
|
+
ARCHEOMETER_LETTER = "archeometerLetter"
|
|
108
|
+
}
|
|
109
|
+
declare enum WesternAstrologyTypes {
|
|
110
|
+
PLANET = "planet",
|
|
111
|
+
WESTERN_ZODIAC_SIGN = "westernZodiacSign",
|
|
112
|
+
WESTERN_ELEMENT = "westernElement"
|
|
113
|
+
}
|
|
114
|
+
declare enum TarotTypes {
|
|
115
|
+
TAROT_ARK_ANNU = "tarotArkAnnu",
|
|
116
|
+
TAROT_SUIT = "tarotSuit"
|
|
117
|
+
}
|
|
118
|
+
declare enum TantraTypes {
|
|
119
|
+
CHAKRA = "chakra",
|
|
120
|
+
SUBTLE_BODY = "subtleBody"
|
|
121
|
+
}
|
|
122
|
+
declare enum NumerologyTypes {
|
|
123
|
+
NUMBER = "number"
|
|
124
|
+
}
|
|
125
|
+
declare enum MiscTypes {
|
|
126
|
+
COLOR = "color",
|
|
127
|
+
MUSICAL_NOTE = "musicalNote",
|
|
128
|
+
UNCATEGORIZED = "uncategorized"
|
|
129
|
+
}
|
|
130
|
+
type NodeType = typeof KaabalahTypes[keyof typeof KaabalahTypes] | typeof LetterTypes[keyof typeof LetterTypes] | typeof NumerologyTypes[keyof typeof NumerologyTypes] | typeof MiscTypes[keyof typeof MiscTypes] | typeof TarotTypes[keyof typeof TarotTypes] | typeof TantraTypes[keyof typeof TantraTypes] | typeof WesternAstrologyTypes[keyof typeof WesternAstrologyTypes];
|
|
131
|
+
type Branded<T, B> = T & {
|
|
132
|
+
readonly __brand: B;
|
|
133
|
+
};
|
|
134
|
+
type NodeId<T extends NodeType> = Branded<`${T}:${string}`, T>;
|
|
135
|
+
declare const id: <T extends NodeType>(type: T, value: string | number) => NodeId<T>;
|
|
136
|
+
declare const parseId: <T extends NodeType>(nodeId: NodeId<T>) => string;
|
|
137
|
+
interface DataMap {
|
|
138
|
+
sphere: SphereData;
|
|
139
|
+
path: PathData;
|
|
140
|
+
world: WorldData;
|
|
141
|
+
hebrewLetter: HebrewLetterData;
|
|
142
|
+
latinLetter: LatinLetterData;
|
|
143
|
+
color: ColorData;
|
|
144
|
+
musicalNote: MusicalNoteData;
|
|
145
|
+
westernZodiacSign: WesternZodiacSignData;
|
|
146
|
+
tarotArkAnnu: TarotArkAnnuData;
|
|
147
|
+
}
|
|
148
|
+
type NodeData<T extends NodeType> = T extends keyof DataMap ? DataMap[T] : never;
|
|
149
|
+
interface Node<T extends NodeType> {
|
|
150
|
+
id: NodeId<T>;
|
|
151
|
+
type: T;
|
|
152
|
+
data?: NodeData<T>;
|
|
153
|
+
name?: string;
|
|
154
|
+
}
|
|
155
|
+
declare class BaseNode<T extends NodeType> implements Node<T> {
|
|
156
|
+
id: NodeId<T>;
|
|
157
|
+
type: T;
|
|
158
|
+
data?: NodeData<T>;
|
|
159
|
+
_name?: string;
|
|
160
|
+
constructor({ id: idValue, type, data, name }: Omit<Node<T>, "id"> & {
|
|
161
|
+
id: string | number;
|
|
162
|
+
});
|
|
163
|
+
get name(): string;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* TreeOfLife represents a graph structure for mapping Kaabalah, Tarot, Astrology and other
|
|
168
|
+
* esoteric correspondences. It can be used to create multiple independent instances
|
|
169
|
+
* for different use cases or to isolate different sets of correspondences.
|
|
170
|
+
*/
|
|
171
|
+
declare class TreeOfLife {
|
|
172
|
+
private nodes;
|
|
173
|
+
private adjacent;
|
|
174
|
+
private modules;
|
|
175
|
+
/**
|
|
176
|
+
* Loads the tree of life system to be used
|
|
177
|
+
* @param systemKey - the key of the system to load
|
|
178
|
+
*/
|
|
179
|
+
loadSystem(systemKey: SystemKey): void;
|
|
180
|
+
/**
|
|
181
|
+
* Loads a part of a system into the tree of life
|
|
182
|
+
* @param partKey - the key of the part to load
|
|
183
|
+
*/
|
|
184
|
+
loadPart(partKey: PartKey): void;
|
|
185
|
+
/**
|
|
186
|
+
* Unloads the tree of life system and all its parts
|
|
187
|
+
*/
|
|
188
|
+
unloadSystem(): void;
|
|
189
|
+
get activeSystem(): SystemKey | null;
|
|
190
|
+
get availableParts(): string[];
|
|
191
|
+
get loadedParts(): PartKey[];
|
|
192
|
+
get availableBridges(): Bridge[];
|
|
193
|
+
get bridgedParts(): string[];
|
|
194
|
+
/**
|
|
195
|
+
* Upserts a node to the tree
|
|
196
|
+
* @param node - the node to upsert
|
|
197
|
+
* @returns the id of the added node
|
|
198
|
+
*/
|
|
199
|
+
upsertNode<T extends NodeType>(node: Node<T>): NodeId<T>;
|
|
200
|
+
getNode<T extends NodeType>(id: NodeId<T>): Node<T> | undefined;
|
|
201
|
+
getNodes(): Node<NodeType>[];
|
|
202
|
+
/**
|
|
203
|
+
* Links two nodes bi-directionally
|
|
204
|
+
* @param firstNode - the id of the first node
|
|
205
|
+
* @param secondNode - the id of the second node
|
|
206
|
+
*/
|
|
207
|
+
link(firstNode: NodeId<NodeType>, secondNode: NodeId<NodeType>): void;
|
|
208
|
+
/**
|
|
209
|
+
* Gets the current node and all its direct relations, or, when filtered by node type, only the direct relations of that type.
|
|
210
|
+
* @param id - the id of the node to get the relations for
|
|
211
|
+
* @param nodeType - the node type to filter the relations by
|
|
212
|
+
* @returns the current node and all its direct relations
|
|
213
|
+
*/
|
|
214
|
+
related<T extends NodeType, U extends NodeType>(id: NodeId<T>, nodeType?: U): Node<U>[];
|
|
215
|
+
/**
|
|
216
|
+
* Sugar for `related(id, type)[0]`
|
|
217
|
+
* @param id - the id of the node to get the related node for
|
|
218
|
+
* @param type - the type of the node to get the related node for
|
|
219
|
+
* @returns the related node
|
|
220
|
+
*/
|
|
221
|
+
relatedFirst<T extends NodeType, U extends NodeType>(id: NodeId<T>, type: U): Node<U> | undefined;
|
|
222
|
+
/**
|
|
223
|
+
* Gets all the types of nodes that are directly connected to the given node
|
|
224
|
+
* @param id - the id of the node to get related types for
|
|
225
|
+
* @returns array of node types that are directly connected
|
|
226
|
+
*/
|
|
227
|
+
relatedTypes<T extends NodeType>(id: NodeId<T>): T[];
|
|
228
|
+
/**
|
|
229
|
+
* BFS up to depth k, optional type filter for the result set
|
|
230
|
+
* @param id - the id of the node to get the extended relations for
|
|
231
|
+
* @param depth - the depth of the walk
|
|
232
|
+
* @param type - the type of the nodes to filter the result set by
|
|
233
|
+
* @returns the current node and all its extended relations
|
|
234
|
+
*/
|
|
235
|
+
walk<T extends NodeType, U extends NodeType>(id: NodeId<T>, depth?: number, type?: U): Node<U>[];
|
|
236
|
+
/**
|
|
237
|
+
* Removes a node and all its relations from the graph, cleaning up adjacency sets.
|
|
238
|
+
* @param id - the id of the node to remove
|
|
239
|
+
*/
|
|
240
|
+
removeNode(id: NodeId<NodeType>): void;
|
|
241
|
+
addNumber({ number, nodeId }: {
|
|
242
|
+
number: number;
|
|
243
|
+
nodeId?: NodeId<NodeType>;
|
|
244
|
+
}): NodeId<NumerologyTypes>;
|
|
245
|
+
/**
|
|
246
|
+
* Adds a sphere (sephirah) to the tree with its Hebrew and English names
|
|
247
|
+
* @param sphere - the identifier for the sphere
|
|
248
|
+
* @param data - the sphere's Hebrew and English names
|
|
249
|
+
* @returns the sphere's id
|
|
250
|
+
*/
|
|
251
|
+
addSphere({ sphere, data, relatedNumber, }: {
|
|
252
|
+
sphere: string;
|
|
253
|
+
data: NodeData<KaabalahTypes.SPHERE>;
|
|
254
|
+
relatedNumber: number;
|
|
255
|
+
}): NodeId<KaabalahTypes.SPHERE>;
|
|
256
|
+
/**
|
|
257
|
+
* Adds a path between two spheres with its associated number
|
|
258
|
+
* @param leftSphere - the id of the first sphere
|
|
259
|
+
* @param rightSphere - the id of the second sphere
|
|
260
|
+
* @param relatedNumber - the number associated with this path
|
|
261
|
+
* @returns the path's id
|
|
262
|
+
*/
|
|
263
|
+
addPath({ leftSphere, rightSphere, relatedNumber, data, }: {
|
|
264
|
+
leftSphere: NodeId<KaabalahTypes.SPHERE>;
|
|
265
|
+
rightSphere: NodeId<KaabalahTypes.SPHERE>;
|
|
266
|
+
relatedNumber: number;
|
|
267
|
+
data?: Omit<NodeData<KaabalahTypes.PATH>, "from" | "to">;
|
|
268
|
+
}): NodeId<KaabalahTypes.PATH>;
|
|
269
|
+
addLetters({ path, letters, }: {
|
|
270
|
+
path: NodeId<KaabalahTypes.PATH>;
|
|
271
|
+
letters: {
|
|
272
|
+
letter: string;
|
|
273
|
+
type: NodeType;
|
|
274
|
+
data?: NodeData<NodeType>;
|
|
275
|
+
}[];
|
|
276
|
+
}): void;
|
|
277
|
+
addWesternAstrologySign({ path, sign, data, relatedNumber, }: {
|
|
278
|
+
path: NodeId<KaabalahTypes.PATH>;
|
|
279
|
+
sign: string;
|
|
280
|
+
data: NodeData<WesternAstrologyTypes.WESTERN_ZODIAC_SIGN>;
|
|
281
|
+
relatedNumber: number;
|
|
282
|
+
}): NodeId<WesternAstrologyTypes.WESTERN_ZODIAC_SIGN>;
|
|
283
|
+
addTarotArkAnnu({ node, tarotArkAnnu, data, relatedNumber, suit, }: {
|
|
284
|
+
node: NodeId<NodeType>;
|
|
285
|
+
tarotArkAnnu: string;
|
|
286
|
+
data: NodeData<TarotTypes.TAROT_ARK_ANNU>;
|
|
287
|
+
relatedNumber: number;
|
|
288
|
+
suit?: string;
|
|
289
|
+
}): NodeId<TarotTypes.TAROT_ARK_ANNU>;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Loads the Hermetic Qabalah system into the tree of life
|
|
294
|
+
*/
|
|
295
|
+
declare function loadHermeticQabalah(tree: TreeOfLife): TreeOfLife;
|
|
296
|
+
declare function loadColors(tree: TreeOfLife): TreeOfLife;
|
|
297
|
+
declare function loadMusicalNotes(tree: TreeOfLife): TreeOfLife;
|
|
298
|
+
declare const LOADERS$2: {
|
|
299
|
+
base: typeof loadHermeticQabalah;
|
|
300
|
+
colors: typeof loadColors;
|
|
301
|
+
music: typeof loadMusicalNotes;
|
|
302
|
+
westernAstrology: Loader;
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
declare const LOADERS$1: {
|
|
306
|
+
base: Loader;
|
|
307
|
+
colors: Loader;
|
|
308
|
+
music: Loader;
|
|
309
|
+
westernAstrology: Loader;
|
|
310
|
+
tarot: Loader;
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Loads the Lurianic Kabbalah system into the tree of life
|
|
315
|
+
*/
|
|
316
|
+
declare function loadLurianicKabbalah(tree: TreeOfLife): TreeOfLife;
|
|
317
|
+
declare const LOADERS: {
|
|
318
|
+
base: typeof loadLurianicKabbalah;
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
type System = {
|
|
322
|
+
SYSTEM: "kaabalah" | "hermetic-qabalah" | "lurianic-kabbalah";
|
|
323
|
+
LOADERS: Record<string, Loader>;
|
|
324
|
+
UNLOADERS: Record<string, Unloader>;
|
|
325
|
+
BRIDGES: Bridge[];
|
|
326
|
+
};
|
|
327
|
+
declare const SYSTEMS: System[];
|
|
328
|
+
type SystemKey = typeof SYSTEMS[number]['SYSTEM'];
|
|
329
|
+
type PartKey = keyof typeof LOADERS$1 | keyof typeof LOADERS$2 | keyof typeof LOADERS;
|
|
330
|
+
type Loader = (t: TreeOfLife) => TreeOfLife;
|
|
331
|
+
type Unloader = (t: TreeOfLife) => void;
|
|
332
|
+
type Bridge = {
|
|
333
|
+
id: string;
|
|
334
|
+
needs: PartKey[];
|
|
335
|
+
run: (t: TreeOfLife) => void;
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
export { type Bridge as B, KaabalahTypes as K, type Loader as L, MiscTypes as M, NumerologyTypes as N, type PartKey as P, type System as S, TreeOfLife as T, type Unloader as U, WesternAstrologyTypes as W, SYSTEMS as a, type SystemKey as b, LetterTypes as c, TarotTypes as d, TantraTypes as e, type NodeType as f, type NodeId as g, type NodeData as h, id as i, type Node as j, BaseNode as k, parseId as p };
|