import type { Manifest } from '../manifest/types.js'; import { CommonOptions, LinkKind, Result } from '../types.js'; import type { ManifestInputOptions } from './manifest-input.js'; export interface Mapping { source: string; target: string; kind?: LinkKind; atomic?: boolean; } /** * add: write manifest + converge target to symlink(source). * * Safety rules: * - If source and target both exist AND target is not already a symlink to source => reject. * - If target exists and is not a symlink AND source is missing => migrate: * copy(target -> source), move original target aside to backup, then link target -> source. * - If symlink creation fails => error (no copy fallback). */ export interface AddOptions extends CommonOptions, ManifestInputOptions { } export declare function add(manifest: string | unknown, mapping: Mapping, opts?: AddOptions): Promise<{ result: Result; manifest: Manifest; }>;