mftsccs-node 0.0.56 → 0.0.58

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.
Files changed (188) hide show
  1. package/README.md +1148 -11
  2. package/dist/bundle.js +1 -0
  3. package/dist/types/Api/Create/CreateTheCharacter.d.ts +45 -0
  4. package/dist/types/Api/Create/CreateTheConceptApi.d.ts +52 -0
  5. package/dist/types/Api/Create/CreateTheConnectionApi.d.ts +53 -0
  6. package/dist/types/Api/Create/CreateTheTextData.d.ts +58 -0
  7. package/dist/types/Api/Delete/DeleteConceptInBackend.d.ts +44 -0
  8. package/dist/types/Api/DeleteConnectionApiBulk.d.ts +56 -0
  9. package/dist/types/Api/DeleteTheConcept.d.ts +65 -0
  10. package/dist/types/Api/DeleteTheConnection.d.ts +77 -0
  11. package/dist/types/Api/GetAiData.d.ts +37 -0
  12. package/dist/types/Api/GetAllConcepts.d.ts +43 -0
  13. package/dist/types/Api/GetAllConceptsByType.d.ts +46 -0
  14. package/dist/types/Api/GetAllConnections.d.ts +49 -0
  15. package/dist/types/Api/GetAllConnectionsOfComposition.d.ts +82 -0
  16. package/dist/types/Api/GetAllConnectionsOfCompositionBulk.d.ts +93 -0
  17. package/dist/types/Api/GetAllLinkerConnectionsFromTheConcept.d.ts +54 -0
  18. package/dist/types/Api/GetAllLinkerConnectionsToTheConcept.d.ts +63 -0
  19. package/dist/types/Api/GetAllPrefetchConnections.d.ts +52 -0
  20. package/dist/types/Api/GetCharacterDataByCharacter.d.ts +33 -0
  21. package/dist/types/Api/GetCompositionConnectionsBetweenTwoConcepts.d.ts +41 -0
  22. package/dist/types/Api/GetConcept.d.ts +49 -0
  23. package/dist/types/Api/GetConceptBulk.d.ts +71 -0
  24. package/dist/types/Api/GetConceptByCharacterAndType.d.ts +78 -0
  25. package/dist/types/Api/GetConceptByCharacterValue.d.ts +49 -0
  26. package/dist/types/Api/GetConnection.d.ts +51 -0
  27. package/dist/types/Api/GetConnectionBulk.d.ts +48 -0
  28. package/dist/types/Api/GetConnectionOfTheConcept.d.ts +52 -0
  29. package/dist/types/Api/GetConnectionToTheConcept.d.ts +58 -0
  30. package/dist/types/Api/GetReservedConnectionIds.d.ts +37 -0
  31. package/dist/types/Api/GetReservedIds.d.ts +38 -0
  32. package/dist/types/Api/Login.d.ts +39 -0
  33. package/dist/types/Api/MakeTheNameInBackend.d.ts +40 -0
  34. package/dist/types/Api/MakeTheTypeConceptApi.d.ts +42 -0
  35. package/dist/types/Api/RecursiveSearch.d.ts +44 -0
  36. package/dist/types/Api/Search/FreeschemaQueryApi.d.ts +48 -0
  37. package/dist/types/Api/Search/Search.d.ts +68 -0
  38. package/dist/types/Api/Search/SearchInternalApi.d.ts +71 -0
  39. package/dist/types/Api/Search/SearchLinkMultipleApi.d.ts +92 -0
  40. package/dist/types/Api/Search/SearchWithLinker.d.ts +99 -0
  41. package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryApi.d.ts +41 -0
  42. package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryDirect.d.ts +49 -0
  43. package/dist/types/Api/Session/CreateSession.d.ts +47 -0
  44. package/dist/types/Api/Session/CreateSessionVisit.d.ts +44 -0
  45. package/dist/types/Api/Signin.d.ts +51 -0
  46. package/dist/types/Api/Signup.d.ts +47 -0
  47. package/dist/types/Api/View/ViewInternalDataApi.d.ts +51 -0
  48. package/dist/types/Constants/ApiConstants.d.ts +249 -0
  49. package/dist/types/Constants/FormatConstants.d.ts +87 -0
  50. package/dist/types/DataStructures/BaseUrl.d.ts +262 -0
  51. package/dist/types/DataStructures/BinaryCharacterTree.d.ts +227 -0
  52. package/dist/types/DataStructures/BinaryTree.d.ts +151 -0
  53. package/dist/types/DataStructures/BinaryTypeTree.d.ts +211 -0
  54. package/dist/types/DataStructures/CharacterRepository.d.ts +117 -0
  55. package/dist/types/DataStructures/Composition/Composition.d.ts +117 -0
  56. package/dist/types/DataStructures/Composition/CompositionBinaryTree.d.ts +114 -0
  57. package/dist/types/DataStructures/Composition/CompositionNode.d.ts +223 -0
  58. package/dist/types/DataStructures/Concept.d.ts +139 -0
  59. package/dist/types/DataStructures/ConceptData.d.ts +317 -0
  60. package/dist/types/DataStructures/ConceptsToDraw.d.ts +179 -0
  61. package/dist/types/DataStructures/Connection.d.ts +103 -0
  62. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionBinaryTree.d.ts +126 -0
  63. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionNode.d.ts +193 -0
  64. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionTypeTree.d.ts +95 -0
  65. package/dist/types/DataStructures/ConnectionData.d.ts +209 -0
  66. package/dist/types/DataStructures/Count/CountInfo.d.ts +79 -0
  67. package/dist/types/DataStructures/FilterSearch.d.ts +93 -0
  68. package/dist/types/DataStructures/IdentifierFlags.d.ts +45 -0
  69. package/dist/types/DataStructures/Local/LConcept.d.ts +126 -0
  70. package/dist/types/DataStructures/Local/LConnection.d.ts +101 -0
  71. package/dist/types/DataStructures/Local/LNode.d.ts +217 -0
  72. package/dist/types/DataStructures/Local/LocalBinaryCharacterTree.d.ts +145 -0
  73. package/dist/types/DataStructures/Local/LocalBinaryTree.d.ts +147 -0
  74. package/dist/types/DataStructures/Local/LocalBinaryTypeTree.d.ts +160 -0
  75. package/dist/types/DataStructures/Local/LocalConceptData.d.ts +114 -0
  76. package/dist/types/DataStructures/Local/LocalConnectionData.d.ts +125 -0
  77. package/dist/types/DataStructures/Local/LocalSyncData.d.ts +103 -0
  78. package/dist/types/DataStructures/Node.d.ts +29 -0
  79. package/dist/types/DataStructures/PatcherStructure.d.ts +94 -0
  80. package/dist/types/DataStructures/ReferentInfo.d.ts +75 -0
  81. package/dist/types/DataStructures/ReservedIds.d.ts +111 -0
  82. package/dist/types/DataStructures/Responses/ErrorResponse.d.ts +236 -0
  83. package/dist/types/DataStructures/Responses/StandardResponses.d.ts +71 -0
  84. package/dist/types/DataStructures/Returner.d.ts +66 -0
  85. package/dist/types/DataStructures/Search/FreeschemaQuery.d.ts +187 -0
  86. package/dist/types/DataStructures/Search/SearchStructure.d.ts +78 -0
  87. package/dist/types/DataStructures/SearchQuery.d.ts +146 -0
  88. package/dist/types/DataStructures/Security/TokenStorage.d.ts +51 -0
  89. package/dist/types/DataStructures/Session/SessionData.d.ts +131 -0
  90. package/dist/types/DataStructures/SettingData.d.ts +37 -0
  91. package/dist/types/DataStructures/Settings.d.ts +31 -0
  92. package/dist/types/DataStructures/SigninModel.d.ts +54 -0
  93. package/dist/types/DataStructures/SignupModel.d.ts +54 -0
  94. package/dist/types/DataStructures/SyncData.d.ts +232 -0
  95. package/dist/types/DataStructures/TheCharacter.d.ts +100 -0
  96. package/dist/types/DataStructures/TheTexts.d.ts +106 -0
  97. package/dist/types/DataStructures/Transaction/Transaction.d.ts +320 -0
  98. package/dist/types/DataStructures/User/UserBinaryTree.d.ts +132 -0
  99. package/dist/types/DataStructures/User/UserNode.d.ts +150 -0
  100. package/dist/types/Database/GetConceptFromIndexDb.d.ts +9 -0
  101. package/dist/types/Database/NoIndexDb.d.ts +178 -0
  102. package/dist/types/Database/indexdblocal.d.ts +45 -0
  103. package/dist/types/Database/indexeddb.d.ts +46 -0
  104. package/dist/types/Drawing/ConceptDraw.d.ts +29 -0
  105. package/dist/types/Drawing/ConceptEvents.d.ts +47 -0
  106. package/dist/types/Helpers/CheckIfExists.d.ts +169 -0
  107. package/dist/types/Helpers/RemoveFromArray.d.ts +72 -0
  108. package/dist/types/Helpers/UniqueInsert.d.ts +29 -0
  109. package/dist/types/Services/CheckForConnectionDeletion.d.ts +193 -0
  110. package/dist/types/Services/Common/DecodeCountInfo.d.ts +57 -0
  111. package/dist/types/Services/Common/ErrorPosting.d.ts +51 -0
  112. package/dist/types/Services/Common/RegexFunction.d.ts +29 -0
  113. package/dist/types/Services/Composition/BuildComposition.d.ts +40 -0
  114. package/dist/types/Services/Composition/CompositionCache.d.ts +93 -0
  115. package/dist/types/Services/Composition/CreateCompositionCache.d.ts +46 -0
  116. package/dist/types/Services/ConceptFinding/GetConceptByCharacterAndCategory.d.ts +5 -0
  117. package/dist/types/Services/Conversion/ConvertConcepts.d.ts +90 -0
  118. package/dist/types/Services/CreateBinaryTreeFromData.d.ts +39 -0
  119. package/dist/types/Services/CreateCharacterBinaryTreeFromData.d.ts +43 -0
  120. package/dist/types/Services/CreateConnectionBetweenTwoConcepts.d.ts +211 -0
  121. package/dist/types/Services/CreateDefaultConcept.d.ts +117 -0
  122. package/dist/types/Services/CreateTheComposition.d.ts +103 -0
  123. package/dist/types/Services/CreateTheConcept.d.ts +184 -0
  124. package/dist/types/Services/CreateTheConnection.d.ts +61 -0
  125. package/dist/types/Services/CreateTheConnectionGeneral.d.ts +132 -0
  126. package/dist/types/Services/CreateTypeTreeFromData.d.ts +44 -0
  127. package/dist/types/Services/Delete/DeleteConnectionByType.d.ts +60 -0
  128. package/dist/types/Services/Delete/GetAllConnectionByType.d.ts +64 -0
  129. package/dist/types/Services/DeleteConcept.d.ts +137 -0
  130. package/dist/types/Services/DeleteConnection.d.ts +196 -0
  131. package/dist/types/Services/FindConeceptsFromConnection.d.ts +181 -0
  132. package/dist/types/Services/FindConnectionsOfCompositionBulkInMemory.d.ts +159 -0
  133. package/dist/types/Services/GenerateHexNumber.d.ts +65 -0
  134. package/dist/types/Services/GetAccessIdOfUser.d.ts +0 -0
  135. package/dist/types/Services/GetComposition.d.ts +342 -0
  136. package/dist/types/Services/GetCompositionBulk.d.ts +259 -0
  137. package/dist/types/Services/GetCompositionList.d.ts +132 -0
  138. package/dist/types/Services/GetConceptByCharacter.d.ts +87 -0
  139. package/dist/types/Services/GetConnections.d.ts +74 -0
  140. package/dist/types/Services/GetDataFromIndexDb.d.ts +81 -0
  141. package/dist/types/Services/GetLink.d.ts +107 -0
  142. package/dist/types/Services/GetLinkerConnectionFromConcept.d.ts +102 -0
  143. package/dist/types/Services/GetMaximumConnectionSyncTime.d.ts +59 -0
  144. package/dist/types/Services/GetRelation.d.ts +167 -0
  145. package/dist/types/Services/GetTheConcept.d.ts +73 -0
  146. package/dist/types/Services/GetTheReferent.d.ts +76 -0
  147. package/dist/types/Services/InitializeSystem.d.ts +121 -0
  148. package/dist/types/Services/Local/CreateConnectionListFromDatat.d.ts +0 -0
  149. package/dist/types/Services/Local/CreateDefaultLConcept.d.ts +50 -0
  150. package/dist/types/Services/Local/CreateLocalBinaryTreeFromData.d.ts +50 -0
  151. package/dist/types/Services/Local/CreateLocalBinaryTypeTreeFromData.d.ts +55 -0
  152. package/dist/types/Services/Local/CreateLocalCharacterBinaryTree.d.ts +61 -0
  153. package/dist/types/Services/Local/CreateTheCompositionLocal.d.ts +72 -0
  154. package/dist/types/Services/Local/CreateTheConceptLocal.d.ts +60 -0
  155. package/dist/types/Services/Local/CreateTheConnectionLocal.d.ts +58 -0
  156. package/dist/types/Services/Local/GetCompositionListLocal.d.ts +105 -0
  157. package/dist/types/Services/Local/GetCompositionLocal.d.ts +98 -0
  158. package/dist/types/Services/Local/GetConceptByCharacterLocal.d.ts +58 -0
  159. package/dist/types/Services/Local/MakeTheConceptLocal.d.ts +73 -0
  160. package/dist/types/Services/Local/MakeTheInstanceConceptLocal.d.ts +91 -0
  161. package/dist/types/Services/Local/MakeTheTypeLocal.d.ts +73 -0
  162. package/dist/types/Services/Local/UpdateCompositionLocal.d.ts +103 -0
  163. package/dist/types/Services/MakeTheCharacter.d.ts +76 -0
  164. package/dist/types/Services/MakeTheCharacterData.d.ts +67 -0
  165. package/dist/types/Services/MakeTheConcept.d.ts +2 -0
  166. package/dist/types/Services/MakeTheInstanceConcept.d.ts +78 -0
  167. package/dist/types/Services/MakeTheLocalConcept.d.ts +0 -0
  168. package/dist/types/Services/MakeTheName.d.ts +83 -0
  169. package/dist/types/Services/MakeTheTimestamp.d.ts +70 -0
  170. package/dist/types/Services/MakeTheTypeConcept.d.ts +71 -0
  171. package/dist/types/Services/Mqtt/publishMessage.d.ts +28 -0
  172. package/dist/types/Services/Mqtt/subscribeMessage.d.ts +23 -0
  173. package/dist/types/Services/PatchComposition.d.ts +107 -0
  174. package/dist/types/Services/Search/DataIdFormat.d.ts +104 -0
  175. package/dist/types/Services/Search/FormatData.d.ts +101 -0
  176. package/dist/types/Services/Search/JustIdFormat.d.ts +98 -0
  177. package/dist/types/Services/Search/SearchLinkInternal.d.ts +30 -0
  178. package/dist/types/Services/Search/SearchLinkMultiple.d.ts +61 -0
  179. package/dist/types/Services/Search/SearchWithTypeAndLinker.d.ts +101 -0
  180. package/dist/types/Services/Search/orderingConnections.d.ts +36 -0
  181. package/dist/types/Services/Security/GetRequestHeader.d.ts +10 -0
  182. package/dist/types/Services/SplitStrings.d.ts +51 -0
  183. package/dist/types/Services/UpdateComposition.d.ts +125 -0
  184. package/dist/types/Services/User/UserTranslation.d.ts +108 -0
  185. package/dist/types/Services/View/ViewInternalData.d.ts +33 -0
  186. package/dist/types/WrapperFunctions/SchemaQueryObservable.d.ts +159 -0
  187. package/dist/types/app.d.ts +162 -0
  188. package/package.json +1 -1
