import { File } from "../File"; import { FileStream, 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? * No guarantees about ordering * @param p * @param globPatterns positive and negative globs to match * @param test * @return {Promise} */ export declare function fileExists(p: ProjectAsync, globPatterns: GlobOptions, test: (f: File) => boolean): Promise; /** * Gather data from a set of files * @param project project to act on * @param globPatterns glob patterns for files to match * @param gather function that saves a value from a file or discards it * by returning undefined * @return {Promise} */ export declare function saveFromFiles(project: ProjectAsync, globPatterns: GlobOptions, gather: (f: File) => T | undefined): Promise; /** * Same as saveFromFiles, but works with promise returns * @param {ProjectAsync} project to act on * @param {string} globPatterns glob pattern for files to match * @param {(f: File) => Promise} gather function returning a promise from each file * @return {Promise} */ export declare function saveFromFilesAsync(project: ProjectAsync, globPatterns: GlobOptions, gather: (f: File) => Promise | undefined): Promise; /** * 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; //# sourceMappingURL=projectUtils.d.ts.map