mftsccs-node 0.0.57 → 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 (180) hide show
  1. package/README.md +1148 -11
  2. package/dist/types/Api/Create/CreateTheCharacter.d.ts +42 -0
  3. package/dist/types/Api/Create/CreateTheConceptApi.d.ts +50 -0
  4. package/dist/types/Api/Create/CreateTheConnectionApi.d.ts +51 -0
  5. package/dist/types/Api/Create/CreateTheTextData.d.ts +56 -0
  6. package/dist/types/Api/Delete/DeleteConceptInBackend.d.ts +43 -0
  7. package/dist/types/Api/DeleteConnectionApiBulk.d.ts +55 -0
  8. package/dist/types/Api/DeleteTheConcept.d.ts +64 -0
  9. package/dist/types/Api/DeleteTheConnection.d.ts +76 -0
  10. package/dist/types/Api/GetAiData.d.ts +36 -0
  11. package/dist/types/Api/GetAllConcepts.d.ts +42 -0
  12. package/dist/types/Api/GetAllConceptsByType.d.ts +45 -0
  13. package/dist/types/Api/GetAllConnections.d.ts +48 -0
  14. package/dist/types/Api/GetAllConnectionsOfComposition.d.ts +79 -0
  15. package/dist/types/Api/GetAllConnectionsOfCompositionBulk.d.ts +90 -0
  16. package/dist/types/Api/GetAllLinkerConnectionsFromTheConcept.d.ts +52 -0
  17. package/dist/types/Api/GetAllLinkerConnectionsToTheConcept.d.ts +61 -0
  18. package/dist/types/Api/GetAllPrefetchConnections.d.ts +51 -0
  19. package/dist/types/Api/GetCharacterDataByCharacter.d.ts +31 -0
  20. package/dist/types/Api/GetCompositionConnectionsBetweenTwoConcepts.d.ts +39 -0
  21. package/dist/types/Api/GetConcept.d.ts +47 -0
  22. package/dist/types/Api/GetConceptBulk.d.ts +68 -0
  23. package/dist/types/Api/GetConceptByCharacterAndType.d.ts +75 -0
  24. package/dist/types/Api/GetConceptByCharacterValue.d.ts +47 -0
  25. package/dist/types/Api/GetConnection.d.ts +49 -0
  26. package/dist/types/Api/GetConnectionBulk.d.ts +46 -0
  27. package/dist/types/Api/GetConnectionOfTheConcept.d.ts +50 -0
  28. package/dist/types/Api/GetConnectionToTheConcept.d.ts +56 -0
  29. package/dist/types/Api/GetReservedConnectionIds.d.ts +36 -0
  30. package/dist/types/Api/GetReservedIds.d.ts +37 -0
  31. package/dist/types/Api/Login.d.ts +38 -0
  32. package/dist/types/Api/MakeTheNameInBackend.d.ts +39 -0
  33. package/dist/types/Api/MakeTheTypeConceptApi.d.ts +40 -0
  34. package/dist/types/Api/RecursiveSearch.d.ts +43 -0
  35. package/dist/types/Api/Search/FreeschemaQueryApi.d.ts +46 -0
  36. package/dist/types/Api/Search/Search.d.ts +67 -0
  37. package/dist/types/Api/Search/SearchInternalApi.d.ts +69 -0
  38. package/dist/types/Api/Search/SearchLinkMultipleApi.d.ts +90 -0
  39. package/dist/types/Api/Search/SearchWithLinker.d.ts +97 -0
  40. package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryApi.d.ts +39 -0
  41. package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryDirect.d.ts +47 -0
  42. package/dist/types/Api/Session/CreateSession.d.ts +45 -0
  43. package/dist/types/Api/Session/CreateSessionVisit.d.ts +43 -0
  44. package/dist/types/Api/Signin.d.ts +48 -0
  45. package/dist/types/Api/Signup.d.ts +44 -0
  46. package/dist/types/Api/View/ViewInternalDataApi.d.ts +50 -0
  47. package/dist/types/Constants/ApiConstants.d.ts +226 -0
  48. package/dist/types/Constants/FormatConstants.d.ts +80 -0
  49. package/dist/types/DataStructures/BaseUrl.d.ts +210 -0
  50. package/dist/types/DataStructures/BinaryCharacterTree.d.ts +211 -0
  51. package/dist/types/DataStructures/BinaryTree.d.ts +139 -0
  52. package/dist/types/DataStructures/BinaryTypeTree.d.ts +196 -0
  53. package/dist/types/DataStructures/CharacterRepository.d.ts +109 -0
  54. package/dist/types/DataStructures/Composition/Composition.d.ts +103 -0
  55. package/dist/types/DataStructures/Composition/CompositionBinaryTree.d.ts +104 -0
  56. package/dist/types/DataStructures/Composition/CompositionNode.d.ts +202 -0
  57. package/dist/types/DataStructures/Concept.d.ts +110 -0
  58. package/dist/types/DataStructures/ConceptData.d.ts +292 -0
  59. package/dist/types/DataStructures/ConceptsToDraw.d.ts +168 -0
  60. package/dist/types/DataStructures/Connection.d.ts +76 -0
  61. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionBinaryTree.d.ts +115 -0
  62. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionNode.d.ts +169 -0
  63. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionTypeTree.d.ts +82 -0
  64. package/dist/types/DataStructures/ConnectionData.d.ts +191 -0
  65. package/dist/types/DataStructures/Count/CountInfo.d.ts +73 -0
  66. package/dist/types/DataStructures/FilterSearch.d.ts +84 -0
  67. package/dist/types/DataStructures/IdentifierFlags.d.ts +34 -0
  68. package/dist/types/DataStructures/Local/LConcept.d.ts +105 -0
  69. package/dist/types/DataStructures/Local/LConnection.d.ts +83 -0
  70. package/dist/types/DataStructures/Local/LNode.d.ts +190 -0
  71. package/dist/types/DataStructures/Local/LocalBinaryCharacterTree.d.ts +133 -0
  72. package/dist/types/DataStructures/Local/LocalBinaryTree.d.ts +135 -0
  73. package/dist/types/DataStructures/Local/LocalBinaryTypeTree.d.ts +147 -0
  74. package/dist/types/DataStructures/Local/LocalConceptData.d.ts +100 -0
  75. package/dist/types/DataStructures/Local/LocalConnectionData.d.ts +109 -0
  76. package/dist/types/DataStructures/Local/LocalSyncData.d.ts +89 -0
  77. package/dist/types/DataStructures/PatcherStructure.d.ts +86 -0
  78. package/dist/types/DataStructures/ReferentInfo.d.ts +68 -0
  79. package/dist/types/DataStructures/ReservedIds.d.ts +101 -0
  80. package/dist/types/DataStructures/Responses/ErrorResponse.d.ts +184 -22
  81. package/dist/types/DataStructures/Responses/StandardResponses.d.ts +65 -0
  82. package/dist/types/DataStructures/Returner.d.ts +59 -0
  83. package/dist/types/DataStructures/Search/FreeschemaQuery.d.ts +165 -0
  84. package/dist/types/DataStructures/Search/SearchStructure.d.ts +69 -0
  85. package/dist/types/DataStructures/SearchQuery.d.ts +130 -0
  86. package/dist/types/DataStructures/Security/TokenStorage.d.ts +48 -0
  87. package/dist/types/DataStructures/Session/SessionData.d.ts +118 -0
  88. package/dist/types/DataStructures/SettingData.d.ts +32 -0
  89. package/dist/types/DataStructures/Settings.d.ts +27 -0
  90. package/dist/types/DataStructures/SigninModel.d.ts +50 -0
  91. package/dist/types/DataStructures/SignupModel.d.ts +50 -0
  92. package/dist/types/DataStructures/SyncData.d.ts +206 -0
  93. package/dist/types/DataStructures/TheCharacter.d.ts +87 -0
  94. package/dist/types/DataStructures/TheTexts.d.ts +92 -0
  95. package/dist/types/DataStructures/Transaction/Transaction.d.ts +294 -4
  96. package/dist/types/DataStructures/User/UserBinaryTree.d.ts +117 -0
  97. package/dist/types/DataStructures/User/UserNode.d.ts +130 -0
  98. package/dist/types/Database/GetConceptFromIndexDb.d.ts +9 -0
  99. package/dist/types/Database/NoIndexDb.d.ts +169 -0
  100. package/dist/types/Database/indexdblocal.d.ts +42 -0
  101. package/dist/types/Database/indexeddb.d.ts +43 -0
  102. package/dist/types/Drawing/ConceptDraw.d.ts +28 -0
  103. package/dist/types/Drawing/ConceptEvents.d.ts +46 -0
  104. package/dist/types/Helpers/CheckIfExists.d.ts +159 -0
  105. package/dist/types/Helpers/RemoveFromArray.d.ts +66 -0
  106. package/dist/types/Helpers/UniqueInsert.d.ts +28 -0
  107. package/dist/types/Services/CheckForConnectionDeletion.d.ts +190 -0
  108. package/dist/types/Services/Common/DecodeCountInfo.d.ts +54 -0
  109. package/dist/types/Services/Common/ErrorPosting.d.ts +49 -0
  110. package/dist/types/Services/Common/RegexFunction.d.ts +28 -0
  111. package/dist/types/Services/Composition/BuildComposition.d.ts +37 -0
  112. package/dist/types/Services/Composition/CompositionCache.d.ts +89 -0
  113. package/dist/types/Services/Composition/CreateCompositionCache.d.ts +43 -0
  114. package/dist/types/Services/Conversion/ConvertConcepts.d.ts +83 -0
  115. package/dist/types/Services/CreateBinaryTreeFromData.d.ts +38 -0
  116. package/dist/types/Services/CreateCharacterBinaryTreeFromData.d.ts +42 -0
  117. package/dist/types/Services/CreateConnectionBetweenTwoConcepts.d.ts +206 -0
  118. package/dist/types/Services/CreateDefaultConcept.d.ts +114 -0
  119. package/dist/types/Services/CreateTheComposition.d.ts +101 -0
  120. package/dist/types/Services/CreateTheConcept.d.ts +179 -0
  121. package/dist/types/Services/CreateTheConnection.d.ts +59 -0
  122. package/dist/types/Services/CreateTheConnectionGeneral.d.ts +127 -0
  123. package/dist/types/Services/CreateTypeTreeFromData.d.ts +43 -0
  124. package/dist/types/Services/Delete/DeleteConnectionByType.d.ts +52 -5
  125. package/dist/types/Services/Delete/GetAllConnectionByType.d.ts +57 -9
  126. package/dist/types/Services/DeleteConcept.d.ts +136 -0
  127. package/dist/types/Services/DeleteConnection.d.ts +194 -0
  128. package/dist/types/Services/FindConeceptsFromConnection.d.ts +179 -0
  129. package/dist/types/Services/FindConnectionsOfCompositionBulkInMemory.d.ts +157 -0
  130. package/dist/types/Services/GenerateHexNumber.d.ts +64 -0
  131. package/dist/types/Services/GetComposition.d.ts +331 -0
  132. package/dist/types/Services/GetCompositionBulk.d.ts +251 -3
  133. package/dist/types/Services/GetCompositionList.d.ts +130 -0
  134. package/dist/types/Services/GetConceptByCharacter.d.ts +84 -0
  135. package/dist/types/Services/GetConnections.d.ts +72 -0
  136. package/dist/types/Services/GetDataFromIndexDb.d.ts +79 -0
  137. package/dist/types/Services/GetLink.d.ts +104 -0
  138. package/dist/types/Services/GetLinkerConnectionFromConcept.d.ts +99 -0
  139. package/dist/types/Services/GetMaximumConnectionSyncTime.d.ts +57 -0
  140. package/dist/types/Services/GetRelation.d.ts +162 -0
  141. package/dist/types/Services/GetTheConcept.d.ts +71 -0
  142. package/dist/types/Services/GetTheReferent.d.ts +74 -0
  143. package/dist/types/Services/InitializeSystem.d.ts +119 -0
  144. package/dist/types/Services/Local/CreateDefaultLConcept.d.ts +48 -0
  145. package/dist/types/Services/Local/CreateLocalBinaryTreeFromData.d.ts +49 -0
  146. package/dist/types/Services/Local/CreateLocalBinaryTypeTreeFromData.d.ts +54 -0
  147. package/dist/types/Services/Local/CreateLocalCharacterBinaryTree.d.ts +60 -0
  148. package/dist/types/Services/Local/CreateTheCompositionLocal.d.ts +70 -0
  149. package/dist/types/Services/Local/CreateTheConceptLocal.d.ts +58 -0
  150. package/dist/types/Services/Local/CreateTheConnectionLocal.d.ts +56 -0
  151. package/dist/types/Services/Local/GetCompositionListLocal.d.ts +103 -0
  152. package/dist/types/Services/Local/GetCompositionLocal.d.ts +96 -0
  153. package/dist/types/Services/Local/GetConceptByCharacterLocal.d.ts +57 -0
  154. package/dist/types/Services/Local/MakeTheConceptLocal.d.ts +71 -0
  155. package/dist/types/Services/Local/MakeTheInstanceConceptLocal.d.ts +89 -0
  156. package/dist/types/Services/Local/MakeTheTypeLocal.d.ts +71 -0
  157. package/dist/types/Services/Local/UpdateCompositionLocal.d.ts +101 -0
  158. package/dist/types/Services/MakeTheCharacter.d.ts +74 -0
  159. package/dist/types/Services/MakeTheCharacterData.d.ts +65 -0
  160. package/dist/types/Services/MakeTheInstanceConcept.d.ts +75 -0
  161. package/dist/types/Services/MakeTheName.d.ts +81 -0
  162. package/dist/types/Services/MakeTheTimestamp.d.ts +68 -0
  163. package/dist/types/Services/MakeTheTypeConcept.d.ts +68 -0
  164. package/dist/types/Services/Mqtt/publishMessage.d.ts +27 -0
  165. package/dist/types/Services/Mqtt/subscribeMessage.d.ts +23 -0
  166. package/dist/types/Services/PatchComposition.d.ts +105 -0
  167. package/dist/types/Services/Search/DataIdFormat.d.ts +96 -24
  168. package/dist/types/Services/Search/FormatData.d.ts +92 -17
  169. package/dist/types/Services/Search/JustIdFormat.d.ts +91 -16
  170. package/dist/types/Services/Search/SearchLinkInternal.d.ts +28 -0
  171. package/dist/types/Services/Search/SearchLinkMultiple.d.ts +58 -0
  172. package/dist/types/Services/Search/SearchWithTypeAndLinker.d.ts +91 -24
  173. package/dist/types/Services/Search/orderingConnections.d.ts +34 -0
  174. package/dist/types/Services/SplitStrings.d.ts +50 -0
  175. package/dist/types/Services/UpdateComposition.d.ts +123 -0
  176. package/dist/types/Services/User/UserTranslation.d.ts +102 -0
  177. package/dist/types/Services/View/ViewInternalData.d.ts +32 -0
  178. package/dist/types/WrapperFunctions/SchemaQueryObservable.d.ts +140 -5
  179. package/dist/types/app.d.ts +71 -0
  180. package/package.json +1 -1
