/** * @file Socket-btm release download utilities. */ import type { Arch, Libc, Platform } from '../constants/platform.js'; import { getBinaryAssetName, getBinaryName, getNodePrebuildAssetName, getPlatformArch } from './socket-btm-binary-naming.js'; import type { AssetPattern } from './github-types.js'; export type { Arch, Libc, Platform }; export { getBinaryAssetName, getBinaryName, getNodePrebuildAssetName, getPlatformArch, }; /** * Socket-btm GitHub repository configuration. */ export declare const SOCKET_BTM_REPO: { readonly owner: 'SocketDev'; readonly repo: 'socket-btm'; }; /** * Configuration for downloading socket-btm generic assets. */ export interface SocketBtmAssetConfig { /** * Asset name or pattern on GitHub. */ asset: string | AssetPattern; /** * @internal Discriminator fields */ bin?: never | undefined; /** * Working directory (defaults to process.cwd()). */ cwd?: string | undefined; /** * Download destination directory. @default 'build/downloaded' */ downloadDir?: string | undefined; /** * @internal Discriminator fields */ libc?: never | undefined; /** * Output filename. @default resolved asset name. */ output?: string | undefined; /** * Suppress log messages. @default false. */ quiet?: boolean | undefined; /** * Remove macOS quarantine attribute after download. @default false. */ removeMacOSQuarantine?: boolean | undefined; /** * Specific release tag to download. */ tag?: string | undefined; /** * @internal Discriminator fields */ targetArch?: never | undefined; /** * @internal Discriminator fields */ targetPlatform?: never | undefined; } /** * Configuration for downloading socket-btm binary releases. */ export interface SocketBtmBinaryConfig { /** * @internal Discriminator field */ asset?: never | undefined; /** * Binary/executable name, without extension. @default tool. */ bin?: string | undefined; /** * Working directory (defaults to process.cwd()). */ cwd?: string | undefined; /** * Download destination directory. @default 'build/downloaded' */ downloadDir?: string | undefined; /** * Linux libc variant. Auto-detected if not specified. */ libc?: Libc | undefined; /** * Suppress log messages. @default false. */ quiet?: boolean | undefined; /** * Remove macOS quarantine attribute after download. @default true. */ removeMacOSQuarantine?: boolean | undefined; /** * Specific release tag to download. */ tag?: string | undefined; /** * Target architecture. Defaults to the current arch. */ targetArch?: Arch | undefined; /** * Target platform. Defaults to the current platform. */ targetPlatform?: Platform | undefined; } /** * Configuration for downloading a socket-btm release binary or asset. */ export type SocketBtmReleaseConfig = SocketBtmBinaryConfig | SocketBtmAssetConfig; /** * Detect the libc variant, musl or glibc, on Linux systems. Returns undefined * for non-Linux platforms. * * @example * ;```typescript * const libc = detectLibc() * console.log(libc) // 'glibc', 'musl', or undefined * ``` * * @returns 'musl', 'glibc', or undefined on non-Linux platforms */ export declare function detectLibc(): Libc | undefined; /** * Download a release from socket-btm. * * @example * ;```typescript * const binPath = await downloadSocketBtmRelease('lief', { * downloadDir: '/tmp/build/downloaded', * }) * ``` * * @param tool - Tool/package name for release matching (e.g., 'lief', 'curl') * @param options - Download configuration. * * @returns Path to the downloaded file */ export declare function downloadSocketBtmRelease(tool: string, options: SocketBtmReleaseConfig | undefined): Promise;