import { ViewCompactFileFolder } from '../../../types/files'; export type ReorderItem = { id: string; type: 'file' | 'folder'; }; /** * Resolve the sort actually applied in the browser: an explicit per-visit choice * wins; otherwise a folder with a custom order defaults to it; otherwise the * user's saved sort. Kept pure (string in/out) so it's unit-testable and free of * a dependency on the store's SortOption type. */ export declare function resolveSortOption(manualOverride: string | null, folderHasCustomOrder: boolean, savedDefault: string): string; /** * The manual custom-sort position of a browser item, if one has been set. * Folders carry it on `order`; files under `metadata.pitcher.order`. */ export declare function getItemOrder(item: ViewCompactFileFolder): number | undefined; /** * Order a mixed list of files and folders by their custom position, falling back * to alphabetical for items without one (and to break ties). */ export declare function sortByCustomOrder(items: T[]): T[]; /** * Move every selected item to the top or bottom of the list, consolidating a * non-contiguous selection into a single contiguous block while preserving the * items' relative order (matches the "Send to top / Send to bottom" spec). */ export declare function moveSelectedTo(items: T[], selectedIds: ReadonlyArray, position: 'top' | 'bottom'): T[]; /** * Move a single dragged item directly above or below a target item (single-item * drag-and-drop reorder). Returns the input unchanged when the drag is a no-op * or references an item that is not in the list. */ export declare function moveItemRelativeTo(items: T[], draggedId: string | number, targetId: string | number, position: 'above' | 'below'): T[]; /** Project a displayed list into the `{ id, type }` payload the reorder API expects. */ export declare function toReorderItems(items: ViewCompactFileFolder[]): ReorderItem[];