import type { SearchInWorkspaceClient, SearchInWorkspaceOptions, SearchInWorkspaceServer } from '../common/search-in-workspace-interface'; import { URI, ILogger } from '@theia/core'; import { FileService } from '@theia/filesystem/lib/browser/file-service'; export declare class BrowserSearchInWorkspaceServer implements SearchInWorkspaceServer { protected readonly logger: ILogger; protected readonly fs: FileService; private client; private ongoingSearches; private nextSearchId; /** * Sets the client for receiving search results */ setClient(client: SearchInWorkspaceClient | undefined): void; /** * Initiates a search operation and returns a search ID. * @param what - The search term or pattern * @param rootUris - Array of root URIs to search in * @param opts - Search options including filters and limits * @returns Promise resolving to the search ID */ search(what: string, rootUris: string[], opts?: SearchInWorkspaceOptions): Promise; /** * Cancels an ongoing search operation. * @param searchId - The ID of the search to cancel */ cancel(searchId: number): Promise; /** * Disposes the service by aborting all ongoing searches. */ dispose(): void; /** * Internal method to perform the search. * @param searchId - The ID of the search to perform. * @returns A promise that resolves when the search is complete. */ private doSearch; /** * Searches for matches within a file by processing it line by line. * @param uri - The file URI to search * @param re - The regex pattern to match * @param isAborted - Function to check if search was aborted * @param opts - File reading options * @param limit - Maximum number of matches to return * @returns Array of search matches found in the file */ private searchFileByLines; /** * Processes search options and returns clean paths and processed options. * This method consolidates the path processing logic and matchWholeWord handling for better readability. */ private processSearchOptions; /** * Checks if a path should be excluded based on exclude patterns. * @param uri - The URI to check * @param exclude - Array of exclude patterns * @returns True if the path should be excluded */ protected shouldExcludePath(uri: URI, exclude: string[] | undefined): boolean; /** * Checks if a path should be included based on include patterns. * @param uri - The URI to check * @param include - Array of include patterns * @returns True if the path should be included */ private shouldIncludePath; /** * The default search paths are set to be the root paths associated to a workspace * however the search scope can be further refined with the include paths available in the search options. * This method will replace the searching paths to the ones specified in the 'include' options but as long * as the 'include' paths can be successfully validated as existing. * * Therefore the returned array of paths can be either the workspace root paths or a set of validated paths * derived from the include options which can be used to perform the search. * * Any pattern that resulted in a valid search path will be removed from the 'include' list as it is * provided as an equivalent search path instead. */ protected extractSearchPathsFromIncludes(searchPaths: string[], include: string[]): Promise; } //# sourceMappingURL=browser-search-in-workspace-server.d.ts.map