/** * Finds out where a drag-out was dropped, by looking for what the shell wrote. * * Windows never tells the source application where a drop landed: it serves a * `DownloadURL` through the shell, which fetches the URL and writes the file * itself, so Chromium — and therefore Electron — only ever sees the request * (piège #58). The way around it is to stop announcing the payload and announce * a **uniquely named empty marker** instead: the shell writes *that* into the * drop folder, and finding it is what reveals the folder. * * This is a heuristic and is documented as one. It sweeps the places a drop * plausibly lands — the desktop, the downloads folder, every open Explorer * window, and one level of subdirectories of each, because dropping onto a * folder *icon* inside a window lands inside that folder. A drop anywhere else * is not found, and the caller falls back to a known directory rather than * failing. */ export declare class SidebarPlusDropLocator { /** * Waits for `markerName` to appear in one of the plausible drop folders. * * Returns the folder that received it, having deleted the marker; `null` if * it never turned up. Deletion is best effort: a marker held open by the * shell still identifies the right folder, so a failure to remove it is not * a failure to locate. */ locate(markerName: string): Promise; /** Where a file is delivered when the drop folder cannot be found. */ fallbackFolder(): string; /** * The folders worth sweeping, widest first. * * Built once per drop rather than per sweep: enumerating shell windows * costs a process launch, and the set of open windows does not meaningfully * change between two sweeps 300 ms apart. */ private candidateFolders; private childDirectories; /** * Paths of every open Explorer window. * * Asked of the shell itself through COM, which is the only thing that knows * them. There is no Node API for this and no Electron one either, hence the * out-of-process hop; measured at ~50 ms on the development machine, paid * once per drop. * * A window showing a virtual location (This PC, a search result) has no * filesystem path and throws on `Self.Path`; those are skipped rather than * failing the enumeration. */ private explorerFolders; }