/** * File system utilities module * * @module files * * @example * Import file utilities: * ```typescript * import { isFileExists, getAllFilePaths, getFullPath } from '@vvlad1973/utils'; * ``` */ /** * Checks if a file exists at the given path * * @param filePath - Path to the file to check * @returns Promise resolving to true if file exists, false otherwise * * @example * ```typescript * const exists = await isFileExists('./package.json'); * // returns true if package.json exists * ``` */ export declare function isFileExists(filePath: string): Promise; /** * Gets all file paths in a directory recursively (synchronous) * * @param rootDir - Root directory to start search from * @param fileMask - Optional glob pattern to filter files * @param absolutePath - Whether to return absolute paths * @param pathPrefix - Optional prefix to add to paths * @returns Array of file paths * * @remarks * **Warning:** This function uses synchronous file system operations and will block * the event loop. For large directory trees, consider using {@link getAllFilePathsAsync} * instead to avoid blocking. * * @example * ```typescript * const files = getAllFilePaths('./src', '*.ts', true); * // returns array of absolute paths to all .ts files in src directory * ``` */ export declare function getAllFilePaths(rootDir?: string, fileMask?: string, absolutePath?: boolean, pathPrefix?: string): string[]; /** * Gets all file paths in a directory recursively (asynchronous) * * @param rootDir - Root directory to start search from * @param fileMask - Optional glob pattern to filter files * @param absolutePath - Whether to return absolute paths * @param pathPrefix - Optional prefix to add to paths * @returns Promise resolving to array of file paths * * @remarks * This is the async version of {@link getAllFilePaths}. It uses non-blocking * file system operations and is recommended for large directory trees. * * @example * ```typescript * const files = await getAllFilePathsAsync('./src', '*.ts', true); * // returns array of absolute paths to all .ts files in src directory * ``` */ export declare function getAllFilePathsAsync(rootDir?: string, fileMask?: string, absolutePath?: boolean, pathPrefix?: string): Promise; /** * Gets the full path by joining module location with a relative path * * @param moduleName - The import.meta.url of the calling module * @param modulePath - Relative path to join * @returns Full absolute path * * @example * ```typescript * // In an ES module: * const dataPath = getFullPath(import.meta.url, '../data/config.json'); * // returns absolute path to config.json * ``` */ export declare function getFullPath(moduleName: string, modulePath: string): string;