/// import Client from "./client"; import FileSystemElement from "./fileSystemElement"; import Folder from "./folder"; /** * The file class represents a file in nextcloud. * It exposes file properties and content handling, commenting and tagging */ export default class File implements FileSystemElement { private memento; private client; constructor(client: Client, name: string, baseName: string, lastmod: string, size: number, mime: string, id: number); /** * The name of the file including the path * The name is readonly */ get name(): string; /** * The base name of the file (file name without path) * The base name is readonly */ get baseName(): string; /** * The timestamp of the last file change * readonly */ get lastmod(): Date; /** * The file size in bytes * readonly */ get size(): number; /** * The mime type (content type) of the file */ get mime(): string; /** * The unique id of the file. */ get id(): number; /** * deletes a file * @throws Error */ delete(): Promise; /** * get folder of the file * @throws ClientError * @returns the parent folder */ getFolder(): Promise; /** * moves or renames the current file to the new location * target folder must exists * @param targetFileName the name of the target file /f1/f2/myfile.txt * @throws Error */ move(targetFileName: string): Promise; /** * @returns the buffer of the file content * @throws Error */ getContent(): Promise; /** * @returns the url of the file * @throws Error */ getUrl(): string; /** * @returns the url of the file in the UI * @throws Error */ getUIUrl(): string; /** * adds a tag name to the file * @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 file * @param comment the comment */ addComment(comment: string): Promise; /** * get list of comments of file * @param top number of comments to return * @param skip the offset * @returns array of comment strings * @throws Exception */ getComments(top?: number, skip?: number): Promise; private assertExistence; }