/** * @gitwand/core v2.3 — Structural (AST-based) merge dispatcher * * Provides `tryStructuralMergeResolve()`, an async entry point that: * * 1. Reconstructs the three file versions (base/ours/theirs) from the * Git conflict markers in the conflicted content. * 2. Parses each version with tree-sitter (via `web-tree-sitter`, optional peer). * 3. Extracts top-level entities and matches them across the three versions. * 4. Merges entities individually — only auto-resolvable conflicts are handled. * 5. Reconstructs the merged file following theirs entity order. * * Returns `null` (never throws) when: * - `web-tree-sitter` is not installed (graceful degradation) * - The grammar WASM file is unavailable * - Any version has parse errors * - Any entity has a real (both-changed-diff) conflict * * In all these cases the caller falls back to the standard hunk-based resolver. */ import type { MergeResult } from "../types.js"; import { type LoaderOptions } from "./parsers/loader.js"; import { isStructuralLanguage } from "./parsers/grammars/languages.js"; export type { LoaderOptions as StructuralLoaderOptions }; export { isStructuralLanguage }; export type { SupportedLanguage } from "./parsers/grammars/languages.js"; /** * Returns `true` for `.ts` and `.tsx` files. * @deprecated Use `isStructuralLanguage` — now covers JS/JSX/Python/Go/Rust too. */ export declare function isTypeScriptFile(filePath: string): boolean; /** * Attempt structural (AST-based) merge resolution for a TypeScript/TSX file. * * @param conflictedContent - File content with Git conflict markers * @param filePath - File path (grammar selection + type detection) * @param opts - Optional loader overrides (WASM paths, custom loaders) * @returns Merged content string on success, `null` on any failure */ export declare function tryStructuralMergeResolve(conflictedContent: string, filePath: string, opts?: LoaderOptions): Promise; /** * Wrap a structurally merged content string in a `MergeResult` object. * * All hunks are marked as auto-resolved via the "structural-merge" resolver. * This keeps the return type compatible with the synchronous `resolve()`. */ export declare function wrapStructuralResult(conflictedContent: string, mergedContent: string, filePath: string): MergeResult; //# sourceMappingURL=index.d.ts.map