- Introduced a new `webdav-component` package for WebDAV protocol handling. - Implemented `webdav.ts` with functions for managing WebDAV operations such as listing directories, checking file existence, creating folders, deleting paths, moving files, and handling file uploads/downloads. - Added path normalization and utility functions for handling WebDAV paths. - Enhanced the `Tag` class in `webdav3.py` to correctly register XML namespaces, improving compatibility with WebDAV responses.
57 lines
2.6 KiB
TypeScript
57 lines
2.6 KiB
TypeScript
/**
|
||
* @webdav-component
|
||
*
|
||
* A modular WebDAV navigator for the browser.
|
||
*
|
||
* Three layers, each usable on its own:
|
||
*
|
||
* 1. `WebDAVClient` – low-level WebDAV protocol (PROPFIND, list, COPY, MOVE, PUT, GET, DELETE, MKCOL).
|
||
* 2. `WebDAVManager` – high-level actions built on top of the client (open, navigate, rename,
|
||
* copy, move, mkdir, upload, download, WOPI). No DOM dependency.
|
||
* 3. `WebDAVUI` – the default file-browser DOM component. Wraps a manager and renders
|
||
* the file table, toolbar, dialogs, drag/drop, etc.
|
||
*
|
||
* Quick start (with UI):
|
||
*
|
||
* ```ts
|
||
* import { WebDAVManager, WebDAVUI } from 'webdav-component';
|
||
* import 'webdav-component/style.css';
|
||
*
|
||
* const manager = new WebDAVManager({
|
||
* url: 'https://example.com/remote.php/webdav/',
|
||
* username: 'me',
|
||
* password: 'secret',
|
||
* });
|
||
* const ui = new WebDAVUI(manager);
|
||
* ui.start();
|
||
* ```
|
||
*
|
||
* Headless usage (no DOM):
|
||
*
|
||
* ```ts
|
||
* import { WebDAVManager } from 'webdav-component';
|
||
*
|
||
* const manager = new WebDAVManager({ url: 'https://example.com/remote.php/webdav/' });
|
||
* const listing = await manager.open('https://example.com/remote.php/webdav/Music/');
|
||
* for (const entry of Object.values(listing)) {
|
||
* console.log(entry.name, entry.size, entry.modified);
|
||
* }
|
||
* ```
|
||
*
|
||
* @packageDocumentation
|
||
*/
|
||
export { WebDAVClient, WebDAVError, PROPFIND_LIST_BODY, PROPFIND_WOPI_BODY } from './protocol/client.js';
|
||
export { parsePropfindListing } from './protocol/parse.js';
|
||
export { PERMISSION_CODES, hasPermission, hasPermissionOrDefault } from './protocol/permissions.js';
|
||
export { WebDAVManager } from './operations/manager.js';
|
||
export { WopiRegistry } from './operations/wopi.js';
|
||
export { WebDAVUI } from './ui/component.js';
|
||
export { TextEditor } from './ui/editor.js';
|
||
export { buildPageTemplate, buildDialogTemplate, buildParentRow, buildDirRow, buildFileRow, buildPasteWidget, renderEntry, } from './ui/templates.js';
|
||
export { normalizeURL, joinURL, dirname, basename, parentCollectionURL, stripHostPrefix, } from './utils/url.js';
|
||
export { template, htmlEscape, formatBytes, formatDate, makeTranslate } from './utils/format.js';
|
||
export type { DownloadResult, NavigationEvent, PermissionCode, Permissions, ProgressInfo, SelectionChangeEvent, SortOrder, WebDAVAuth, WebDAVClientOptions, WebDAVEntry, WebDAVListing, WebDAVManagerOptions, } from './types.js';
|
||
export type { WebDAVUIOptions } from './ui/component.js';
|
||
export type { WopiApp } from './operations/wopi.js';
|
||
export type { TextEditorDeps } from './ui/editor.js';
|
||
//# sourceMappingURL=index.d.ts.map
|