@@ -1,20 +1,150 @@
1
+ /**
2
+ * @fileoverview Node implementation for the UserBinaryTree.
3
+ * This module provides the UserNode class for storing user-specific concepts and connections.
4
+ * @module DataStructures/User/UserNode
5
+ */
1
6
  import { LConcept } from "../Local/LConcept";
2
7
  import { LConnection } from "../Local/LConnection";
8
+ /**
9
+ * Represents a node in the user binary tree that stores both concepts and connections.
10
+ *
11
+ * @remarks
12
+ * UserNode implements an AVL tree node that can store multiple concepts and connections
13
+ * for a given composite key (userId + sessionId + randomizer). This allows efficient
14
+ * storage and retrieval of all user data associated with a specific key combination.
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * const concept = new LConcept(123, "example", 5);
19
+ * const connection = new LConnection(456, 1, 2, 3, 4, 5);
20
+ * const node = new UserNode("compositeKey", concept, connection, null, null);
21
+ * ```
22
+ */
3
23
  export declare class UserNode {
24
+ /**
25
+ * The composite key used for tree ordering.
26
+ * Typically a hexadecimal string combining userId, sessionId, and randomizer.
27
+ */
4
28
  key: any;
29
+ /**
30
+ * Array of connections stored in this node.
31
+ * Multiple connections can be associated with the same key.
32
+ */
5
33
  connectionValue: LConnection[];
34
+ /**
35
+ * Array of concepts stored in this node.
36
+ * Multiple concepts can be associated with the same key.
37
+ */
6
38
  value: LConcept[];
39
+ /**
40
+ * Reference to the left child node.
41
+ */
7
42
  leftNode: UserNode | null;
43
+ /**
44
+ * Reference to the right child node.
45
+ */
8
46
  rightNode: UserNode | null;
47
+ /**
48
+ * The height of this node in the tree.
49
+ * Used for AVL tree balancing calculations.
50
+ */
9
51
  height: number;
52
+ /**
53
+ * Creates a new UserNode.
54
+ *
55
+ * @param key - The composite key for tree ordering
56
+ * @param value - The LConcept to store (added if ID > 0)
57
+ * @param connectionValue - The LConnection to store (added if ID > 0)
58
+ * @param leftNode - The left child node (or null)
59
+ * @param rightNode - The right child node (or null)
60
+ *
61
+ * @remarks
62
+ * Only adds concepts and connections with valid (> 0) IDs to their respective arrays.
63
+ *
64
+ * @example
65
+ * ```typescript
66
+ * const node = new UserNode("compositeKey", concept, connection, null, null);
67
+ * ```
68
+ */
10
69
  constructor(key: any, value: LConcept, connectionValue: LConnection, leftNode: UserNode | null, rightNode: UserNode | null);
70
+ /**
71
+ * Adds a new node to the tree with AVL balancing.
72
+ *
73
+ * @param passedNode - The node to be added
74
+ * @param node - The current node being evaluated
75
+ * @param height - The height of the current node
76
+ * @returns The root node after insertion and balancing
77
+ *
78
+ * @remarks
79
+ * Implements AVL tree insertion. When a node with the same key exists,
80
+ * the new node's concepts and connections are added to the existing node's arrays.
81
+ */
11
82
  addNode(passedNode: UserNode, node: UserNode | null, height: number): UserNode | null;
83
+ /**
84
+ * Performs a right rotation on the given node for AVL balancing.
85
+ *
86
+ * @param y - The node to rotate right
87
+ * @returns The new root node after rotation
88
+ */
12
89
  rightRotate(y: UserNode | null): UserNode | null;
90
+ /**
91
+ * Performs a left rotation on the given node for AVL balancing.
92
+ *
93
+ * @param x - The node to rotate left
94
+ * @returns The new root node after rotation
95
+ */
13
96
  leftRotate(x: UserNode | null): UserNode | null;
97
+ /**
98
+ * Gets the height of a node.
99
+ *
100
+ * @param node - The node to get the height from
101
+ * @returns The height of the node, or 0 if null
102
+ */
14
103
  getHeight(node: UserNode | null): number;
104
+ /**
105
+ * Calculates the balance factor of a node.
106
+ *
107
+ * @param N - The node to calculate the balance factor for
108
+ * @returns The balance factor (difference between left and right heights)
109
+ */
15
110
  getBalanceFactor(N: UserNode | null): number;
111
+ /**
112
+ * Retrieves a node from the tree by its composite key.
113
+ *
114
+ * @param id - The composite key string to search for
115
+ * @param node - The current node being evaluated
116
+ * @returns The matching UserNode if found, null otherwise
117
+ */
16
118
  getFromNode(id: string, node: UserNode | null): UserNode | null;
119
+ /**
120
+ * Removes a node from the tree by its composite key.
121
+ *
122
+ * @param passedNode - The current node being evaluated
123
+ * @param id - The composite key string to remove
124
+ * @returns The root node after removal
125
+ *
126
+ * @remarks
127
+ * Implements standard BST deletion with in-order successor replacement.
128
+ */
17
129
  removeNode(passedNode: UserNode | null, id: string): UserNode | null;
130
+ /**
131
+ * Counts all nodes below and including the given node.
132
+ *
133
+ * @param root - The root node to start counting from
134
+ * @returns The total number of nodes in the subtree
135
+ *
136
+ * @remarks
137
+ * Recursively traverses the entire subtree to count all nodes.
138
+ */
18
139
  countNodeBelow(root: UserNode | null): number;
140
+ /**
141
+ * Finds the in-order successor of a node.
142
+ *
143
+ * @param root - The node to find the successor from
144
+ * @returns The in-order successor node (leftmost node in right subtree)
145
+ *
146
+ * @remarks
147
+ * Used during node deletion to find the replacement node.
148
+ */
19
149
  inOrderSuccessor(root: UserNode): UserNode;
20
150
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Placeholder module for IndexedDB concept retrieval functionality.
3
+ *
4
+ * This module is reserved for future implementation of concept retrieval operations
5
+ * from IndexedDB storage in the Concept Connection System.
6
+ *
7
+ * @module Database/GetConceptFromIndexDb
8
+ * @see https://documentation.freeschema.com for reference
9
+ */
@@ -1,9 +1,178 @@
1
+ /**
2
+ * No-operation IndexedDB interface module for environments without IndexedDB support.
3
+ *
4
+ * This module provides stub implementations of database operations that are used when
5
+ * IndexedDB is not available or when database functionality needs to be disabled.
6
+ * All functions are no-ops or return default values, allowing the application to
7
+ * run without actual database persistence.
8
+ *
9
+ * @module Database/NoIndexDb
10
+ * @see https://documentation.freeschema.com for reference
11
+ */
1
12
  import { SettingData } from "../DataStructures/SettingData";
13
+ /**
14
+ * Opens or returns a reference to the IndexedDB database.
15
+ *
16
+ * In this no-op implementation, it simply returns the static database reference
17
+ * from IndexDb without performing any actual initialization.
18
+ *
19
+ * @param databaseName - The name of the database to open
20
+ * @returns The static IDBDatabase reference from IndexDb.db
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * const db = openDatabase('concepts-db');
25
+ * // Returns IndexDb.db without initialization
26
+ * ```
27
+ *
28
+ * @remarks
29
+ * This is a stub implementation used when full database functionality is not needed.
30
+ *
31
+ * @see IndexDb for the database singleton
32
+ */
2
33
  export declare function openDatabase(databaseName: string): IDBDatabase;
34
+ /**
35
+ * Stores an object to the database (no-op implementation).
36
+ *
37
+ * This function provides a stub for storing data to IndexedDB. In this no-op
38
+ * implementation, it does not perform any actual storage operations.
39
+ *
40
+ * @param databaseName - The name of the database or object store
41
+ * @param object - The object to store (can be any type)
42
+ *
43
+ * @example
44
+ * ```typescript
45
+ * const concept = { id: 1, name: 'Example' };
46
+ * storeToDatabase('concepts', concept);
47
+ * // No actual storage occurs
48
+ * ```
49
+ *
50
+ * @remarks
51
+ * This is a placeholder implementation. Use the full database module for actual persistence.
52
+ */
3
53
  export declare function storeToDatabase(databaseName: string, object: any): void;
54
+ /**
55
+ * Retrieves statistics and settings from the database.
56
+ *
57
+ * Returns a new SettingData instance initialized with default values.
58
+ * This provides a consistent interface for accessing settings even when
59
+ * database functionality is disabled.
60
+ *
61
+ * @returns A new SettingData instance with AI features enabled (true)
62
+ *
63
+ * @example
64
+ * ```typescript
65
+ * const stats = GetStatsFromDatabase();
66
+ * // Returns SettingData with default configuration
67
+ * ```
68
+ *
69
+ * @remarks
70
+ * The returned SettingData is initialized with AI features enabled by default.
71
+ *
72
+ * @see SettingData for the settings data structure
73
+ */
4
74
  export declare function GetStatsFromDatabase(): SettingData;
75
+ /**
76
+ * Updates the AI flag in settings (no-op implementation).
77
+ *
78
+ * This function provides a stub for updating AI-related settings in the database.
79
+ * In this no-op implementation, it does not perform any actual updates.
80
+ *
81
+ * @param object - The SettingData object containing the new AI flag value
82
+ *
83
+ * @example
84
+ * ```typescript
85
+ * const settings = new SettingData(false);
86
+ * AiUpdateFlag(settings);
87
+ * // No actual update occurs
88
+ * ```
89
+ *
90
+ * @remarks
91
+ * This is a placeholder implementation. Changes are not persisted.
92
+ *
93
+ * @see SettingData for the settings data structure
94
+ */
5
95
  export declare function AiUpdateFlag(object: SettingData): void;
96
+ /**
97
+ * Retrieves an object from the database by type and ID (no-op implementation).
98
+ *
99
+ * This async function provides a stub for fetching data from IndexedDB based on
100
+ * type and ID. In this no-op implementation, it returns undefined.
101
+ *
102
+ * @param databaseName - The name of the database or object store
103
+ * @param type - The type of object to retrieve (e.g., 'concept', 'setting')
104
+ * @param id - The numeric ID of the object to retrieve
105
+ * @returns Promise resolving to undefined
106
+ *
107
+ * @example
108
+ * ```typescript
109
+ * const concept = await getFromDatabaseWithType('concepts', 'concept', 123);
110
+ * // Returns undefined
111
+ * ```
112
+ *
113
+ * @remarks
114
+ * This is a placeholder implementation. Use the full database module for actual retrieval.
115
+ */
6
116
  export declare function getFromDatabaseWithType(databaseName: string, type: string, id: number): Promise<void>;
117
+ /**
118
+ * Retrieves objects from the database using legacy method (no-op implementation).
119
+ *
120
+ * This async function provides a stub for the older method of fetching data from
121
+ * IndexedDB. In this no-op implementation, it returns undefined.
122
+ *
123
+ * @param databaseName - The name of the database or object store
124
+ * @returns Promise resolving to undefined
125
+ *
126
+ * @example
127
+ * ```typescript
128
+ * const data = await getFromDatabaseWithTypeOld('concepts');
129
+ * // Returns undefined
130
+ * ```
131
+ *
132
+ * @remarks
133
+ * This is a legacy method maintained for backward compatibility. Use getFromDatabaseWithType
134
+ * for new implementations.
135
+ *
136
+ * @see getFromDatabaseWithType for the current retrieval method
137
+ */
7
138
  export declare function getFromDatabaseWithTypeOld(databaseName: string): Promise<void>;
139
+ /**
140
+ * Removes an object from the database by ID (no-op implementation).
141
+ *
142
+ * This function provides a stub for deleting data from IndexedDB. In this no-op
143
+ * implementation, it does not perform any actual deletion.
144
+ *
145
+ * @param databaseName - The name of the database or object store
146
+ * @param id - The numeric ID of the object to remove
147
+ *
148
+ * @example
149
+ * ```typescript
150
+ * removeFromDatabase('concepts', 123);
151
+ * // No actual deletion occurs
152
+ * ```
153
+ *
154
+ * @remarks
155
+ * This is a placeholder implementation. Use the full database module for actual deletion.
156
+ */
8
157
  export declare function removeFromDatabase(databaseName: string, id: number): void;
158
+ /**
159
+ * Retrieves all objects from the local database (no-op implementation).
160
+ *
161
+ * This async function provides a stub for fetching all data from a local IndexedDB
162
+ * object store. In this no-op implementation, it returns undefined.
163
+ *
164
+ * @param databaseName - The name of the database or object store
165
+ * @returns Promise resolving to undefined
166
+ *
167
+ * @example
168
+ * ```typescript
169
+ * const allConcepts = await getAllFromLocalDb('concepts');
170
+ * // Returns undefined
171
+ * ```
172
+ *
173
+ * @remarks
174
+ * This is a placeholder implementation. Use the full database module for actual bulk retrieval.
175
+ *
176
+ * @see LocalIndexDb for local database operations
177
+ */
9
178
  export declare function getAllFromLocalDb(databaseName: string): Promise<void>;
@@ -1,3 +1,45 @@
1
+ /**
2
+ * Local IndexedDB management module for storing concepts locally in the browser.
3
+ *
4
+ * This module provides a singleton class that maintains a static reference to a local
5
+ * IndexedDB database connection. It serves as the primary interface for local browser
6
+ * storage of concept data in the Concept Connection System.
7
+ *
8
+ * @module Database/indexdblocal
9
+ * @see https://documentation.freeschema.com for reference
10
+ */
11
+ /**
12
+ * Singleton class managing the local IndexedDB database connection.
13
+ *
14
+ * LocalIndexDb provides a static database reference for local browser storage
15
+ * of concepts. This allows the application to maintain offline functionality
16
+ * and cache concept data locally.
17
+ *
18
+ * @remarks
19
+ * The static db property is shared across the application and should be initialized
20
+ * before any database operations are performed.
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * // Access the local database instance
25
+ * const database = LocalIndexDb.db;
26
+ * if (database) {
27
+ * // Perform database operations
28
+ * }
29
+ * ```
30
+ *
31
+ * @see IndexDb for remote database operations
32
+ * @see https://documentation.freeschema.com for concept storage patterns
33
+ */
1
34
  export declare class LocalIndexDb {
35
+ /**
36
+ * Static reference to the local IndexedDB database instance.
37
+ *
38
+ * This property holds the active IDBDatabase connection for local storage.
39
+ * It should be initialized during application startup before any database
40
+ * operations are attempted.
41
+ *
42
+ * @type {IDBDatabase}
43
+ */
2
44
  static db: IDBDatabase;
3
45
  }
@@ -1,3 +1,46 @@
1
+ /**
2
+ * IndexedDB management module for the Concept Connection System.
3
+ *
4
+ * This module provides a singleton class that maintains a static reference to an
5
+ * IndexedDB database connection. It serves as the primary interface for browser-based
6
+ * storage of concepts, settings, and other CCS data structures.
7
+ *
8
+ * @module Database/indexeddb
9
+ * @see https://documentation.freeschema.com for reference
10
+ */
11
+ /**
12
+ * Singleton class managing the IndexedDB database connection.
13
+ *
14
+ * IndexDb provides a static database reference that can be accessed throughout
15
+ * the application for storing and retrieving concept data, settings, and other
16
+ * persistent information in the browser's IndexedDB storage.
17
+ *
18
+ * @remarks
19
+ * The static db property is shared across the entire application. It should be
20
+ * initialized during application startup before performing any database operations.
21
+ * The current database schema version is 4.
22
+ *
23
+ * @example
24
+ * ```typescript
25
+ * // Access the database instance
26
+ * const database = IndexDb.db;
27
+ * if (database) {
28
+ * // Perform database operations
29
+ * const transaction = database.transaction(['concepts'], 'readonly');
30
+ * }
31
+ * ```
32
+ *
33
+ * @see LocalIndexDb for local-only database operations
34
+ * @see https://documentation.freeschema.com for database schema details
35
+ */
1
36
  export declare class IndexDb {
37
+ /**
38
+ * Static reference to the IndexedDB database instance.
39
+ *
40
+ * This property holds the active IDBDatabase connection used throughout
41
+ * the application. Must be initialized before use.
42
+ *
43
+ * @type {IDBDatabase}
44
+ */
2
45
  static db: IDBDatabase;
3
46
  }
@@ -1 +1,29 @@
1
+ /**
2
+ * Concept Draw Module for Concept Connection System (CCS-JS)
3
+ *
4
+ * This module handles the visual rendering of concepts on an HTML5 canvas.
5
+ * It provides a drawing loop that continuously renders concepts as triangles
6
+ * with automatic positioning and animation capabilities.
7
+ *
8
+ * @module Drawing/ConceptDraw
9
+ * @see https://documentation.freeschema.com for visualization reference
10
+ */
11
+ /**
12
+ * Initializes and starts the main drawing loop for rendering concepts.
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * // Start the drawing loop
17
+ * DrawingLoop();
18
+ * ```
19
+ *
20
+ * @remarks
21
+ * Sets up a continuous drawing loop using setInterval that:
22
+ * - Targets 60 FPS (though currently draws at 2 FPS with 500ms interval)
23
+ * - Queries the canvas element with ID 'myCanvas'
24
+ * - Continuously calls MainDraw() to render concepts
25
+ *
26
+ * Note: The FPS and FRAME_RATE variables are declared but not currently used.
27
+ * The actual draw rate is 500ms (2 times per second), not 60 FPS.
28
+ */
1
29
  export declare function DrawingLoop(): void;
@@ -1 +1,47 @@
1
+ /**
2
+ * Concept Events Module for Concept Connection System (CCS-JS)
3
+ *
4
+ * This module handles user interaction events with visual concepts on the canvas.
5
+ * It provides hit detection and selection functionality for concepts rendered as triangles.
6
+ *
7
+ * @module Drawing/ConceptEvents
8
+ * @see https://documentation.freeschema.com for interaction reference
9
+ */
10
+ /**
11
+ * Detects and returns a concept at the given mouse coordinates.
12
+ *
13
+ * @param mouse_x_coordinate - The x-coordinate of the mouse position
14
+ * @param mouse_y_coordinate - The y-coordinate of the mouse position
15
+ * @returns The concept at the mouse position, or null if no concept was clicked
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * canvas.addEventListener('click', (event) => {
20
+ * const rect = canvas.getBoundingClientRect();
21
+ * const x = event.clientX - rect.left;
22
+ * const y = event.clientY - rect.top;
23
+ * const selected = selectConceptObject(x, y);
24
+ * if (selected) {
25
+ * console.log('Clicked concept:', selected.id);
26
+ * }
27
+ * });
28
+ * ```
29
+ *
30
+ * @remarks
31
+ * Hit detection uses a rectangular bounding box approach:
32
+ * - Width: 100 pixels (50 pixels on each side from center)
33
+ * - Height: 100 pixels (from y coordinate downward)
34
+ *
35
+ * Boundary calculations:
36
+ * - Left: concept.x - 50
37
+ * - Right: concept.x + 50
38
+ * - Top: concept.y
39
+ * - Bottom: concept.y + 100
40
+ *
41
+ * Note: Although concepts are drawn as triangles, the hit detection uses
42
+ * a rectangular area for simplicity. This means clicks near the corners
43
+ * of the rectangle but outside the actual triangle will still register.
44
+ *
45
+ * @see {@link ConceptsData} for the data store being searched
46
+ */
1
47
  export declare function selectConceptObject(mouse_x_coordinate: number, mouse_y_coordinate: number): import("../app").Concept | null;
@@ -1,10 +1,169 @@
1
+ /**
2
+ * Check If Exists Helper Module for Concept Connection System (CCS-JS)
3
+ *
4
+ * This module provides utility functions to verify the existence of concepts and connections
5
+ * within arrays. These functions are essential for avoiding duplicates and finding related
6
+ * entities in the CCS data structures.
7
+ *
8
+ * @module Helpers/CheckIfExists
9
+ * @see https://documentation.freeschema.com for data structure reference
10
+ */
1
11
  import { Concept } from "../DataStructures/Concept";
2
12
  import { Connection } from "../DataStructures/Connection";
3
13
  import { LConcept, LConnection } from "../app";
14
+ /**
15
+ * Checks if a concept exists in an array of concepts by matching IDs.
16
+ *
17
+ * @param conceptList - Array of concepts to search through
18
+ * @param concept - The concept to search for
19
+ * @returns The found concept if it exists, otherwise returns a default concept
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * const concepts = [concept1, concept2, concept3];
24
+ * const found = CheckIfConceptsExistsInArray(concepts, concept2);
25
+ * if (found.id !== 0) {
26
+ * console.log('Concept exists!');
27
+ * }
28
+ * ```
29
+ *
30
+ * @remarks
31
+ * Returns a default concept (created via CreateDefaultConcept) if the concept is not found.
32
+ * Always check the returned concept's ID to verify if a match was found.
33
+ */
4
34
  export declare function CheckIfConceptsExistsInArray(conceptList: Concept[] | undefined, concept: Concept): Concept;
35
+ /**
36
+ * Checks if concepts of the same type exist in an array, matching by type ID or character value.
37
+ *
38
+ * @param conceptList - Array of concepts to search through
39
+ * @param concept - The concept whose type to match against
40
+ * @returns Array of all concepts that match the same type
41
+ *
42
+ * @example
43
+ * ```typescript
44
+ * const concepts = [concept1, concept2, concept3];
45
+ * const sameType = CheckIfTypeConceptsExistsInArray(concepts, concept1);
46
+ * console.log(`Found ${sameType.length} concepts of the same type`);
47
+ * ```
48
+ *
49
+ * @remarks
50
+ * This function normalizes type character values by ensuring they start with "the_" prefix
51
+ * before comparison. It matches concepts by either:
52
+ * - Exact typeId match
53
+ * - Character value match (with "the_" prefix normalization)
54
+ */
5
55
  export declare function CheckIfTypeConceptsExistsInArray(conceptList: Concept[] | undefined, concept: Concept): Concept[];
56
+ /**
57
+ * Checks if LConcepts (lightweight concepts) of the same type exist in an array.
58
+ *
59
+ * @param conceptList - Array of LConcepts to search through
60
+ * @param concept - The LConcept whose type to match against
61
+ * @returns Array of all LConcepts that match the same type
62
+ *
63
+ * @example
64
+ * ```typescript
65
+ * const lconcepts = [lconcept1, lconcept2, lconcept3];
66
+ * const sameType = CheckIfTypeLConceptsExistsInArray(lconcepts, lconcept1);
67
+ * console.log(`Found ${sameType.length} LConcepts of the same type`);
68
+ * ```
69
+ *
70
+ * @remarks
71
+ * This is the LConcept variant of CheckIfTypeConceptsExistsInArray.
72
+ * LConcept is a lightweight representation that uses typeCharacter instead of type object.
73
+ * The function normalizes type character values by ensuring they start with "the_" prefix.
74
+ *
75
+ * @see {@link CheckIfTypeConceptsExistsInArray}
76
+ */
6
77
  export declare function CheckIfTypeLConceptsExistsInArray(conceptList: LConcept[] | undefined, concept: LConcept): LConcept[];
78
+ /**
79
+ * Checks if a connection exists in an array of connections by matching IDs.
80
+ *
81
+ * @param connectionList - Array of connections to search through
82
+ * @param connection - The connection to search for
83
+ * @returns The found connection if it exists, otherwise returns a default connection with all zeros
84
+ *
85
+ * @example
86
+ * ```typescript
87
+ * const connections = [conn1, conn2, conn3];
88
+ * const found = CheckIfConnectionExistsInArray(connections, conn2);
89
+ * if (found.id !== 0) {
90
+ * console.log('Connection exists!');
91
+ * }
92
+ * ```
93
+ *
94
+ * @remarks
95
+ * Returns a new Connection instance with all parameters set to 0 if the connection is not found.
96
+ * Always check the returned connection's ID to verify if a match was found.
97
+ */
7
98
  export declare function CheckIfConnectionExistsInArray(connectionList: Connection[] | undefined, connection: Connection): Connection;
99
+ /**
100
+ * Checks if a connection exists in an array where a concept is either the source or target.
101
+ *
102
+ * @param connectionList - Array of connections to search through
103
+ * @param conceptId - The ID of the concept to find in connections
104
+ * @returns The first connection found where the concept appears as either toTheConceptId or ofTheConceptId
105
+ *
106
+ * @example
107
+ * ```typescript
108
+ * const connections = [conn1, conn2, conn3];
109
+ * const found = CheckIfToTheConceptExistsInConnectionArray(connections, 123);
110
+ * if (found.id !== 0) {
111
+ * console.log('Concept is connected!');
112
+ * }
113
+ * ```
114
+ *
115
+ * @remarks
116
+ * This function searches bidirectionally - it finds connections where the concept is either:
117
+ * - The target (toTheConceptId)
118
+ * - The source (ofTheConceptId)
119
+ * If both exist, the ofTheConceptId match takes precedence as it's checked second.
120
+ * Returns a default connection (all zeros) if no match is found.
121
+ */
8
122
  export declare function CheckIfToTheConceptExistsInConnectionArray(connectionList: Connection[] | undefined, conceptId: number): Connection;
123
+ /**
124
+ * Finds all connections in an array where a concept appears as either source or target.
125
+ *
126
+ * @param connectionList - Array of connections to search through
127
+ * @param conceptId - The ID of the concept to find in connections
128
+ * @returns Array of all connections where the concept is connected (up to 2: one as target, one as source)
129
+ *
130
+ * @example
131
+ * ```typescript
132
+ * const connections = [conn1, conn2, conn3];
133
+ * const found = CheckAllConnectionsConnectedInConnectionArray(connections, 123);
134
+ * console.log(`Concept has ${found.length} connections`);
135
+ * ```
136
+ *
137
+ * @remarks
138
+ * This function finds connections where the concept appears as:
139
+ * - toTheConceptId (target/destination of connection)
140
+ * - ofTheConceptId (source/origin of connection)
141
+ * Note: Uses `find()` which only returns the first match for each direction,
142
+ * so maximum 2 connections will be returned even if more exist.
143
+ *
144
+ * @see {@link CheckAllConnectionsConnectedInLConnectionArray} for the LConnection variant
145
+ */
9
146
  export declare function CheckAllConnectionsConnectedInConnectionArray(connectionList: Connection[] | undefined, conceptId: number): Connection[];
147
+ /**
148
+ * Finds all LConnections (lightweight connections) in an array where a concept appears as either source or target.
149
+ *
150
+ * @param connectionList - Array of LConnections to search through
151
+ * @param conceptId - The ID of the concept to find in connections
152
+ * @returns Array of all LConnections where the concept is connected (up to 2: one as target, one as source)
153
+ *
154
+ * @example
155
+ * ```typescript
156
+ * const lconnections = [lconn1, lconn2, lconn3];
157
+ * const found = CheckAllConnectionsConnectedInLConnectionArray(lconnections, 123);
158
+ * console.log(`Concept has ${found.length} lightweight connections`);
159
+ * ```
160
+ *
161
+ * @remarks
162
+ * This is the LConnection variant of CheckAllConnectionsConnectedInConnectionArray.
163
+ * LConnection is a lightweight representation of connections used for performance optimization.
164
+ * Like its standard counterpart, it uses `find()` which only returns the first match per direction,
165
+ * so maximum 2 connections will be returned.
166
+ *
167
+ * @see {@link CheckAllConnectionsConnectedInConnectionArray}
168
+ */
10
169
  export declare function CheckAllConnectionsConnectedInLConnectionArray(connectionList: LConnection[] | undefined, conceptId: number): LConnection[];