/** * Retrieves a complete composition structure from local storage (IndexedDB). * * This function fetches a composition using local-only data, building a hierarchical * structure from local connections and concepts. If the concept has been synced to the * backend, it can automatically fall back to fetching from the server. * * **Process:** * 1. Fetches all local connections for the composition * 2. Identifies all connected concept IDs * 3. Retrieves the main concept from LocalConceptsData * 4. If concept not found locally, checks if it's been synced (TranslateLocalToReal) * 5. Falls back to server GetComposition if concept is synced * 6. Recursively builds composition tree from local data * 7. Organizes output by concept type * * **Local vs Server:** * - Prioritizes local data (IndexedDB) * - Automatic fallback to server if concept synced * - Uses LocalConnectionData for connections * - Uses LocalConceptsData for concepts * * **Output Format (JUSTDATA):** * Returns an object keyed by the main concept's type: * ``` * { * "Person": { * name: "Alice", * email: {...}, * projects: {...} * } * } * ``` * * @param id - The concept ID (can be negative for local or positive for synced) * * @returns Promise resolving to composition data organized by concept type * * @example * // Get local composition * const localComp = await GetCompositionLocal(-12345); * console.log(localComp["Project"]); * // Returns all data connected to this local project * * @example * // Get synced concept (automatically falls back to server) * const syncedComp = await GetCompositionLocal(-67890); * // If concept synced to server, fetches from there * * @throws Re-throws errors for handling by caller * * @see {@link GetCompositionLocalWithId} for composition with ID and data wrapper * @see {@link GetComposition} for server-only composition retrieval * @see {@link recursiveFetchLocal} for the recursive building logic */ export declare function GetCompositionLocal(id: number): Promise; /** * Retrieves a local composition with ID and data wrapper (DATAID format). * * This is a variant of GetCompositionLocal that returns the composition data * wrapped in an object that includes both the data and the concept ID. This format * is useful for tracking which concept the data belongs to. * * **Output Format (DATAID):** * ``` * { * data: { * "Person": { * name: "Alice", * email: {...} * } * }, * id: 12345 * } * ``` * * **Differences from GetCompositionLocal:** * - Returns { data, id } wrapper object * - Same local data retrieval process * - Same recursive building logic * - No automatic server fallback * * @param id - The concept ID (negative for local, positive for synced) * * @returns Promise resolving to object with { data, id } structure * * @example * const result = await GetCompositionLocalWithId(-12345); * console.log(result.id); // -12345 * console.log(result.data.Project); // Composition data * * @throws Re-throws errors for handling by caller * * @see {@link GetCompositionLocal} for standard format without ID wrapper * @see {@link GetCompositionWithId} for server version */ export declare function GetCompositionLocalWithId(id: number): Promise;