"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_paths_socket = require('../paths/socket.js');
const require_cacache__internal = require('./_internal.js');

//#region src/cacache/tmp.ts
/**
* @file `withTmp` — run a callback with a freshly-created temp directory under
*   the cacache root. Wraps cacache's `tmp.withTmp` with a corrected type
*   signature (the DefinitelyTyped definition incorrectly declares `void` even
*   though the function forwards the callback's return value).
*/
/**
* Execute a callback with a temporary directory for cache operations.
*
* @example
*   ;```typescript
*   const result = await withTmp(async tmpDir => {
*     // Use tmpDir for temporary cache work
*     return 'done'
*   })
*   ```
*/
async function withTmp(callback) {
	/* c8 ignore start - External cacache call */
	return await require_cacache__internal.getCacache().tmp.withTmp(require_paths_socket.getSocketCacacheDir(), {}, callback);
	/* c8 ignore stop */
}

//#endregion
exports.withTmp = withTmp;