/** Folders at the docs root that hold assets, never documents. */ export declare const RESERVED_ROOT_FOLDERS: Set; export declare class TreeMoveError extends Error { readonly status: number; constructor(status: number, message: string); } export interface TreeMoveRequest { /** POSIX path of the entry to move, relative to the docs folder. */ source: string; /** POSIX path of the destination folder; "" is the docs root. */ targetFolder: string; /** Position of the entry in the destination folder once moved; past the end appends. */ index: number; } export interface TreeRenameRequest { /** POSIX path of the entry to rename, relative to the docs folder. */ path: string; /** New file or folder name; `.md` is added to a document name without it. */ newName: string; } export interface TreeMoveResult { path: string; /** New document id (documents only), same as GET /api/tree. */ id?: string; } /** * Migrates the doc ids `from` → `to` (and, for a folder, every id below it) in * `.metadata.json`, `.annotations.json` and the favorites of `.living-doc.json`. */ export declare function migrateDocIds(docsPath: string, from: string, to: string, isFolder: boolean): void; /** * Forgets a deleted document (`relPath` ends in `.md`) or folder: the links * that pointed at it keep their text, and the doc-keyed stores drop its ids. */ export declare function forgetDeletedEntry(docsPath: string, relPath: string, isFolder: boolean): void; /** * Moves `absSource` into the existing folder `absTargetDir`. With an `index`, * the destination manifest `order` is rewritten with the entry at that * position; without one, the entry is appended like a new entry. Inside the * same folder only the manifest changes. Returns the new POSIX relative path. */ export declare function relocateEntry(docsPath: string, absSource: string, absTargetDir: string, index?: number): string; /** POST /api/tree/move: validates the request, then relocates the entry. */ export declare function moveTreeEntry(docsPath: string, request: TreeMoveRequest): TreeMoveResult; /** PUT /api/tree/rename: renames a visible entry in place, keeping its manifest position and state. */ export declare function renameTreeEntry(docsPath: string, request: TreeRenameRequest): TreeMoveResult; /** * DELETE /api/tree: deletes a folder and everything it contains. Its parent * manifest forgets it, incoming links are unlinked and the doc-keyed stores * drop the ids it held; a linked file inside is removed as a link, its target * is kept. */ export declare function deleteTreeFolder(docsPath: string, relPath: string): TreeMoveResult; //# sourceMappingURL=treeMove.d.ts.map