/** * Find a usable `libJavaScriptCore` on the host. The v2 FFI backend depends * on the public JSC C API (`JSContextGroupCreate`, `JSEvaluateScript`, etc.) * being reachable at runtime; we probe well-known install paths in priority * order and return the first hit. If nothing matches we return `null` so * callers can fall back to the v1 Worker backend. * * Install hints by platform (printed in {@link JscLibraryNotFoundError}): * * - **macOS**: the system framework at * `/System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore` is * present on every Mac. No install needed. * - **Linux**: `sudo apt install libjavascriptcoregtk-4.1-0` on Debian / Ubuntu, * `sudo dnf install webkit2gtk4.1` on Fedora. Bonus: if Playwright is * installed locally we accept its bundled libJSC under * `~/.cache/ms-playwright/webkit-/minibrowser-gtk/lib/libjavascriptcoregtk-6.0.so.1`. * - **Windows**: no realistic system JSC. The Worker backend is the only * supported v2 backend on Windows. */ export type JscFlavor = "macos-framework" | "gtk-4.1" | "gtk-6.0"; /** Tagged result so callers can distinguish "library found at /path" from * "no library found, here's why" without exception control flow. */ export type JscLibraryProbe = { kind: "found"; path: string; flavor: JscFlavor; } | { kind: "not-found"; checked: string[]; installHint: string; }; export declare const resolveJscLibrary: () => JscLibraryProbe; export declare class JscLibraryNotFoundError extends Error { readonly checked: string[]; readonly installHint: string; constructor(checked: string[], installHint: string); }