import type { createLogger } from "./logger"; import type { NormalizedConfig } from "./normalizer"; import type { StrategyFn, StrategyResult, StrategyStatus } from "./types"; /** Conflict entry (minimal by default). */ export interface Conflict { path: string; reason: string; ours?: unknown; theirs?: unknown; base?: unknown; } /** Result of merging a file. */ export interface MergeResult { filePath: string; merged: unknown; conflicts: Conflict[]; } /** Helper: stringify status for logs. */ export declare const statusToString: (s: StrategyStatus) => string; /** Merge context (runtime state + config). */ export interface MergeContext { config: NormalizedConfig; strategies: Record>; context?: TContext; _strategyCache?: Map; } /** Internal args passed to strategies. */ interface MergeArgs { ours: unknown; theirs: unknown; base?: unknown; path: string; filePath?: string; ctx: MergeContext; conflicts: Conflict[]; logger: Awaited>; } /** Built-in strategies. */ export declare const BuiltInStrategies: { readonly ours: ({ ours }: MergeArgs) => StrategyResult; readonly theirs: ({ theirs }: MergeArgs) => StrategyResult; readonly base: ({ base }: MergeArgs) => StrategyResult; readonly drop: (_skipped: MergeArgs) => StrategyResult; readonly skip: ({ path }: MergeArgs) => StrategyResult; readonly "non-empty": ({ ours, theirs, base, }: MergeArgs) => StrategyResult; readonly update: ({ ours, theirs }: MergeArgs) => StrategyResult; readonly merge: (args: MergeArgs) => Promise; readonly concat: ({ ours, theirs, path, }: MergeArgs) => StrategyResult; readonly unique: ({ ours, theirs, path, }: MergeArgs) => StrategyResult; }; /** * Recursively merges two inputs using configured strategies. * * Resolution order: * 1. If values are strictly equal → return either. * 2. Resolve strategy list from config (cached per path). * 3. Apply built-in/custom strategies in order. * - If a strategy succeeds → return its value immediately. * - If a strategy fails → continue to next. * 4. If all strategies fail → log conflict & fallback to ours. * * @template TContext Type of optional user context for custom strategies. */ export declare const mergeObject: ({ ours, theirs, base, path, filePath, ctx, conflicts, logger, }: MergeArgs) => Promise; export {};