import { Concept } from "../DataStructures/Concept"; import { Connection } from "../DataStructures/Connection"; export declare function GetCompositionById(id: number): Promise<{ connectionList: Connection[]; compositionList: number[]; }>; /** * ## format JUSTDATA ## * this function builds the composition with the main id as the point of building. * @param id id of the main composition that you want to build * @param connectionList list of connections * @param compositionList list of of_the_concept_ids for all the connections. * @returns */ export declare function RecursiveFetchBuildLayer(id: number, connectionList: Connection[], compositionList: number[]): Promise; /** * ## format DATAID ## * this function builds the composition with the main id as the point of building. * @param id id of the main composition that you want to build * @param connectionList list of connections * @param compositionList list of of_the_concept_ids for all the connections. * @returns */ export declare function RecursiveFetchBuildLayerDataId(id: number, connectionList: Connection[], compositionList: number[]): Promise; /** * ## format Normal ## * this function builds the composition with the main id as the point of building. * @param id id of the main composition that you want to build * @param connectionList list of connections * @param compositionList list of of_the_concept_ids for all the connections. * @returns */ export declare function RecursiveFetchBuildLayerNormal(id: number, connectionList: Connection[], compositionList: number[]): Promise; /** * Retrieves a complete composition structure for a given concept ID in JUSTDATA format. * * This is a primary composition retrieval function that builds a hierarchical structure * containing the main concept, all its connections, and recursively fetched related concepts. * The result is formatted as a nested object organized by concept types. * * **What is a Composition?** * A composition represents a concept along with its connected relationships and sub-structures. * Think of it as getting a "full profile" of a concept including everything connected to it. * * **Process:** * 1. Fetches all connections associated with the concept * 2. Identifies all related concept IDs from those connections * 3. Recursively builds the composition tree * 4. Fetches the main concept details * 5. Organizes output by concept type (e.g., result["Person"] = {...}) * 6. Routes through service worker if enabled for better performance * * **Output Format (JUSTDATA):** * Returns an object keyed by the main concept's type character value: * ``` * { * "Person": { * id: 123, * characterValue: "Alice", * connections: [...], * relatedConcepts: {...} * } * } * ``` * * @param id - The unique identifier of the concept for which to build the composition. * This becomes the root of the composition tree. * * @returns Promise resolving to an object containing the composition data organized by * the main concept's type. Returns empty object if concept not found or on error. * * @example * // Get composition for a person concept * const composition = await GetComposition(12345); * console.log(composition["Person"]); * // { * // id: 12345, * // characterValue: "Alice Smith", * // connections: [... all connections], * // Company: { ... related company data }, * // Projects: { ... related projects } * // } * * @example * // Get composition for an organization * const orgComposition = await GetComposition(456); * console.log(orgComposition["Organization"]); * // Contains the organization and all connected employees, departments, etc. * * @example * // Use with service worker (automatic if enabled) * // Service worker handles the heavy lifting in background * const result = await GetComposition(789); * * @see {@link GetCompositionWithId} for composition with ID and timestamp (DATAID format) * @see {@link GetCompositionBulk} for fetching multiple compositions efficiently * @see {@link GetCompositionWithCache} for cached composition retrieval * @see {@link recursiveFetch} for the recursive building logic */ export declare function GetComposition(id: number): Promise; export declare function GetCompositionWithAllIds(id: number): Promise; /** * ### Format JUSTDATA ### * This function just builds data from the memory. * This is a function that takes on all the concepts and connections of the concept (as a composition ) and builds * it into a json data. * @param id this id is just used to get all the composition data from the concepts and connections in memory * @returns */ export declare function GetCompositionFromMemory(id: number): Promise; /** * ### Format Normal ### * This function just builds data from the memory. * This is a function that takes on all the concepts and connections of the concept (as a composition ) and builds * it into a json data. * @param id this id is just used to get all the composition data from the concepts and connections in memory * @returns */ export declare function GetCompositionFromMemoryNormal(id: number): Promise; /** * ### Format DATAIDDATE #### * Gets data just from memory * @param id * @returns */ export declare function GetCompositionWithIdFromMemory(id: number): Promise; /** * ### Format Normal #### * Gets data just from memory * @param id * @returns */ export declare function GetCompositionFromMemoryWithConnections(id: number, connectionList: Connection[]): Promise; /** * ### Format DATAIDDATE #### * Gets data just from memory * @param id * @returns */ export declare function GetCompositionWithIdFromMemoryFromConnection(id: number, connectionList: Connection[]): Promise; /** * ### Format DATAIDDATE #### * ### experimental #### * This is the new format that needs to work with a single or max two loops * @param id the id whose composition needs to be created * @returns */ export declare function GetCompositionWithIdFromMemoryNew(id: number): Promise; /** * ### Format DATAIDDATE ##### * ### This just returns composition from memory and not from anywhere else. * @param id * @returns */ export declare function GetCompositionWithIdAndDateFromMemory(id: number): Promise; export declare function GetCompositionWithIdFromMemoryFromConnections(id: number, connectionList?: Connection[]): Promise; /** * #### Format DATAID #### * ## This will return the composition even if it is not in the local memory ## * @param id * @returns */ export declare function GetCompositionWithId(id: number): Promise; /** * ## Format justdata ### * ## This contains a concept in the parameter so that you dont have to again find the concept ## * This function takes concepts and connections and then builds a json. * @param concept The concept that needs to get other concepts that are inside of it. * @param connectionList List of connections that are available in the composition. We have to loop over it. * @param compositionList Composition list is the list of concepts that have connections inside of them. * @param visitedConcepts This is a checking mechanism to not go in loops. So preferably pass an empty array. * @returns */ export declare function recursiveFetchConcept(concept: Concept, connectionList: Connection[], compositionList: number[], visitedConcepts?: number[]): Promise; /** * ## Format Normal ### * ## This contains a concept in the parameter so that you dont have to again find the concept ## * This function takes concepts and connections and then builds a json. * @param concept The concept that needs to get other concepts that are inside of it. * @param connectionList List of connections that are available in the composition. We have to loop over it. * @param compositionList Composition list is the list of concepts that have connections inside of them. * @param visitedConcepts This is a checking mechanism to not go in loops. So preferably pass an empty array. * @returns */ export declare function recursiveFetchConceptNormal(concept: Concept, connectionList: Connection[], compositionList: number[], visitedConcepts?: number[]): Promise; /** * ## experimental ## * This function takes concepts and connections and then builds a json. * @param concept The concept that needs to get other concepts that are inside of it. * @param connectionList List of connections that are available in the composition. We have to loop over it. * @param compositionList Composition list is the list of concepts that have connections inside of them. * @param visitedConcepts This is a checking mechanism to not go in loops. So preferably pass an empty array. * @returns */ export declare function recursiveFetchConceptSingleLoop(concept: Concept, connectionList: Connection[], compositionList: number[], visitedConcepts?: number[]): Promise; /** * ## Format justdata ## * @param id * @param connectionList * @param compositionList * @param visitedConcepts * @returns */ export declare function recursiveFetch(id: number, connectionList: Connection[], compositionList: number[], visitedConcepts?: number[]): Promise; export declare function recursiveFetchWithSubCompositions(id: number, connectionList: Connection[], compositionList: number[], visitedConcepts?: number[]): Promise;