/** * @file Socket-btm binary asset/platform-arch naming helpers. */ import type { Arch, Libc, Platform } from '../constants/platform.js'; /** * Get asset name for a socket-btm binary. * * @example * ;```typescript * getBinaryAssetName('lief', 'linux', 'x64', 'musl') * // 'lief-linux-x64-musl' * ``` * * @param binaryBaseName - Binary basename (e.g., 'binject', 'node') * @param platform - Target platform. * @param arch - Target architecture. * @param libc - Linux libc variant (optional) * * @returns Asset name (e.g., 'binject-darwin-arm64', 'node-linux-x64-musl') */ export declare function getBinaryAssetName(binaryBaseName: string, platform: Platform, arch: Arch, libc?: Libc | undefined): string; /** * Get binary filename for output. * * @example * ;```typescript * getBinaryName('node', 'win32') // 'node.exe' * getBinaryName('node', 'linux') // 'node' * ``` * * @param binaryBaseName - Binary basename (e.g., 'node', 'binject') * @param platform - Target platform. * * @returns Binary filename (e.g., 'node', 'node.exe') */ export declare function getBinaryName(binaryBaseName: string, platform: Platform): string; /** * Get the tag-infixed asset name for a socket-btm `.node` prebuilt. * * The `.node` addon families (e.g. opentui) name their release assets * `-.node` — release `opentui-20260424-18f0f46` carries * `opentui-20260424-18f0f46-linux-x64-musl.node`. On Windows those assets use * the release platform token `win` (`opentui-20260424-18f0f46-win-arm64.node`), * matching the node-smol convention in `WIN_TOKEN_BY_BASENAME`. * * @example * ;```typescript * getNodePrebuildAssetName('opentui-20260424-18f0f46', 'linux', 'x64', 'musl') * // 'opentui-20260424-18f0f46-linux-x64-musl.node' * getNodePrebuildAssetName('opentui-20260424-18f0f46', 'win32', 'arm64') * // 'opentui-20260424-18f0f46-win-arm64.node' * ``` * * @param tag - Release tag name (e.g., 'opentui-20260424-18f0f46') * @param platform - Target platform. * @param arch - Target architecture. * @param libc - Linux libc variant (optional) * * @returns Asset name (e.g., 'opentui-20260424-18f0f46-darwin-arm64.node') */ export declare function getNodePrebuildAssetName(tag: string, platform: Platform, arch: Arch, libc?: Libc | undefined): string; /** * Get platform-arch identifier for directory structure and asset names. * * # Format: `-[-]` * * The OS segment is `process.platform` verbatim: `darwin` / `linux` / `win32`. * The arch segment is `process.arch` verbatim: `x64` / `arm64`. The optional * libc suffix is `-musl` (Linux only; the glibc default is unsuffixed to match * Node.js's own linuxstatic convention). * * Every segment matches what npm and pnpm already expect verbatim, so nothing * downstream needs a translation map. Why each convention was chosen: * docs/references/repo/platform-arch-naming.md. * * @example * getPlatformArch('linux', 'x64', 'musl') // 'linux-x64-musl' * getPlatformArch('darwin', 'arm64') // 'darwin-arm64' * getPlatformArch('win32', 'x64') // 'win32-x64' * getPlatformArch('darwin', 'x64', 'musl') // 'darwin-x64', libc ignored * * @param platform - Target platform. * @param arch - Target architecture. * @param libc - Linux libc variant (optional; non-linux platforms ignore) * * @returns Platform-arch identifier (e.g., 'darwin-arm64', 'linux-x64-musl', * 'win32-x64') */ export declare function getPlatformArch(platform: Platform, arch: Arch, libc?: Libc | undefined): string;