import { IdAllocator } from './idAllocator.js'; export { IdAllocator }; export interface PlannedAc { /** 'existing' ACs are never itemized with a `text` (untouched, not our business); 'minted' * covers both a brand-new AC and an already-existing-AC-section item that merely gained an id. */ status: 'minted'; id: string; text: string; wasPreChecked: boolean; } export interface PlannedIssue { status: 'existing' | 'minted'; id: string; /** Title as it will read after materialization (unchanged for 'existing'). */ title: string; parentId: string | null; acs: PlannedAc[]; existingAcCount: number; } export interface UnmappedNote { line: number; excerpt: string; reason: string; } export interface ImportPlan { filePath: string; prefixUsed: string; /** Document order. */ issues: PlannedIssue[]; isNoop: boolean; unmapped: UnmappedNote[]; preChecked: Array<{ issueId: string; acId: string; text: string; }>; } export interface ImportResult { plan: ImportPlan; materialized: string; } /** Every id already present in `text`'s headings (excluding a recognized AC heading, which is * never id-bearing). Used by importDriver.ts as a mandatory PRE-PASS over an entire batch — * `planAndMaterialize` only notes a file's own existing ids into the allocator as it classifies * THAT file, which is too late to protect an EARLIER file's minting in the same batch from * colliding with a LATER file's pre-existing id; scanning every file's existing ids up front, * before any file mints anything, is what actually makes the batch collision-safe. */ export declare function existingIdsInFile(text: string): string[]; /** Plan (and materialize) ONE file's import. `opts.prefix` is the resolved * issue-id prefix (see importDriver.ts for how it's inferred); `opts.allocator` is shared across * a whole import batch for collision-safe, single-pass numbering. */ export declare function planAndMaterialize(rawText: string, filePath: string, opts: { prefix: string; allocator: IdAllocator; }): ImportResult;