import { n as ResolvedEntry, r as SnapshotResult, t as ApiSnapshotOptions } from "./types-BElY5l7P.mjs"; //#region src/core/extract-runtime.d.ts interface ExtractOptions { chunkSources?: Map; omitArgumentNames?: boolean; typeWidening?: boolean; categorizedExports?: boolean; } /** * Extract runtime export skeletons from a JS chunk. * Returns a formatted `.ts` snapshot string showing the API surface without implementations. */ declare function extractRuntime(fileName: string, code: string, options?: ExtractOptions): Promise; //#endregion //#region src/core/extract-dts.d.ts declare function extractDts(fileName: string, code: string, options?: ExtractOptions): Promise; //#endregion //#region src/core/resolve.d.ts /** * Resolve package.json exports field into runtime + DTS file pairs. */ declare function resolvePackageEntries(cwd: string): Promise; /** * Synchronous variant of `resolvePackageEntries` for use in vitest * `describe()` callbacks, which cannot be async. */ declare function resolvePackageEntriesSync(cwd: string): ResolvedEntry[]; //#endregion //#region src/core/snapshot.d.ts interface SnapshotFile { runtime: string; dts: string; } interface SnapshotExtensions { runtime: string; dts: string; } /** * Write snapshot files for an entry point. */ declare function writeSnapshot(outputDir: string, entryName: string, snapshot: SnapshotFile, ext: SnapshotExtensions, header?: string): Promise; /** * Read existing snapshot files for an entry point. * Returns null if either file doesn't exist. */ declare function readSnapshot(outputDir: string, entryName: string, ext: SnapshotExtensions): Promise; interface SnapshotMismatch { entryName: string; runtimeDiff: string | null; dtsDiff: string | null; } /** * Compare a new snapshot against an existing one. * Returns null if they match, or a mismatch with formatted diffs. */ declare function compareSnapshots(entryName: string, existing: SnapshotFile, current: SnapshotFile): SnapshotMismatch | null; /** * Format the full mismatch error with pretty diffs for terminal output. */ declare function formatMismatchError(mismatches: SnapshotMismatch[], outputDir: string, ext: SnapshotExtensions): string; //#endregion //#region src/core/index.d.ts /** * Extract the public API surface of a package as snapshot strings, * without writing to disk or comparing against existing snapshots. * * Returns a record keyed by entry name (e.g. `'.'`, `'./utils'`), * each containing `runtime` and `dts` snapshot strings. * * Useful for integrating with Vitest's snapshot system: * ```ts * const api = generateApiSnapshot(process.cwd()) * expect(api['.'].dts).toMatchSnapshot() * ``` */ declare function generateApiSnapshot(cwd: string, options?: ApiSnapshotOptions): Promise>; /** * Snapshot a package by reading its package.json exports and parsing dist files. */ declare function snapshotPackage(cwd: string, options?: ApiSnapshotOptions): Promise; /** * Snapshot explicit file pairs. */ declare function snapshotFiles(files: { name: string; runtime?: string; dts?: string; }[], cwd: string, options?: ApiSnapshotOptions): Promise; //#endregion export { type ApiSnapshotOptions, type ResolvedEntry, type SnapshotExtensions, type SnapshotFile, type SnapshotMismatch, type SnapshotResult, compareSnapshots, extractDts, extractRuntime, formatMismatchError, generateApiSnapshot, readSnapshot, resolvePackageEntries, resolvePackageEntriesSync, snapshotFiles, snapshotPackage, writeSnapshot };