import type { EmittedInterface } from "../core/type-emitter"; import type { ImportTracker } from "../core/import-tracker"; export type MergeStatus = "created" | "updated" | "skipped" | "overwritten"; export interface MergeResult { content: string; status: MergeStatus; /** Number of interfaces added (0 for skipped/overwritten) */ added: number; } /** * Decides whether to create, merge, or overwrite a type file. */ export declare class FileMerger { /** * Decides whether to create, merge, or overwrite a type file. * * - File does not exist → create (write all interfaces) * - File exists + `force` → overwrite (write all interfaces, replacing existing) * - File exists, not `force` → merge: add only interfaces not already declared * * Returns the final file content plus a status code. */ resolveFileContent(file: string, interfaces: EmittedInterface[], importTracker: ImportTracker, force: boolean): Promise; /** * Parses a named import line of the form: * `import { A, B } from "source"` * `import type { A, B } from "source"` * * Returns null for default imports, side-effect imports, or anything else. */ private parseImportLine; /** * Merges two sets of import lines, combining named imports for the same * source so we never emit duplicate import statements. */ private mergeImportLines; /** * Scans `content` for interface and type alias declarations and returns a map * from name to the full block text. * * Matches all four forms so that hand-written declarations are never * duplicated by the generator regardless of their export/keyword variant: * - `export interface Foo { ... }` * - `export type Foo = { ... }` * - `interface Foo { ... }` (non-exported, e.g. internal helpers) * - `type Foo = { ... }` (non-exported type alias) */ private extractInterfaceBlocks; /** * Extracts all `import ...` lines from the file content. */ private extractImportLines; } //# sourceMappingURL=file-merger.d.ts.map