import type { ResolvedSegment } from "./types.js";
/**
 * Merge partial loader data from server with cached loader data.
 *
 * During partial revalidation (stale or action), the server may return only
 * some loaders that pass the revalidation check. The component still needs
 * all loader data, so we merge fresh data with cached data.
 *
 * @param fromServer - Segment returned from server with partial loaders
 * @param fromCache - Cached segment with full loader data
 * @returns Merged segment with complete loader data
 */
export declare function mergeSegmentLoaders(fromServer: ResolvedSegment, fromCache: ResolvedSegment): ResolvedSegment;
/**
 * Check if segments need loader merging during partial revalidation.
 *
 * Returns true when:
 * - Server returned fewer loaders than cached (partial revalidation)
 * - Both segments have loader data promises
 */
export declare function needsLoaderMerge(fromServer: ResolvedSegment, fromCache: ResolvedSegment | undefined): fromCache is ResolvedSegment;
/**
 * Insert diff segments that aren't in the matched array into allSegments.
 *
 * During consolidation fetch for concurrent actions, loader segments may be
 * excluded from the request. The server returns them in the diff but not in
 * the matched array. This function inserts them at the correct position
 * (after their parent layout segment).
 *
 * Loader segment IDs follow the pattern: {parentLayoutId}D{index}.{loaderId}
 * Example: M9L0L1D0.actionCounter has parent layout M9L0L1
 *
 * @param allSegments - Mutable array of segments to insert into
 * @param diff - Array of segment IDs that changed (from server response)
 * @param matchedIdSet - Set of segment IDs from matched array
 * @param newSegmentMap - Map of segment ID to segment data from server
 */
export declare function insertMissingDiffSegments(allSegments: ResolvedSegment[], diff: string[] | undefined, matchedIdSet: Set<string>, newSegmentMap: Map<string, ResolvedSegment>): void;
//# sourceMappingURL=merge-segment-loaders.d.ts.map