/// import * as Diff from 'diff'; import { IPatch, IFileChange } from './types'; /** * This class contains static methods for manipulating files. * In addition support for watching file changes. */ export declare class FS { private static IGNORE_WINDOWS_FILES; private static IGNORE_FOLDERS; private static readonly watchOptions; static readonly SHADOW_RELATIVE_PATH = ".shadow"; /** * Takes in some compressed zip data and unzips it. * @param buffer the data we want to unzip. */ protected static unzipBuffer(buffer: Buffer): Promise; /** * Will save the zip file. * @param unzipped the unzipped object. * @param savePath where we should save the data. */ protected static saveBuffer(unzipped: any, savePath: string): Promise; /** * This will unzip the data and save it. * @param savePath where we should unzip and save the data. * @param buffer the zip data. */ static unzip(savePath: string, buffer: Buffer): Promise; /** * This will zip a directory and return it as binary data. * @param path the path to the directory we want to zip. */ static zip(path: string): Promise; /** * This method will apply a file patch in the shadow folder. * @param source the source folder path. * @param iPatch the file patch we want to apply in the shadow folder (this comes from the server). */ static applyPatches(source: string, iPatch: IPatch): Promise; /** * This method will compare two files and return the difference. * @param source the source folder path. * @param filePath the path to the file that we want to use in the comparison. */ static getDiff(source: string, filePath: string): Promise; /** * By calling this method you will begin to listen for FILE_MODIFIED in the source folder directory. * @param source the source folder path. * @param onPatch a callback function that will be called upon a file patch. */ static listenForLocalPatches(source: string, onPatch: (patch: IPatch) => void): void; /** * By calling this method you will begin to listen for FILE_CREATED, FILE_DELETED, DIR_CREATED and DIR_DELETED in the source folder directory. * @param source the source folder path. * @param onFileChange a callback function that will be called upon a file change. */ static listenForLocalFileChanges(source: string, onFileChange: (fileChange: IFileChange) => void): void; /** * This code will apply a file change in the shadow folder. * @param source the source folder path. * @param fileChange the file change we want to apply in the shadow folder (this comes from the server). */ static applyFileChange(source: string, fileChange: IFileChange): Promise; /** * This method will create a new shadow folder and unzip a buffer into it. * @param source the source folder path. * @param buffer this is zip data (comes from the server). */ static createShadow(source: string, buffer: Buffer): Promise; }