import { Cancellation, FileSystemNode, FileSystemProvider, URI } from "langium"; /** * Represents the result of visiting a file or directory during traversal. */ type WalkFolderResult = void | { /** If true, the traversal should stop immediately. */ break?: boolean; /** If true, the current directory should be skipped (only applicable to onDir). */ skipDir?: boolean; }; /** Defines the visitor functions to be called during directory traversal. */ type WalkFolderVisitor = { /** * Called for each file encountered. * @param file The URI of the file. * @returns A WalkFolderResult to control traversal. */ File?: (file: URI) => Promise | WalkFolderResult; /** * Called for each directory encountered. * @param dir The URI of the directory. * @param entries The entries (files and subdirectories) within the directory. * @returns A WalkFolderResult to control traversal. */ Dir?: (dir: URI, entries: FileSystemNode[]) => Promise | WalkFolderResult; }; /** * Traverses a directory asynchronously, applying visitor functions to files and directories. * @param svcs The shared services containing the file system provider. * @param location The starting URI of the directory to traverse. * @param visitor The visitor object with optional onFile and onDir methods. * @param cancel A cancellation token to stop the traversal. * @returns A Promise that resolves when the traversal is complete or cancelled. */ export declare function WalkDirectory(fs: FileSystemProvider, location: URI, visitor: WalkFolderVisitor, cancel?: Cancellation.CancellationToken): Promise; export {};