/// import * as F from '../api/filesAPITypes'; import { Match } from '../request/requestBuidler'; import * as ResponseType from '../api/responseTypes'; interface FileStream { filename: string; meta: ResponseType.File; stream: NodeJS.ReadableStream; } /** * store one FileStream at the given baseDir. * @param baseDir where to download the file to. * @param stream the FileStream object generated by one of the file fetching apis. * @returns a flag that indicate if file is successfully written. */ export declare function store(baseDir: string, stream: FileStream): Promise; /** * @param path the path it store to. * @param stream */ export declare function storeByPath(filepath: string, stream: NodeJS.ReadableStream): Promise; /** * download a single file * @param * @returns a promise FileStream * * Note the filename received in `File` object will be url encoded. */ export declare function fetchFile(file: ResponseType.File): Promise; export declare function fetchFileByUrl(url: string): Promise<{ stream: NodeJS.ReadableStream; }>; /** * download files from a list of File * @param files A list of files that can come from any File[] return apis. * @return a promise of a list of binary file and there corresponding File. * File can be used to determine what to do with the binary buffer. */ export declare function fetchFiles(files: ResponseType.File[]): Promise[]>; /** * download all files from a folder * @param folder * @return */ export declare function fetchAllFromAFolder(folder: ResponseType.Folder, config: Match): Promise[]>; export declare function getFile(fileId: Match["id"], include: Match["include"]): Promise; export declare function getCourseFileQuota(courseId: Match["course_id"]): Promise<{ quota: number; quota_used: number; }>; export declare function getGroupFileQuota(groupId: Match["group_id"]): Promise<{ quota: number; quota_used: number; }>; export declare function getUserFileQuota(userId?: Match["user_id"]): Promise<{ quota: number; quota_used: number; }>; export declare const getQuota: () => Promise<{ quota: number; quota_used: number; }>; export declare function getCourseFiles(courseId: Match["course_id"], config: Match): Promise; export declare function getUserFiles(userId: Match["user_id"], config: Match): Promise; export declare const getFiles: (config: Match) => Promise; export declare function getGroupFiles(groupId: Match["group_id"], config: Match): Promise; export declare function getFilesOfAFolder(folderId: Match["id"], config: Match): Promise; export declare function updateFile(id: Match["id"], config: Match): Promise; export declare function deletFile(id: Match["id"], config: Match): Promise; export declare function getCourseFolders(courseId: Match["course_id"]): Promise; export declare function getUserFolders(userId?: Match["user_id"]): Promise; export declare function getGroupFolders(groupId: Match["group_id"]): Promise; export declare function getCourseFoldersByPath(courseId: Match["course_id"], path: string): Promise; export declare function getGroupFoldersByPath(groupId: Match["group_id"], path: string): Promise; export declare function getUserFoldersByPath(userId: Match["user_id"], path: string): Promise; export declare function getFolderInCourse(courseId: Match["course_id"], folderId: Match["id"]): Promise; export declare function getFolderOfUser(userId: Match["user_id"], folderId: Match["id"]): Promise; export declare function getFolderInGroup(groupId: Match["group_id"], folderId: Match["id"]): Promise; export declare function getFolder(folderId: Match["id"]): Promise; export declare function getFolders(folderId: Match["id"]): Promise; export declare function updateFolder(folderId: Match["id"], config: Match): Promise; export declare function createFolderInCourse(courseId: Match["course_id"], config: Match): Promise; export declare function createFolderOfUser(userId: Match["user_id"], config: Match): Promise; export declare function createFolderInGroup(groupId: Match["group_id"], config: Match): Promise; export declare function createFolder(folderId: Match["folder_id"], config: Match): Promise; export declare function deleteFolder(folderId: Match["id"], config: Match): Promise; export declare function uploadAFileENDPOINT(folderId: Match["folder_id"], config: Match): Promise<{ upload_url: string; upload_params: { [unspecified: string]: any; key?: string | undefined; }; }>; export declare function CopyAFile(destFolderId: Match["dest_folder_id"], config: Match): Promise; export declare function CopyAFolder(destFolderId: Match["dest_folder_id"], config: Match): Promise; export {};