import { File } from "../File"; import { FileStream, Project, ProjectAsync } from "../Project"; /** * Promise of an array of files. Usually sourced from Project.streamFiles */ export declare function toPromise(stream: FileStream): Promise; /** * Allows conveniently passing one or many glob patterns to utility functions */ export declare type GlobOptions = string | string[]; /** * Does at least one file matching the given predicate exist in this project? * If no predicate is supplied, does at least one file match the glob pattern? * No guarantees about ordering * @param p * @param globPatterns positive and negative globs to match * @param test return a boolean or promise. Defaults to true * @return {Promise} */ export declare function fileExists(p: ProjectAsync, globPatterns: GlobOptions, test?: (f: File) => (boolean | Promise)): Promise; /** * Count files matching the given predicate in this project * If no predicate is supplied, does at least one file match the glob pattern? * No guarantees about ordering * @param p * @param globPatterns positive and negative globs to match * @param test return a boolean or promise. Defaults to true * @return {Promise} */ export declare function countFiles(p: ProjectAsync, globPatterns: GlobOptions, test?: (f: File) => (boolean | Promise)): Promise; /** * Gather values from files * @param {ProjectAsync} project to act on * @param {string} globPatterns glob pattern for files to match * @param {(f: File) => Promise} gather function returning a promise (of the value you're gathering) from each file. * Undefined returns will be filtered out * @return {Promise} */ export declare function gatherFromFiles(project: ProjectAsync, globPatterns: GlobOptions, gather: (f: File) => Promise | undefined): Promise; /** * Async generator to iterate over files. * @param {Project} project to act on * @param {string} globPatterns glob pattern for files to match * @param filter function to determine whether this file should be included. * Include all files if this function isn't supplied. * @return {Promise} */ export declare function fileIterator(project: Project, globPatterns: GlobOptions, filter?: (f: File) => Promise): AsyncIterable; /** * Perform the same operation on all the files. * @param project project to act on * @param globPatterns glob patterns to match * @param op operation to perform on files. Can return void or a promise. */ export declare function doWithFiles

(project: P, globPatterns: GlobOptions, op: (f: File) => void | Promise): Promise

; /** * Delete files matching the glob pattern and extra test (if supplied) * @param project project to act on * @param globPatterns glob patterns for files to delete * @param test additional, optional test for files to be deleted */ export declare function deleteFiles(project: ProjectAsync, globPatterns: GlobOptions, test?: (f: File) => boolean): Promise; /** * Copy files from one project to another * @param from project to copy files from * @param to project to copy files to */ export declare function copyFiles

(from: Project, to: P): Promise

; //# sourceMappingURL=projectUtils.d.ts.map