import { type ReactNode } from "react"; import type { FileTreeNode, UseSandboxFilesResult } from "../hooks/use-sandbox-files.js"; import { type FileNodeVisibilityPredicate } from "../file-node-visibility.js"; export type FileBrowserProps = { /** From `useSandboxFiles(...)`. */ result: UseSandboxFilesResult; /** * Rendered instead of the built-in tree when the file surface is unavailable * (e.g. a `FileSystem.available === false` capability). Default: a quiet notice. */ fallback?: ReactNode | undefined; /** Selection callback for the preview pane. */ onSelectFile?: ((path: string) => void) | undefined; selectedPath?: string | undefined; /** Presentation-only node filter. Hidden parents never expose their children. */ isNodeVisible?: FileNodeVisibilityPredicate | undefined; /** Deliberately reveal this selected path by lazily opening every loaded * ancestor and scrolling its row into view. The path is opaque and is never * normalized or re-rooted here. */ revealPath?: string | undefined; /** Increment/change to reveal the same path again after a user collapses it. */ revealPathRequestId?: string | number | undefined; /** Render-prop to theme/replace a row entirely (the Pierre-swap escape hatch). */ renderNode?: ((node: FileTreeNode, depth: number, expanded: boolean) => ReactNode) | undefined; /** Shown when the tree is empty (no files / not loaded yet). */ emptyState?: ReactNode | undefined; /** * Enable the file-manager affordances (toolbar, context menu, drag-drop move, * inline rename, delete, new file/folder). Defaults to `true` when the hook * exposes the mutation methods; pass `false` for a strictly read-only tree. */ editable?: boolean | undefined; /** * Confirm a (recursive) delete before it runs. Return `false` to cancel. * The default is an accessible, non-blocking confirmation dialog. Supply this * callback to delegate confirmation to a host-owned dialog. */ confirmDelete?: ((node: FileTreeNode) => boolean | Promise) | undefined; className?: string | undefined; }; /** * The file MANAGER, fed by the FileSystem service via `useSandboxFiles`. This is * a first-class editable tree (not a render-only view): lazy-expand with a * spinner on the in-flight node, git-status tinting, full keyboard navigation, * selection, and the mutating affordances wired straight to the hook — * * • drag-and-drop MOVE → `moveEntry(from, to)` * • inline RENAME → `moveEntry(path, newPath)` (F2 / double-click / menu) * • DELETE → `deleteEntry(path, recursive)` (Del / menu, confirmed) * • NEW FILE / FOLDER → `createFile` / `createDir` (toolbar + menu), then open * • right-click CONTEXT MENU * * `renderNode` is still honoured as the Pierre-swap escape hatch for the row * chrome; the manager scaffolding (toolbar, dnd, menu, inline inputs) wraps it. */ export declare function FileBrowser({ result, fallback, onSelectFile, selectedPath, isNodeVisible, revealPath, revealPathRequestId, renderNode, emptyState, editable, confirmDelete, className, }: FileBrowserProps): import("react").JSX.Element;