The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/definition/webdav.ts

32 lines
1.7 KiB

export type Stat = {
filename: string;
basename: string;
lastmod: string|null;
size: number;
type: string;
mime: string;
etag: string|null;
props: Record<string, any>;
}
export type WebDavClient = {
copyFile(remotePath: string, targetRemotePath: string, options?: Record<string, any>): Promise<any>;
createDirectory(dirPath: string, options?: Record<string, any>): Promise<Response>;
createReadStream(remoteFileName: string, options?: Record<string, any>): ReadableStream;
createWriteStream(remoteFileName: string, options?: Record<string, any>, callback?: Function): WritableStream;
customRequest(remotePath: string, requestOptions: Record<string, any>, options?: Record<string, any>): Promise<any>;
deleteFile(remotePath: string, options?: Record<string, any>): Promise<Response>;
exists(remotePath: string, options?: Record<string, any>): Promise<boolean>;
getDirectoryContents(remotePath: string, options?: Record<string, any>): Promise<Array<Stat>>;
getFileContents(remoteFileName: string, options?: Record<string, any>): Promise<Buffer|string>;
getFileDownloadLink(remoteFileName: string, options?: Record<string, any>): string;
getFileUploadLink(remoteFileName: string, options?: Record<string, any>): string;
getQuota(options?: Record<string, any>): Promise<null|object>;
moveFile(remotePath: string, targetRemotePath: string, options?: Record<string, any>): Promise<any>;
putFileContents(remoteFileName: string, data: string|Buffer, options?: Record<string, any>): Promise<any>;
stat(remotePath: string, options?: Record<string, any>): Promise<any>;
}
declare module 'webdav' {
export function createClient(remoteURL: string, opts?: Record<string, any>): WebDavClient;
}