import type { IFileExplorerClient } from './fileExplorer.js'; import type { TreeMap, TreeNode, TStorage, TStorageGroup, TStorageObject, UploadNode } from './types.js'; export declare function getFileExtension(filename: string): string | null; export declare function getNodeName(node: TStorageObject): string; export type TTree = { treeMap: TreeMap; parentToChildrenMap: Record; rootNodes: TreeNode[]; }; export type TTreeOptions = { listings: ReadonlyMap; forceUserHierarchy?: boolean; storageGroups?: readonly TStorageGroup[] | undefined; viewer?: string | undefined; unsortedParents?: ReadonlySet; }; /** One accumulator per listed directory, so a landed page costs the page and not * the tree. One builder per explorer instance. */ export declare function createTreeBuilder(): (storages: TStorage[], options: TTreeOptions) => TTree; export declare function getStorageRoots(parentToChildrenMap: Record, nodes: readonly TreeNode[]): TreeNode[]; export declare function getNodeChildren(parentToChildrenMap: Record, parentPath: string): TreeNode[]; export declare function getParentPath(currentPath: string): string; export type DirectoryNameError = 'reserved' | 'separator' | 'exists'; export declare function getDirectoryNameError(name: string, siblings: TreeNode[]): DirectoryNameError | null; export declare function getDirectoryObjectPath(parentNode: TreeNode, directoryName: string): string; export declare function getUploadNodesFromDataTransferItems(items: DataTransferItemList): Promise<{ uploadNodes: UploadNode[]; totalSize: number; }>; export declare function calculateUploadNodesTotalSize(uploadNodes: UploadNode[]): number; export declare function getObjectKeyFromNode(node: TreeNode): string; export declare function attachmentDisposition(filename: string): string; export declare function getDirectoryPrefixFromNode(node: TreeNode): string; export declare function pruneNodesInsideSelectedDirectories(nodes: TreeNode[]): TreeNode[]; export declare function collectObjectKeysToDelete(nodes: TreeNode[], listKeysUnderPrefix: (prefix: string) => Promise): Promise; /** True when a drag carries files or folders, not a link or text, such as a * row's own link dragged across the explorer. */ export declare function carriesFiles(dataTransfer: DataTransfer): boolean; export declare function getUriScheme(uri: string): string; export declare function removeLeadingSlash(path: string): string; export declare function removeLeadingAndTrailingSlashes(path: string): string; export declare function ensureTrailingSlash(path: string): string; export declare function isClientValid(client: IFileExplorerClient): boolean; export declare function getUploadSessionETA(totalLoadedBytes: number, totalSizeBytes: number, lastProgressTime?: number, lastProgressBytes?: number): { estimatedSecondsLeft?: number; lastProgressTime: number; lastProgressBytes: number; shouldUpdateETA: boolean; }; export declare function exceededTransferLimit(node: TreeNode, storage: TStorage | null | undefined): number | undefined;