/**
 * @file Package operations including extraction, packing, and I/O.
 */
import type { ExtractOptions, NormalizeOptions, PackageJson, PacoteOptions, ReadPackageJsonOptions } from './types';
/**
 * Extract a package to a destination directory.
 *
 * @example
 *   ;```typescript
 *   await extractPackage('lodash@4.17.21', { dest: '/tmp/lodash' })
 *   ```
 */
export declare function extractPackage(pkgNameOrId: string, options?: ExtractOptions, callback?: (destPath: string) => Promise<unknown>): Promise<void>;
/**
 * Find package extensions for a given package.
 *
 * @example
 *   ;```typescript
 *   const extensions = findPackageExtensions('my-pkg', '1.0.0')
 *   ```
 */
export declare function findPackageExtensions(pkgName: string, pkgVer: string): unknown;
/**
 * Get the release tag for a version.
 *
 * @example
 *   ;```typescript
 *   getReleaseTag('lodash@latest') // 'latest'
 *   getReleaseTag('@scope/pkg@beta') // 'beta'
 *   getReleaseTag('lodash') // ''
 *   ```
 */
export declare function getReleaseTag(spec: string): string;
/**
 * Pack a package tarball using pacote.
 *
 * @example
 *   ;```typescript
 *   const tarball = await packPackage('lodash@4.17.21')
 *   ```
 */
export declare function packPackage(spec: string, options?: PacoteOptions): Promise<unknown>;
/**
 * Slugify an npm package name into a hyphenated identifier suitable for
 * User-Agent tokens, log namespaces, file paths, and other contexts where `@`
 * and `/` are not welcome.
 *
 * @example
 *   ;```typescript
 *   pkgNameToSlug('@socketsecurity/lib') // 'socketsecurity-lib'
 *   pkgNameToSlug('@cyclonedx/cdxgen') // 'cyclonedx-cdxgen'
 *   pkgNameToSlug('lodash') // 'lodash'
 *   ```
 */
export declare function pkgNameToSlug(pkgName: string): string;
/**
 * Read and parse a package.json file asynchronously.
 *
 * @example
 *   ;```typescript
 *   const pkgJson = await readPackageJson('/tmp/my-project')
 *   console.log(pkgJson?.name)
 *   ```
 */
export declare function readPackageJson(filepath: string, options?: ReadPackageJsonOptions): Promise<PackageJson | undefined>;
/**
 * Read and parse package.json from a file path synchronously.
 *
 * @example
 *   ;```typescript
 *   const pkgJson = readPackageJsonSync('/tmp/my-project')
 *   console.log(pkgJson?.name)
 *   ```
 */
export declare function readPackageJsonSync(filepath: string, options?: NormalizeOptions & {
    editable?: boolean;
    throws?: boolean;
}): PackageJson | undefined;
/**
 * Resolve GitHub tarball URL for a package specifier.
 *
 * @example
 *   ;```typescript
 *   const url = await resolveGitHubTgzUrl('my-pkg@1.0.0', '/tmp/my-project')
 *   ```
 */
export declare function resolveGitHubTgzUrl(pkgNameOrId: string, where?: unknown): Promise<string>;
/**
 * Resolve full package name from a PURL object with custom delimiter.
 *
 * @example
 *   ;```typescript
 *   resolvePackageName({ name: 'core', namespace: '@babel' }) // '@babel/core'
 *   resolvePackageName({ name: 'lodash' }) // 'lodash'
 *   ```
 */
export declare function resolvePackageName(purlObj: {
    name: string;
    namespace?: string;
}, delimiter?: string): string;
/**
 * Convert npm package name to Socket registry format with delimiter.
 *
 * @example
 *   ;```typescript
 *   resolveRegistryPackageName('@babel/core') // 'babel__core'
 *   resolveRegistryPackageName('lodash') // 'lodash'
 *   ```
 */
export declare function resolveRegistryPackageName(pkgName: string): string;
export type { PackageJson } from './types';
