import { createModuleRequire } from "../../utils/module-require.js";
let cachedLoadResult = null;
export function resetNativeSearchBindingCache() {
    cachedLoadResult = null;
}
export function loadNativeSearchBinding() {
    if (cachedLoadResult !== null)
        return cachedLoadResult || null;
    try {
        const require = createModuleRequire(import.meta.url);
        const binding = require("@bastani/atomic-natives");
        if (typeof binding.glob !== "function" || typeof binding.grep !== "function") {
            cachedLoadResult = false;
            return null;
        }
        cachedLoadResult = binding;
        return cachedLoadResult;
    }
    catch {
        cachedLoadResult = false;
        return null;
    }
}
export function invalidateNativeSearchCache(path) {
    loadNativeSearchBinding()?.invalidateFsScanCache?.(path ?? null);
}
//# sourceMappingURL=search-native.js.map