@@ -0,0 +1,217 @@
1
+ /**
2
+ * @fileoverview Local Node data structure for binary tree operations.
3
+ * This module defines the LNode class which represents a node in an AVL
4
+ * (self-balancing) binary tree for storing and managing LConcept instances.
5
+ * @module DataStructures/Local/LNode
6
+ */
7
+ import { LConcept } from "./LConcept";
8
+ /**
9
+ * Represents a node in an AVL binary tree for local concepts.
10
+ * This class implements self-balancing tree operations including rotations,
11
+ * insertions, deletions, and lookups for efficient concept management.
12
+ *
13
+ * @class LNode
14
+ * @export
15
+ */
16
+ export declare class LNode {
17
+ /**
18
+ * The key used for tree ordering (can be number or string).
19
+ * @type {any}
20
+ */
21
+ key: any;
22
+ /**
23
+ * The concept value stored in this node.
24
+ * @type {LConcept}
25
+ */
26
+ value: LConcept;
27
+ /**
28
+ * Reference to the left child node.
29
+ * @type {LNode | null}
30
+ */
31
+ leftNode: LNode | null;
32
+ /**
33
+ * Reference to the right child node.
34
+ * @type {LNode | null}
35
+ */
36
+ rightNode: LNode | null;
37
+ /**
38
+ * Reference to current node for linking nodes with same key.
39
+ * @type {LNode | null}
40
+ */
41
+ currentNode: LNode | null;
42
+ /**
43
+ * Array of variant nodes with same key but different properties.
44
+ * @type {LNode[]}
45
+ * @default []
46
+ */
47
+ variants: LNode[];
48
+ /**
49
+ * Height of the node in the tree for AVL balancing.
50
+ * @type {number}
51
+ * @default 1
52
+ */
53
+ height: number;
54
+ /**
55
+ * Creates a new LNode instance.
56
+ *
57
+ * @constructor
58
+ * @param {any} key - The key used for tree ordering
59
+ * @param {LConcept} value - The concept value to store
60
+ * @param {LNode | null} leftNode - Reference to left child
61
+ * @param {LNode | null} rightNode - Reference to right child
62
+ */
63
+ constructor(key: any, value: LConcept, leftNode: LNode | null, rightNode: LNode | null);
64
+ /**
65
+ * Adds a current node to the chain based on typeId.
66
+ * This method links nodes with different typeIds.
67
+ *
68
+ * @method addCurrentNode
69
+ * @param {LNode} passedNode - The node to add
70
+ * @param {LNode | null} node - The current node in the chain
71
+ * @returns {LNode | null} The updated node chain
72
+ */
73
+ addCurrentNode(passedNode: LNode, node: LNode | null): LNode;
74
+ /**
75
+ * Adds a node as a variant if it has the same key but different id.
76
+ * This method manages variants (nodes with same key but different properties).
77
+ *
78
+ * @method addCurrentNodeType
79
+ * @param {LNode} passedNode - The node to add as variant
80
+ * @param {LNode | null} node - The current node
81
+ * @returns {LNode | null} The updated node
82
+ */
83
+ addCurrentNodeType(passedNode: LNode, node: LNode | null): LNode;
84
+ /**
85
+ * Adds a node to the AVL tree with automatic balancing.
86
+ * This method performs standard AVL insertion with rotations.
87
+ *
88
+ * @method addNode
89
+ * @param {LNode} passedNode - The node to insert
90
+ * @param {LNode | null} node - The current node in traversal
91
+ * @param {number} height - Current height for balancing
92
+ * @returns {LNode | null} The root of the updated subtree
93
+ */
94
+ addNode(passedNode: LNode, node: LNode | null, height: number): LNode | null;
95
+ /**
96
+ * Adds a character node to the tree with variant management.
97
+ * Handles nodes with character keys and manages variants for duplicate keys.
98
+ *
99
+ * @method addCharacterNode
100
+ * @param {LNode} passedNode - The node to insert
101
+ * @param {LNode | null} node - The current node in traversal
102
+ * @param {number} height - Current height for balancing
103
+ * @returns {LNode | null} The root of the updated subtree
104
+ */
105
+ addCharacterNode(passedNode: LNode, node: LNode | null, height: number): LNode | null;
106
+ /**
107
+ * Adds a type node to the tree with variant management.
108
+ * Handles nodes with typeId keys and manages variants for duplicate typeIds.
109
+ *
110
+ * @method addTypeNode
111
+ * @param {LNode} passedNode - The node to insert
112
+ * @param {LNode | null} node - The current node in traversal
113
+ * @param {number} height - Current height for balancing
114
+ * @returns {LNode | null} The root of the updated subtree
115
+ */
116
+ addTypeNode(passedNode: LNode, node: LNode | null, height: number): LNode | null;
117
+ /**
118
+ * Performs a right rotation for AVL tree balancing.
119
+ *
120
+ * @method rightRotate
121
+ * @param {LNode | null} y - The node to rotate
122
+ * @returns {LNode | null} The new root of the rotated subtree
123
+ */
124
+ rightRotate(y: LNode | null): LNode | null;
125
+ /**
126
+ * Performs a left rotation for AVL tree balancing.
127
+ *
128
+ * @method leftRotate
129
+ * @param {LNode | null} x - The node to rotate
130
+ * @returns {LNode | null} The new root of the rotated subtree
131
+ */
132
+ leftRotate(x: LNode | null): LNode | null;
133
+ /**
134
+ * Gets the height of a node.
135
+ *
136
+ * @method getHeight
137
+ * @param {LNode | null} node - The node to get height from
138
+ * @returns {number} The height of the node, or 0 if null
139
+ */
140
+ getHeight(node: LNode | null): number;
141
+ /**
142
+ * Calculates the balance factor of a node.
143
+ * Balance factor = height(left subtree) - height(right subtree)
144
+ *
145
+ * @method getBalanceFactor
146
+ * @param {LNode | null} N - The node to calculate balance factor for
147
+ * @returns {number} The balance factor (-2, -1, 0, 1, or 2)
148
+ */
149
+ getBalanceFactor(N: LNode | null): number;
150
+ /**
151
+ * Searches for a node by numeric id.
152
+ *
153
+ * @method getFromNode
154
+ * @param {number} id - The id to search for
155
+ * @param {LNode | null} node - The current node in traversal
156
+ * @returns {LNode | null} The found node or null
157
+ */
158
+ getFromNode(id: number, node: LNode | null): LNode | null;
159
+ /**
160
+ * Searches for a node by character value.
161
+ *
162
+ * @method getCharacterFromNode
163
+ * @param {string} value - The character value to search for
164
+ * @param {LNode | null} node - The current node in traversal
165
+ * @returns {LNode | null} The found node or null
166
+ */
167
+ getCharacterFromNode(value: string, node: LNode | null): LNode | null;
168
+ /**
169
+ * Searches for a node by both character value and type id.
170
+ * This method also searches through variants to find exact matches.
171
+ *
172
+ * @method getFromNodeWithCharacterAndType
173
+ * @param {string} value - The character value to search for
174
+ * @param {number} typeId - The type identifier to match
175
+ * @param {LNode | null} node - The current node in traversal
176
+ * @returns {LNode | null} The found node or null
177
+ */
178
+ getFromNodeWithCharacterAndType(value: string, typeId: number, node: LNode | null): LNode | null;
179
+ /**
180
+ * Removes a node from the tree by id.
181
+ * Uses standard BST deletion with in-order successor replacement.
182
+ *
183
+ * @method removeNode
184
+ * @param {LNode | null} passedNode - The current node in traversal
185
+ * @param {number} id - The id of the node to remove
186
+ * @returns {LNode | null} The root of the updated subtree
187
+ */
188
+ removeNode(passedNode: LNode | null, id: number): LNode | null;
189
+ /**
190
+ * Removes a node with variant management.
191
+ * If the node has variants, replaces the removed node with first variant.
192
+ *
193
+ * @method removeNodeWithVariants
194
+ * @param {LNode | null} passedNode - The current node in traversal
195
+ * @param {any} typeIdentifier - The type identifier (key) to search for
196
+ * @param {number} conceptId - The concept id to remove
197
+ * @returns {LNode | null} The root of the updated subtree
198
+ */
199
+ removeNodeWithVariants(passedNode: LNode | null, typeIdentifier: any, conceptId: number): LNode | null;
200
+ /**
201
+ * Counts the total number of nodes in the subtree.
202
+ *
203
+ * @method countNodeBelow
204
+ * @param {LNode | null} root - The root of the subtree
205
+ * @returns {number} The total count of nodes
206
+ */
207
+ countNodeBelow(root: LNode | null): number;
208
+ /**
209
+ * Finds the in-order successor (leftmost node in right subtree).
210
+ * Used during node deletion.
211
+ *
212
+ * @method inOrderSuccessor
213
+ * @param {LNode} root - The root to find successor from
214
+ * @returns {LNode} The in-order successor node
215
+ */
216
+ inOrderSuccessor(root: LNode): LNode;
217
+ }
@@ -0,0 +1,145 @@
1
+ /**
2
+ * @fileoverview Local Binary Character Tree for managing concepts indexed by character value.
3
+ * This module provides a specialized binary tree implementation for efficient character-based lookups.
4
+ * @module DataStructures/Local/LocalBinaryCharacterTree
5
+ */
6
+ import { LConcept } from "../../DataStructures/Local/LConcept";
7
+ import { LNode } from "./../Local/LNode";
8
+ /**
9
+ * Binary tree data structure for managing local concepts indexed by character values.
10
+ *
11
+ * @remarks
12
+ * This class implements an AVL tree specifically optimized for character-based lookups.
13
+ * Unlike LocalBinaryTree which uses numeric IDs, this tree uses character values as keys,
14
+ * enabling efficient string-based searches with O(log n) complexity.
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * const concept = new LConcept(123, "example", 1);
19
+ * LocalBinaryCharacterTree.addConceptToTree(concept);
20
+ * const node = LocalBinaryCharacterTree.getNodeFromTree("example");
21
+ * ```
22
+ */
23
+ export declare class LocalBinaryCharacterTree {
24
+ /**
25
+ * The root node of the character-indexed binary tree.
26
+ * Null if the tree is empty.
27
+ */
28
+ static LocalCharacterRoot: LNode | null;
29
+ /**
30
+ * Waits for local character data to be loaded into the tree.
31
+ *
32
+ * @returns A promise that resolves with "done" when data is loaded, or rejects with "not" after 25 seconds
33
+ *
34
+ * @remarks
35
+ * This method polls the IdentifierFlags.isLocalCharacterLoaded flag every second.
36
+ * Useful for ensuring data is ready before performing operations on the tree.
37
+ *
38
+ * @example
39
+ * ```typescript
40
+ * try {
41
+ * await LocalBinaryCharacterTree.waitForDataToLoad();
42
+ * console.log("Character data loaded");
43
+ * } catch (error) {
44
+ * console.log("Loading timed out");
45
+ * }
46
+ * ```
47
+ */
48
+ static waitForDataToLoad(): Promise<unknown>;
49
+ /**
50
+ * Periodically checks if local character data has been loaded.
51
+ *
52
+ * @param resolve - The promise resolve function to call when data is loaded
53
+ *
54
+ * @remarks
55
+ * This method recursively checks the IdentifierFlags.isLocalCharacterLoaded flag every 1000ms.
56
+ */
57
+ static checkFlag(resolve: any): any;
58
+ /**
59
+ * Adds a node to the character-indexed binary tree.
60
+ *
61
+ * @param node - The LNode to be added to the tree (keyed by character value)
62
+ * @returns The root node after insertion
63
+ *
64
+ * @remarks
65
+ * If the tree is empty, the provided node becomes the root.
66
+ * Otherwise, uses the addCharacterNode method for character-based insertion.
67
+ *
68
+ * @example
69
+ * ```typescript
70
+ * const node = new LNode("example", concept, null, null);
71
+ * await LocalBinaryCharacterTree.addNodeToTree(node);
72
+ * ```
73
+ */
74
+ static addNodeToTree(node: LNode): Promise<LNode | null>;
75
+ /**
76
+ * Creates a node from a concept and adds it to the character tree.
77
+ *
78
+ * @param concept - The LConcept object to be added to the tree
79
+ *
80
+ * @remarks
81
+ * Only adds the concept if it has a non-empty characterValue.
82
+ * The node is keyed by the concept's character value.
83
+ *
84
+ * @example
85
+ * ```typescript
86
+ * const concept = new LConcept(123, "example", 1);
87
+ * LocalBinaryCharacterTree.addConceptToTree(concept);
88
+ * ```
89
+ */
90
+ static addConceptToTree(concept: LConcept): void;
91
+ /**
92
+ * Retrieves a node from the tree by its character value.
93
+ *
94
+ * @param value - The character string to search for
95
+ * @returns The LNode if found, the root node otherwise
96
+ *
97
+ * @remarks
98
+ * Performs a binary search through the tree using the character value as the key.
99
+ *
100
+ * @example
101
+ * ```typescript
102
+ * const node = LocalBinaryCharacterTree.getNodeFromTree("example");
103
+ * if (node) {
104
+ * console.log("Found concept:", node.value);
105
+ * }
106
+ * ```
107
+ */
108
+ static getNodeFromTree(value: string): LNode | null;
109
+ /**
110
+ * Retrieves a node by matching both character value and type ID.
111
+ *
112
+ * @param value - The character value to search for
113
+ * @param typeId - The type ID to match
114
+ * @returns The matching LNode if found, the root node otherwise
115
+ *
116
+ * @remarks
117
+ * This method searches for a node that matches both the character value and type ID,
118
+ * useful for finding specific concept variants.
119
+ *
120
+ * @example
121
+ * ```typescript
122
+ * const node = await LocalBinaryCharacterTree.getCharacterAndTypeFromTree("example", 5);
123
+ * if (node) {
124
+ * console.log("Found matching concept:", node.value);
125
+ * }
126
+ * ```
127
+ */
128
+ static getCharacterAndTypeFromTree(value: string, typeId: number): Promise<LNode | null>;
129
+ /**
130
+ * Removes a concept variant from the tree.
131
+ *
132
+ * @param character - The character value identifying the node
133
+ * @param id - The concept ID to remove
134
+ *
135
+ * @remarks
136
+ * This method removes a specific variant from a node while maintaining other variants.
137
+ * If the node has no remaining variants, the entire node is removed.
138
+ *
139
+ * @example
140
+ * ```typescript
141
+ * LocalBinaryCharacterTree.removeConceptType("example", 123);
142
+ * ```
143
+ */
144
+ static removeConceptType(character: string, id: number): void;
145
+ }
@@ -0,0 +1,147 @@
1
+ /**
2
+ * @fileoverview Local Binary Tree data structure for managing local concepts.
3
+ * This module provides a binary tree implementation for storing and retrieving LConcept objects
4
+ * using an AVL tree structure for balanced performance.
5
+ * @module DataStructures/Local/LocalBinaryTree
6
+ */
7
+ import { LConcept } from "../../DataStructures/Local/LConcept";
8
+ import { LNode } from "./../Local/LNode";
9
+ /**
10
+ * Binary tree data structure for managing local concepts with efficient lookup by ID.
11
+ *
12
+ * @remarks
13
+ * This class implements a self-balancing binary search tree (AVL tree) for storing local concepts.
14
+ * It provides O(log n) search, insertion, and deletion operations. The tree is keyed by concept ID
15
+ * and supports asynchronous data loading with timeout capabilities.
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * const concept = new LConcept(123, "example", 1);
20
+ * LocalBinaryTree.addConceptToTree(concept);
21
+ * const node = await LocalBinaryTree.getNodeFromTree(123);
22
+ * ```
23
+ */
24
+ export declare class LocalBinaryTree {
25
+ /**
26
+ * The root node of the binary tree.
27
+ * Null if the tree is empty.
28
+ */
29
+ static root: LNode | null;
30
+ /**
31
+ * Adds a node to the binary tree.
32
+ *
33
+ * @param node - The LNode to be added to the tree
34
+ * @returns The root node after insertion
35
+ *
36
+ * @remarks
37
+ * If the tree is empty, the provided node becomes the root.
38
+ * Otherwise, the node is inserted at the appropriate position using the AVL tree algorithm.
39
+ *
40
+ * @example
41
+ * ```typescript
42
+ * const node = new LNode(123, concept, null, null);
43
+ * LocalBinaryTree.addNodeToTree(node);
44
+ * ```
45
+ */
46
+ static addNodeToTree(node: LNode): LNode | undefined;
47
+ /**
48
+ * Creates a node from a concept and adds it to the tree.
49
+ *
50
+ * @param concept - The LConcept object to be added to the tree
51
+ *
52
+ * @remarks
53
+ * This is a convenience method that creates an LNode from the concept and adds it to the tree.
54
+ * The node is keyed by the concept's ID.
55
+ *
56
+ * @example
57
+ * ```typescript
58
+ * const concept = new LConcept(123, "example", 1);
59
+ * LocalBinaryTree.addConceptToTree(concept);
60
+ * ```
61
+ */
62
+ static addConceptToTree(concept: LConcept): void;
63
+ /**
64
+ * Waits for local data to be loaded into the tree.
65
+ *
66
+ * @returns A promise that resolves with "done" when data is loaded, or rejects with "not" after 25 seconds
67
+ *
68
+ * @remarks
69
+ * This method polls the IdentifierFlags.isLocalDataLoaded flag every second until it's true.
70
+ * If data isn't loaded within 25 seconds, the promise is rejected.
71
+ *
72
+ * @example
73
+ * ```typescript
74
+ * try {
75
+ * await LocalBinaryTree.waitForDataToLoad();
76
+ * console.log("Data loaded successfully");
77
+ * } catch (error) {
78
+ * console.log("Data loading timed out");
79
+ * }
80
+ * ```
81
+ */
82
+ static waitForDataToLoad(): Promise<unknown>;
83
+ /**
84
+ * Periodically checks if local data has been loaded.
85
+ *
86
+ * @param resolve - The promise resolve function to call when data is loaded
87
+ *
88
+ * @remarks
89
+ * This method is called recursively every 1000ms until the data is loaded.
90
+ * It checks the IdentifierFlags.isLocalDataLoaded flag.
91
+ */
92
+ static checkFlag(resolve: any): any;
93
+ /**
94
+ * Retrieves a node from the tree by its ID.
95
+ *
96
+ * @param id - The numeric ID of the node to retrieve
97
+ * @returns The LNode if found, null otherwise
98
+ *
99
+ * @remarks
100
+ * This method performs a binary search through the tree using the concept ID as the key.
101
+ * The search has O(log n) time complexity in a balanced tree.
102
+ *
103
+ * @example
104
+ * ```typescript
105
+ * const node = await LocalBinaryTree.getNodeFromTree(123);
106
+ * if (node) {
107
+ * console.log("Found concept:", node.value);
108
+ * }
109
+ * ```
110
+ */
111
+ static getNodeFromTree(id: number): Promise<LNode | null>;
112
+ /**
113
+ * Retrieves a node by matching both character value and type ID.
114
+ *
115
+ * @param value - The character value to search for
116
+ * @param typeId - The type ID to match
117
+ * @returns The matching LNode if found, the root node otherwise
118
+ *
119
+ * @remarks
120
+ * This method searches for a node that matches both the character value and type ID.
121
+ * It's useful for finding specific concept variants.
122
+ *
123
+ * @example
124
+ * ```typescript
125
+ * const node = LocalBinaryTree.getCharacterAndTypeFromTree("example", 5);
126
+ * if (node) {
127
+ * console.log("Found matching concept:", node.value);
128
+ * }
129
+ * ```
130
+ */
131
+ static getCharacterAndTypeFromTree(value: string, typeId: number): LNode | null;
132
+ /**
133
+ * Removes a node from the tree by its ID.
134
+ *
135
+ * @param id - The numeric ID of the node to remove
136
+ *
137
+ * @remarks
138
+ * This method removes a node from the tree while maintaining the AVL tree balance.
139
+ * The tree is automatically rebalanced after removal.
140
+ *
141
+ * @example
142
+ * ```typescript
143
+ * await LocalBinaryTree.removeNodeFromTree(123);
144
+ * ```
145
+ */
146
+ static removeNodeFromTree(id: number): Promise<void>;
147
+ }
@@ -0,0 +1,160 @@
1
+ /**
2
+ * @fileoverview Local Binary Type Tree for managing concepts indexed by type ID.
3
+ * This module provides a specialized binary tree for efficient type-based concept lookups and variant retrieval.
4
+ * @module DataStructures/Local/LocalBinaryTypeTree
5
+ */
6
+ import { LConcept } from "../../DataStructures/Local/LConcept";
7
+ import { LNode } from "./LNode";
8
+ /**
9
+ * Binary tree data structure for managing local concepts indexed by type ID.
10
+ *
11
+ * @remarks
12
+ * This class implements an AVL tree optimized for type-based lookups, enabling efficient
13
+ * retrieval of all concepts of a specific type. It supports variant management, allowing
14
+ * multiple concepts to share the same type while being stored efficiently.
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * const concept = new LConcept(123, "example", 5);
19
+ * LocalBinaryTypeTree.addConceptToTree(concept);
20
+ * const variants = LocalBinaryTypeTree.getTypeVariantsFromTree(5);
21
+ * ```
22
+ */
23
+ export declare class LocalBinaryTypeTree {
24
+ /**
25
+ * The root node of the type-indexed binary tree.
26
+ * Null if the tree is empty.
27
+ */
28
+ static LocalTypeRoot: LNode | null;
29
+ /**
30
+ * Adds a node to the type-indexed binary tree.
31
+ *
32
+ * @param node - The LNode to be added to the tree (keyed by type ID)
33
+ * @returns The root node after insertion
34
+ *
35
+ * @remarks
36
+ * If the tree is empty, the provided node becomes the root.
37
+ * Otherwise, uses the addTypeNode method for type-based insertion with variant support.
38
+ *
39
+ * @example
40
+ * ```typescript
41
+ * const node = new LNode(5, concept, null, null);
42
+ * await LocalBinaryTypeTree.addNodeToTree(node);
43
+ * ```
44
+ */
45
+ static addNodeToTree(node: LNode): Promise<LNode | null>;
46
+ /**
47
+ * Creates a node from a concept and adds it to the type tree.
48
+ *
49
+ * @param concept - The LConcept object to be added to the tree
50
+ *
51
+ * @remarks
52
+ * Only adds the concept if it has a non-zero typeId.
53
+ * The node is keyed by the concept's type ID.
54
+ *
55
+ * @example
56
+ * ```typescript
57
+ * const concept = new LConcept(123, "example", 5);
58
+ * LocalBinaryTypeTree.addConceptToTree(concept);
59
+ * ```
60
+ */
61
+ static addConceptToTree(concept: LConcept): void;
62
+ /**
63
+ * Removes a specific concept variant from the tree.
64
+ *
65
+ * @param typeId - The type ID identifying the node
66
+ * @param id - The concept ID to remove
67
+ *
68
+ * @remarks
69
+ * This method removes a specific variant from a node while maintaining other variants.
70
+ * If the node has no remaining variants, the entire node is removed.
71
+ *
72
+ * @example
73
+ * ```typescript
74
+ * LocalBinaryTypeTree.removeConceptType(5, 123);
75
+ * ```
76
+ */
77
+ static removeConceptType(typeId: number, id: number): void;
78
+ /**
79
+ * Retrieves a node from the tree by its type ID.
80
+ *
81
+ * @param id - The numeric type ID to search for
82
+ * @returns The LNode if found, the root node otherwise
83
+ *
84
+ * @remarks
85
+ * Performs a binary search through the tree using the type ID as the key.
86
+ *
87
+ * @example
88
+ * ```typescript
89
+ * const node = LocalBinaryTypeTree.getNodeFromTree(5);
90
+ * if (node) {
91
+ * console.log("Found type node with variants:", node.variants.length);
92
+ * }
93
+ * ```
94
+ */
95
+ static getNodeFromTree(id: number): LNode | null;
96
+ /**
97
+ * Retrieves all concept variants for a specific type ID.
98
+ *
99
+ * @param typeId - The type ID to search for
100
+ * @returns An array of LConcept objects of the specified type
101
+ *
102
+ * @remarks
103
+ * This method retrieves the primary concept and all its variants that share the same type ID.
104
+ * Useful for getting all concepts of a particular type in one operation.
105
+ *
106
+ * @example
107
+ * ```typescript
108
+ * const concepts = LocalBinaryTypeTree.getTypeVariantsFromTree(5);
109
+ * console.log(`Found ${concepts.length} concepts of type 5`);
110
+ * ```
111
+ */
112
+ static getTypeVariantsFromTree(typeId: number): LConcept[] | undefined;
113
+ /**
114
+ * Waits for local type data to be loaded into the tree.
115
+ *
116
+ * @returns A promise that resolves with "done" when data is loaded, or rejects with "not" after 25 seconds
117
+ *
118
+ * @remarks
119
+ * This method polls the IdentifierFlags.isLocalTypeLoaded flag every second.
120
+ * Ensures type data is ready before performing operations.
121
+ *
122
+ * @example
123
+ * ```typescript
124
+ * try {
125
+ * await LocalBinaryTypeTree.waitForDataToLoad();
126
+ * console.log("Type data loaded");
127
+ * } catch (error) {
128
+ * console.log("Loading timed out");
129
+ * }
130
+ * ```
131
+ */
132
+ static waitForDataToLoad(): Promise<unknown>;
133
+ /**
134
+ * Periodically checks if local type data has been loaded.
135
+ *
136
+ * @param resolve - The promise resolve function to call when data is loaded
137
+ *
138
+ * @remarks
139
+ * This method recursively checks the IdentifierFlags.isLocalTypeLoaded flag every 1000ms.
140
+ */
141
+ static checkFlag(resolve: any): any;
142
+ /**
143
+ * Retrieves all concept variants for a specific type ID filtered by user ID.
144
+ *
145
+ * @param typeId - The type ID to search for
146
+ * @param userId - The user ID to filter by
147
+ * @returns An array of LConcept objects of the specified type belonging to the specified user
148
+ *
149
+ * @remarks
150
+ * This method retrieves all concepts of a given type that belong to a specific user.
151
+ * Useful for user-specific concept management and filtering.
152
+ *
153
+ * @example
154
+ * ```typescript
155
+ * const userConcepts = await LocalBinaryTypeTree.getTypeVariantsFromTreeWithUserId(5, 42);
156
+ * console.log(`Found ${userConcepts.length} concepts of type 5 for user 42`);
157
+ * ```
158
+ */
159
+ static getTypeVariantsFromTreeWithUserId(typeId: number, userId: number): Promise<LConcept[]>;
160
+ }