/// import NCClient from "./ncClient"; import NCFile from "./ncFile"; export default class NCFolder { name: string; baseName: string; lastmod: Date; private client; private id; constructor(client: NCClient, name: string, baseName: string, lastmod: string, id?: number); /** * @returns an array of subfolders * @throws Error */ getSubFolders(): Promise; /** * returns true if the current folder has a subfolder with the given base name * @param subFolderBaseName the base name of the subfolder like "products" */ hasSubFolder(subFolderBaseName: string): Promise; /** * @returns all files of the folder */ getFiles(): Promise; /** * creates a subfolder * @param subFolderBaseName name of the subfolder basename */ createSubFolder(subFolderBaseName: string): Promise; /** * get a file by basename * @param fileBaseName the base name of the file * @returns the file of null * @throws Error */ getFile(fileBaseName: string): Promise; /** * creates a file in the folder * @param fileBaseName the base name of the file * @param data the buffer with file content * @returns the new file or null * @throws Error */ createFile(fileBaseName: string, data: Buffer): Promise; /** * deletes the folder and the contained files * @throws Error */ delete(): Promise; /** * renames or moves the current folder to the new location * target folder must exists * @param targetFolderName the name of the target folder /f1/f2/target * @throws Error */ move(targetFolderName: string): Promise; /** * @returns the url of the folder * @throws Error */ getUrl(): string; /** * @returns the url of the folder in the UI * @throws Error */ getUIUrl(): Promise; /** * @returns the id of the folder, -1 if the folder has been deleted * @throws Error */ getId(): Promise; /** * @returns true if the folder contains a file with the given basename * @param fileBaseName file basename * @throws Error */ containsFile(fileBaseName: string): Promise; /** * adds a tag name to the folder * @param tagName name of the tag */ addTag(tagName: string): Promise; /** * get tag names * @returns array of tag names */ getTags(): Promise; /** * removes a tag of the file * @param tagName the name of the tag */ removeTag(tagName: string): Promise; /** * add comment to folder * @param comment the comment */ addComment(comment: string): Promise; /** * get list of comments of folder * @param top number of comments to return * @param skip the offset * @returns array of comment strings * @throws Exception */ getComments(top?: number, skip?: number): Promise; }