@documentica/webdav
Version:
Documentica Webdav Client
36 lines (35 loc) • 1.75 kB
TypeScript
import { IHeaders } from './types';
export declare type WebdavCallback = (status: number, body: any, statusText?: string, resourceName?: string, headers?: Headers) => void;
export declare type WebdavRequestType = {
config: IDavConfig;
method: string;
path: string;
headers?: IHeaders;
success: WebdavCallback;
fail?: WebdavCallback;
body?: any;
resourceName?: string;
responseType?: 'blob' | 'text' | 'xml' | 'json';
multistatus?: boolean;
progressListener?: (evt: ProgressEvent<XMLHttpRequestEventTarget>) => void;
loadListener?: (evt: ProgressEvent<XMLHttpRequestEventTarget>) => void;
};
export interface IDavConfig {
host: string;
defaultHeaders?: IHeaders;
withCredentials?: boolean;
defaultFail?: WebdavCallback;
authenticationMethod?: "digest" | "basic";
username?: string;
password?: string;
realm?: string;
supportedFeatures: {
currentUser?: boolean;
acl?: boolean;
modifyRootFolder?: boolean;
ignoreDotFiles?: boolean;
};
}
export declare function createWebdavRequest(req: WebdavRequestType): void | XMLHttpRequest;
export declare function createWebdavRequestFetch({ config: { defaultHeaders, host, withCredentials, defaultFail, authenticationMethod, username, password, realm, }, method, path, headers, success, fail, body, resourceName, responseType, multistatus, progressListener }: WebdavRequestType): void;
export declare function createWebdavRequestXHR({ config: { defaultHeaders, host, withCredentials, defaultFail, authenticationMethod, username, password, realm, }, method, path, headers, success, fail, body, resourceName, responseType, multistatus, progressListener }: WebdavRequestType): XMLHttpRequest;