//#region src/resolve-sidecar-binary-path.d.ts /** * \@vitest-agent/sidecar * * Resolves the absolute path of the platform-specific sidecar binary * by using `require.resolve` on the optional platform package's bin entry. * * @packageDocumentation */ /** * Platform and architecture resolver options for dependency injection in tests. * * @public */ interface ResolveSidecarBinaryPathOptions { /** Override the platform (defaults to `process.platform`). */ readonly platform?: NodeJS.Platform; /** Override the architecture (defaults to `process.arch`). */ readonly arch?: string; /** Override the module resolver (defaults to `createRequire`-backed resolver). */ readonly resolver?: (path: string) => string; } /** * Resolve the absolute path of the platform-specific sidecar binary. * * The four platform packages that ship SEA binaries are: * - `@vitest-agent/sidecar-darwin-arm64` → `bin/vitest-agent-sidecar` * - `@vitest-agent/sidecar-linux-arm64` → `bin/vitest-agent-sidecar` * - `@vitest-agent/sidecar-linux-x64` → `bin/vitest-agent-sidecar` * - `@vitest-agent/sidecar-win32-x64` → `bin/vitest-agent-sidecar.exe` * * The binary path is resolved via `require.resolve` of the platform package's * bin entry (not discovered on PATH), so transitive optional dependencies that * are never hoisted to `node_modules/.bin/` are still found correctly. * * Returns `null` when: * - The platform/arch combination has no matching package (e.g. darwin-x64). * - The matching optional dependency was not installed (MODULE_NOT_FOUND). * * @param options - Optional overrides for platform, arch, and resolver (for testing). * @returns The absolute path to the binary, or `null` when not resolvable. * @public */ declare function resolveSidecarBinaryPath(options?: ResolveSidecarBinaryPathOptions): string | null; //#endregion export { type ResolveSidecarBinaryPathOptions, resolveSidecarBinaryPath }; //# sourceMappingURL=index.d.ts.map