import type { BuildResult } from '../../../../types.js';
import type { PipelineContext } from '../context.js';
/**
 * Inputs to {@link computeWasmOnlyStaleFiles}. Sets are passed in so the helper
 * is pure and unit-testable independently of `getInstalledWasmExtensions` and
 * the `NATIVE_SUPPORTED_EXTENSIONS` global state.
 */
export interface WasmOnlyStaleFilesInput {
    /** Distinct `file` values from the `nodes` table. */
    existingNodes: ReadonlySet<string>;
    /** Distinct `file` values from the `file_hashes` table. */
    existingHashes: ReadonlySet<string>;
    /** Relative paths currently on disk (from `collectFilesUtil`). */
    expected: ReadonlySet<string>;
    /** Lowercased extensions whose WASM grammar is installed. */
    installedExts: ReadonlySet<string>;
    /** Extensions covered by the Rust addon — Rust owns deletion for these. */
    nativeSupported: ReadonlySet<string>;
}
/**
 * Compute the WASM-only files present in the DB but missing from disk (#1073).
 *
 * Returns relative paths that:
 *   - appear in `existingNodes` or `existingHashes` (in DB),
 *   - are absent from `expected` (not on disk),
 *   - have an extension installed for WASM, AND
 *   - have an extension NOT covered by `nativeSupported` — Rust's
 *     `purge_changed_files` handles deletion for natively-supported extensions
 *     via its own `detect_removed_files`, so the caller must not double-purge.
 *
 * Extensions are lowercased before lookup to match the registry and Rust's
 * `LanguageKind::from_extension` (which normalises case for the languages
 * where both cases are conventional, e.g. R's `.r` / `.R`).
 *
 * DB paths are forced to forward slashes before comparison with `expected`
 * (which is always normalised). The on-disk invariant is that DB rows are
 * written with forward slashes, but a stale row written by older code on
 * Windows could carry back-slashes — normalising here makes the comparison
 * platform-safe and prevents false-positive purges of live rows. We replace
 * `\\` explicitly (rather than calling `normalizePath`, which only touches
 * `path.sep`) so the defence works when running on POSIX against a DB that
 * was migrated from Windows.
 *
 * Exported for unit testing.
 */
export declare function computeWasmOnlyStaleFiles(input: WasmOnlyStaleFilesInput): string[];
/**
 * Try the native build orchestrator.
 *
 * Returns:
 *   - `BuildResult` on success (caller should return it directly).
 *   - `'early-exit'` when the orchestrator detected no changes (caller should return undefined).
 *   - `undefined` when native is unavailable or skipped (caller should fall through to the JS pipeline).
 *
 * Encapsulates the orchestrator-selection strategy: open `NativeDatabase`,
 * invoke `nativeDb.buildGraph()` (the Rust pipeline), and run post-native
 * structure + analysis fallbacks. Lives in its own file to keep the Rust
 * orchestrator entry point separated from the JS-side `buildGraph()` driver
 * in `pipeline.ts`.
 */
export declare function tryNativeOrchestrator(ctx: PipelineContext): Promise<BuildResult | undefined | 'early-exit'>;
//# sourceMappingURL=native-orchestrator.d.ts.map