spanwright
Version:
CLI tool to generate Cloud Spanner E2E testing framework projects with Go database tools and Playwright browser automation
31 lines • 1.26 kB
TypeScript
import * as fs from 'fs';
/**
* Create a secure temporary directory
* @param prefix - Optional prefix for the directory name
* @returns Path to the created temporary directory
*/
export declare function createSecureTempDir(prefix?: string): Promise<string>;
/**
* Execute a function with a temporary directory that is automatically cleaned up
* @param fn - Async function that receives the temp directory path
* @param prefix - Optional prefix for the directory name
* @returns The result of the function
*/
export declare function withTempDir<T>(fn: (tempDir: string) => Promise<T>, prefix?: string): Promise<T>;
/**
* Create a secure temporary file within a directory
* @param dir - Directory to create the file in
* @param prefix - Prefix for the filename
* @returns Object with file descriptor and path
*/
export declare function createSecureTempFile(dir: string, prefix?: string): Promise<{
fd: fs.promises.FileHandle;
path: string;
}>;
/**
* Synchronous version of createSecureTempDir for compatibility
* @param prefix - Optional prefix for the directory name
* @returns Path to the created temporary directory
*/
export declare function createSecureTempDirSync(prefix?: string): string;
//# sourceMappingURL=secure-temp.d.ts.map