/** * Top-level entity extraction from a tree-sitter AST. * * An "entity" is a top-level declaration in a TypeScript/TSX file: * import, export, function, class, interface, type alias, variable declaration, * or ambient declaration (declare …). * * Each entity carries: * - `signature` — stable key for 3-way matching (based on name/kind) * - `text` — exact source slice (used in the merged output) * - byte offsets — for gap-preserving reconstruction */ export type EntityKind = "import" | "export" | "function" | "class" | "interface" | "type" | "variable" | "declare" | "expression" | "other"; export interface TopLevelEntity { /** Stable key used for 3-way entity matching */ signature: string; /** Entity kind */ kind: EntityKind; /** Exact source text of this entity */ text: string; /** Start byte index in the source string */ startByte: number; /** End byte index in the source string */ endByte: number; /** Start row (0-indexed) in the source */ startLine: number; } /** * Extract top-level entities from a parsed tree-sitter tree. * * Skips unnamed tokens (punctuation, keywords) and ERROR nodes. * * @param tree - Parsed tree-sitter tree * @param source - Source code (as passed to `parser.parse()`) */ export declare function extractEntities(tree: any, source: string): TopLevelEntity[]; /** * Return `true` if the tree contains at least one ERROR node. * * A tree with ERROR nodes has parse failures and should not be used * for structural merge (we fall back to the hunk-based resolver). */ export declare function hasParseErrors(tree: any): boolean; //# sourceMappingURL=entities.d.ts.map