/**
 * Native fuzzy file path discovery with JS fallback.
 *
 * Uses Rust's `ignore` crate when native addon is available.
 * Falls back to returning empty results when unavailable.
 */
import { native } from "../native.js";
let _nativeAvailable = null;
function nativeAvailable() {
    if (_nativeAvailable === null) {
        try {
            native.fuzzyFind({ query: "__probe__", path: "/tmp", maxResults: 1 });
            _nativeAvailable = true;
        }
        catch {
            _nativeAvailable = false;
        }
    }
    return _nativeAvailable;
}
/**
 * Fuzzy file path search.
 * Returns empty results when native addon is unavailable.
 */
export function fuzzyFind(options) {
    if (nativeAvailable()) {
        return native.fuzzyFind(options);
    }
    return { matches: [], totalMatches: 0 };
}
