import { FileSystem } from "../../system/directory"; export declare class CFSCore { private rootPath; private qfs; private deletedFolder; private deletionFolderPromise; private createDeletionFolder; constructor(rootPath: string, qfs: FileSystem); /** * READ operation of CFS. Reads given file. May lead to tree traversal if file is not found. * @param filePath Path to the file. * @returns {*} Promise for file content. */ read(filePath: string): Promise; /** * READ operation of CFS. Reads given file. May lead to tree traversal if file is not found. * @param filePath Path to the file. * @returns {*} Promise for file content. */ exists(filePath: string): Promise; /** * LIST operation of CFS. List files at given location. Tree traversal. * @param ofPath Location folder to list files. * @param localLevel Limit listing to local level. * @returns {*} Promise of file names. */ list(ofPath: string): Promise; /** * WRITE operation of CFS. Writes the file in local Core. * @param filePath Path to the file to write. * @param content String content to write. * @param deep Wether to make a deep write or not. */ write(filePath: string, content: string, deep: boolean): Promise; /** * REMOVE operation of CFS. Set given file as removed. Logical deletion since physical won't work due to the algorithm of CFS. * @param filePath File to set as removed. * @param deep Wether to remove the file in the root core or not. * @returns {*} Promise of removal. */ remove(filePath: string, deep?: boolean): Promise; /** * REMOVE operation of CFS. Set given file as removed. Logical deletion since physical won't work due to the algorithm of CFS. * @param filePath File to set as removed. * @returns {*} Promise of removal. */ removeDeep(filePath: string): Promise; /** * Create a directory tree. * @param treePath Tree path to create. */ makeTree(treePath: string): Promise; /** * Write JSON object to given file. * @param filePath File path. * @param content JSON content to stringify and write. * @param deep Wether to make a deep write or not. */ writeJSON(filePath: string, content: any, deep?: boolean): Promise; /** * Write JSON object to given file deeply in the core structure. * @param filePath File path. * @param content JSON content to stringify and write. */ writeJSONDeep(filePath: string, content: any): Promise; /** * Read a file and parse its content as JSON. * @param filePath File to read. */ readJSON(filePath: string): Promise; /** * Read contents of files at given path and parse it as JSON. * @param dirPath Path to get the files' contents. * @param localLevel Wether to read only local level or not. */ listJSON(dirPath: string): Promise; /** * Read contents of files at given LOCAL path and parse it as JSON. * @param dirPath Path to get the files' contents. */ listJSONLocal(dirPath: string): Promise; /** * Normalize the path of a dir to be used for file deletion matching. * @param dirPath Directory path to normalize. * @returns {string|ng.ILocationService|XML} Normalized dir path. */ private toRemoveDirName; /** * Normalize the name of the deleted file. * @param filePath Full path of the file, included file name. * @returns {string|ng.ILocationService|XML} Normalized file name. */ private toRemoveFileName; fsStreamTo(filename: string, iterator: IterableIterator): Promise; }