import type { Accessor } from '../../../accessor/base.ts'; import { type DetectFn } from '../../../core/hierarchy/scope.ts'; import type { Searcher } from '../../../core/hierarchy/search.ts'; import type { PathSpec } from '../../../types.ts'; import type { CommandFnResult, CommandOpts } from '../../config.ts'; import { type FlagValue } from '../../spec/types.ts'; import { type CommandIO } from './adapter.ts'; export type QualifyFn = (paths: PathSpec[], flags: Record, pattern: string | null) => PathSpec | null; /** * Build a grep/rg handler: push a qualified search down, scan the rest. * * The handler is the shared shape every hierarchy backend's search wrapper * had by hand: qualify the line, classify the operand, hand a matched kind * to its searcher, and print the lines it answers (an empty answer is * grep's exit 1). Anything the push-down cannot answer, an unqualified * line, an unmatched kind, or a missing pattern, takes the generic scan * wired from the same `io` the backend's other commands use. `qualify` is * which lines may push down (`literalPushdownOperand` for a substring * backend, `pushdownOperand` for a regex one); `guard` stats the operand * before a non-root search runs; `stream` wires the backend's native * readStream into the generic scan instead of the whole-read path. */ export declare function makeSearch(name: 'grep' | 'rg', detect: DetectFn, searchers: Readonly>>, io: CommandIO, options: { qualify: QualifyFn; guard?: boolean; stream?: boolean; }): (accessor: A, paths: PathSpec[], texts: string[], opts: CommandOpts) => Promise; //# sourceMappingURL=search.d.ts.map