import { FileTreeBatchOperation, FileTreeControllerOptions, FileTreeDragAndDropConfig, FileTreeDropTarget, FileTreeItemHandle, FileTreeMoveOptions, FileTreeMutationEventForType, FileTreeMutationEventType, FileTreeMutationHandle, FileTreeRemoveOptions, FileTreeResetOptions, FileTreeResetPreparedOptions, FileTreeScrollToPathOptions, FileTreeSearchSessionHandle, FileTreeVisibleRow } from "./publicTypes.js"; import { FileTreeControllerListener, FileTreeScrollRequest, FileTreeStickyRowCandidate } from "./internalTypes.js"; //#region src/model/FileTreeController.d.ts interface FileTreeRenameViewState { cancel(): void; commit(): void; getPath(): string | null; getValue(): string; isActive(): boolean; setValue(value: string): void; } interface FileTreeStartRenamingOptions { removeIfCanceled?: boolean; } declare const FILE_TREE_RENAME_VIEW: unique symbol; interface FileTreeController { [FILE_TREE_RENAME_VIEW](): FileTreeRenameViewState; } /** * Owns the live PathStore instance and exposes a path-first boundary without * leaking internal store IDs. */ declare class FileTreeController implements FileTreeMutationHandle, FileTreeSearchSessionHandle { #private; constructor(options: FileTreeControllerOptions); destroy(): void; focusFirstItem(): void; focusLastItem(): void; focusNextItem(): void; focusParentItem(): void; focusPath(path: string): void; scrollToPath(path: string, options?: FileTreeScrollToPathOptions): void; focusMountedPathFromInput(path: string): void; focusNearestPath(path: string | null): string | null; focusPreviousItem(): void; getFocusedIndex(): number; getFocusedItem(): FileTreeItemHandle | null; getFocusedPath(): string | null; getScrollRequest(): FileTreeScrollRequest | null; clearScrollRequest(id: number): void; resolveNearestVisiblePath(path: string | null): string | null; getSelectedPaths(): readonly string[]; getSelectionVersion(): number; getVisibleCount(): number; getVisibleRows(start: number, end: number): readonly FileTreeVisibleRow[]; getStickyRowCandidates(scrollTop: number, itemHeight: number): readonly FileTreeStickyRowCandidate[] | null; /** * Returns the item handle for the given path. * * Accepts both canonical directory paths (`src/`) and bare directory lookup * paths (`src`) so callers do not need to know the canonical slash rules. */ getItem(path: string): FileTreeItemHandle | null; resolveMountedDirectoryPathFromInput(path: string): string | null; toggleMountedDirectoryFromInput(path: string): void; selectAllVisiblePaths(): void; selectOnlyPath(path: string): void; selectOnlyMountedPathFromInput(path: string): void; selectPath(path: string): void; deselectPath(path: string): void; toggleFocusedSelection(): void; togglePathSelection(path: string): void; togglePathSelectionFromInput(path: string): void; selectPathRange(path: string, unionSelection: boolean): void; extendSelectionFromFocused(offset: -1 | 1): void; getDragAndDropConfig(): FileTreeDragAndDropConfig | null; isDragAndDropEnabled(): boolean; getDragSession(): { draggedPaths: readonly string[]; primaryPath: string; target: FileTreeDropTarget | null; } | null; startDrag(path: string): boolean; setDragTarget(target: FileTreeDropTarget | null): void; cancelDrag(): void; completeDrag(): boolean; subscribe(listener: FileTreeControllerListener): () => void; /** * Applies one file/directory addition through the shared mutation handle * without exposing the raw store to tree consumers. */ add(path: string): void; remove(path: string, options?: FileTreeRemoveOptions): void; move(fromPath: string, toPath: string, options?: FileTreeMoveOptions): void; batch(operations: readonly FileTreeBatchOperation[]): void; onMutation(type: TType, handler: (event: FileTreeMutationEventForType) => void): () => void; setSearch(value: string | null): void; openSearch(initialValue?: string): void; closeSearch(): void; isSearchOpen(): boolean; getSearchValue(): string; getSearchMatchingPaths(): readonly string[]; focusNextSearchMatch(): void; focusPreviousSearchMatch(): void; startRenaming(path?: string, options?: FileTreeStartRenamingOptions): boolean; /** * Rebuilds the controller around a new full path set. This is intentionally a * coarse whole-tree reset path rather than a localized mutation fast path. */ resetPaths(paths: readonly string[], options?: FileTreeResetOptions): void; resetPaths(options: FileTreeResetPreparedOptions): void; } //#endregion export { FILE_TREE_RENAME_VIEW, FileTreeController }; //# sourceMappingURL=FileTreeController.d.ts.map