import type { WorkspaceEntry } from "./useWorkspaceEntries.js";
import type { WorkspaceFileLister } from "./WorkspaceFileLister.js";
import { type WorkspaceFileMatch } from "./matchWorkspaceFiles.js";
/** Options for {@link useWorkspaceFileSearch}. */
export interface UseWorkspaceFileSearchOptions {
    /** All workspace entries to search across. */
    readonly entries: readonly WorkspaceEntry[];
    /** Platform-injected file lister. `undefined` → nothing is searchable. */
    readonly lister: WorkspaceFileLister | undefined;
    /** Current search query. Empty/whitespace yields no matches (search shows a hint). */
    readonly query: string;
}
/** Matches (and per-entry status) for one workspace entry. */
export interface WorkspaceFileSearchGroup {
    /** The workspace entry these matches belong to. */
    readonly entry: WorkspaceEntry;
    /** Ranked matches within this entry, best-first. */
    readonly matches: readonly WorkspaceFileMatch[];
    /** `true` when this entry's listing was truncated (repository too large). */
    readonly truncated: boolean;
    /** Listing error for this entry, if any (isolated — other entries still resolve). */
    readonly error: Error | null;
}
/** Return value of {@link useWorkspaceFileSearch}. */
export interface UseWorkspaceFileSearchReturn {
    /** Entries with something to show (matches, an error, or a truncation notice). */
    readonly groups: readonly WorkspaceFileSearchGroup[];
    /** Total matches across all groups (for a "showing N of M" affordance). */
    readonly totalMatches: number;
    /** `true` while any entry's listing is still loading. */
    readonly isLoading: boolean;
    /** `true` when no substrate can be searched (no lister, or every entry unsupported). */
    readonly isUnsupported: boolean;
    /** First per-entry error, for a top-level fallback message. `null` when none. */
    readonly error: Error | null;
}
/**
 * Behavior hook powering workspace-wide filename/path search.
 *
 * Loads each entry's listing through the shared
 * {@link loadEntryFiles} cache (warm from
 * Files browsing → usually free), then ranks matches per entry with the pure
 * {@link matchWorkspaceFiles}. Fetching is keyed by the set of entry ids, so a
 * query change re-ranks the already-loaded listings without re-fetching. Errors
 * are isolated per entry (one failing repo never blanks the rest), and a stale
 * generation's late resolutions are ignored.
 *
 * Meant to be consumed by a component mounted only while Search is active
 * (`WorkspaceFileSearch`), so the Files view incurs no search fetching.
 *
 * @example
 * ```tsx
 * const { groups, totalMatches, isLoading } = useWorkspaceFileSearch({
 *   entries: workspace.entries,
 *   lister: workspaceFileLister,
 *   query,
 * });
 * ```
 */
export declare function useWorkspaceFileSearch({ entries, lister, query, }: UseWorkspaceFileSearchOptions): UseWorkspaceFileSearchReturn;
//# sourceMappingURL=useWorkspaceFileSearch.d.ts.map