import { FileStat, WebDAVClient } from 'webdav'; import { Node } from '../node/index.ts'; /** * Get the DAV root path for the current user or public share */ export declare function getRootPath(): string; /** * The DAV root path for the current user * This is a cached version of `getRemoteURL` */ export declare const defaultRootPath: string; /** * Get the DAV remote URL used as base URL for the WebDAV client * It also handles public shares */ export declare function getRemoteURL(): string; /** * The DAV remote URL used as base URL for the WebDAV client * This is a cached version of `getRemoteURL` */ export declare const defaultRemoteURL: string; /** * Get a WebDAV client configured to include the Nextcloud request token * * @param remoteURL The DAV server remote URL * @param headers Optional additional headers to set for every request */ export declare function getClient(remoteURL?: string, headers?: Record): WebDAVClient; /** * Use WebDAV to query for favorite Nodes * * @param options - Options for the favorite query * @param options.client - The WebDAV client to use for performing the request * @param options.path - Base path for the favorites, if unset all favorites are queried * @param options.davRoot - The root path for the DAV user (defaults to `defaultRootPath`) * @param options.signal - Optional abort signal to cancel the request * * @example * ```js * import { getFavoriteNodes } from '@nextcloud/files' * * // query favorites for the root * const favorites = await getFavoriteNodes() * ``` * @example * ```js * // Advanced usage with custom client and path * import { getClient, defaultRootPath, getFavoriteNodes } from '@nextcloud/files' * * const client = getClient() * const controller = new AbortController() * const favoritesPromise = getFavoriteNodes({ client, path: '/some/folder', signal: controller.signal }) * // you can abort the request if needed * controller.abort() * // or await the result * const favorites = await favoritesPromise * ``` */ export declare function getFavoriteNodes(options?: { client?: WebDAVClient; path?: string; davRoot?: string; signal?: AbortSignal; }): Promise; /** * Convert DAV result `FileStat` to `Node` * * @param node The DAV result * @param filesRoot The DAV files root path * @param remoteURL The DAV server remote URL (same as on `getClient`) */ export declare function resultToNode(node: FileStat, filesRoot?: string, remoteURL?: string): Node;