AnyMux

WebDAV API reference

Exports of @anymux/webdav. Back to the module

Classes

WebDAVFileSystem

class
class WebDAVFileSystem

promises

property
promises: this

constants

property
constants: FSConstants

constructor

constructor
constructor(config: WebDAVConfig): WebDAVFileSystem

readFile

method
readFile(path: string, options?: { encoding?: BufferEncoding; flag?: string; } | BufferEncoding): Promise<Buffer | string>

writeFile

method
writeFile(path: string, data: Buffer | string | Uint8Array, _options?: { encoding?: BufferEncoding; mode?: number; flag?: string; }): Promise<void>

stat

method
stat(path: string, options?: { bigint?: false; }): Promise<Stats>

stat

method
stat(path: string, options: { bigint: true; }): Promise<BigIntStats>

stat

method
stat(path: string, _options?: { bigint?: boolean; }): Promise<Stats | BigIntStats>

readdir

method
readdir(path: string, options?: { encoding?: BufferEncoding; withFileTypes?: false; recursive?: boolean; }): Promise<string[]>

readdir

method
readdir(path: string, options: { encoding?: BufferEncoding; withFileTypes: true; recursive?: boolean; }): Promise<Dirent[]>

readdir

method
readdir(path: string, options?: { encoding?: BufferEncoding; withFileTypes?: boolean; recursive?: boolean; }): Promise<string[] | Dirent[]>

mkdir

method
mkdir(path: string, options?: { recursive?: boolean; mode?: number; }): Promise<string | undefined>

unlink

method
unlink(path: string): Promise<void>

rmdir

method
rmdir(path: string, _options?: { maxRetries?: number; recursive?: boolean; retryDelay?: number; }): Promise<void>

rename

method
rename(oldPath: string, newPath: string): Promise<void>

copyFile

method
copyFile(src: string, dest: string, _mode?: number): Promise<void>

access

method
access(path: string, _mode?: number): Promise<void>

exists

method
exists(path: string): Promise<boolean>

rm

method
rm(path: string, options?: { force?: boolean; maxRetries?: number; recursive?: boolean; retryDelay?: number; }): Promise<void>

appendFile

method
appendFile(_path: string, _data: Buffer | string | Uint8Array, _options?: { encoding?: BufferEncoding; mode?: number; flag?: string; }): Promise<void>

lstat

method
lstat(path: string, options?: { bigint?: false; }): Promise<Stats>

lstat

method
lstat(path: string, options: { bigint: true; }): Promise<BigIntStats>

lstat

method
lstat(_path: string, _options?: { bigint?: boolean; }): Promise<Stats | BigIntStats>

chmod

method
chmod(_path: string, _mode: string | number): Promise<void>

chown

method
chown(_path: string, _uid: number, _gid: number): Promise<void>

readlink

method
readlink(_path: string, _options?: { encoding?: BufferEncoding; }): Promise<string>

symlink

method
symlink(_target: string, _path: string, _type?: "dir" | "file" | "junction"): Promise<void>

link

method
link(_existingPath: string, _newPath: string): Promise<void>

truncate

method
truncate(_path: string, _len?: number): Promise<void>

utimes

method
utimes(_path: string, _atime: string | number | Date, _mtime: string | number | Date): Promise<void>

createReadStream

method
createReadStream(_path: string, _options?: { encoding?: BufferEncoding; start?: number; end?: number; }): ReadStream

createWriteStream

method
createWriteStream(_path: string, _options?: { encoding?: BufferEncoding; flags?: string; mode?: number; }): WriteStream

watch

method
watch(_path: string, _options?: { encoding?: BufferEncoding; persistent?: boolean; recursive?: boolean; }): FSWatcher

open

method
open(_path: string, _flags?: string | number, _mode?: number): Promise<IFileHandle>

opendir

method
opendir(_path: string, _options?: { encoding?: BufferEncoding; bufferSize?: number; recursive?: boolean; }): Promise<IDir>

realpath

method
realpath(_path: string, _options?: { encoding?: BufferEncoding; }): Promise<string>

cp

method
cp(_src: string, _dest: string, _options?: { dereference?: boolean; errorOnExist?: boolean; filter?: (src: string, dest: string) => boolean | Promise<boolean>; force?: boolean; mode?: number; preserveTimestamps?: boolean; recursive?: boolean; verbatimSymlinks?: boolean; }): Promise<void>

mkdtemp

method
mkdtemp(_prefix: string, _options?: { encoding?: BufferEncoding; }): Promise<string>

statfs

method
statfs(path: string, options?: { bigint?: false; }): Promise<StatFs>

statfs

method
statfs(path: string, options: { bigint: true; }): Promise<BigIntStatFs>

statfs

method
statfs(_path: string, _options?: { bigint?: boolean; }): Promise<StatFs | BigIntStatFs>

lutimes

method
lutimes(_path: string, _atime: string | number | Date, _mtime: string | number | Date): Promise<void>

lchown

method
lchown(_path: string, _uid: number, _gid: number): Promise<void>

lchmod

method
lchmod(_path: string, _mode: string | number): Promise<void>

isImplemented

method
isImplemented(method: string): boolean

Types

WebDAVConfig

type
type WebDAVConfig = { url?: string; username?: string; password?: string; authType?: "basic" | "digest" | "none"; headers?: Record<string, string>; }

Constants

WebDAVConfigSchema

const
const WebDAVConfigSchema: z.ZodObject<{ url: z.ZodString; username: z.ZodOptional<z.ZodString>; password: z.ZodOptional<z.ZodString>; authType: z.ZodOptional<z.ZodEnum<["basic", "digest", "none"]>>; headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; }, "strip", z.ZodTypeAny, { url?: string; username?: string; password?: string; authType?: "basic" | "digest" | "none"; headers?: Record<string, string>; }, { url?: string; username?: string; password?: string; authType?: "basic" | "digest" | "none"; headers?: Record<string, string>; }>