UNPKG

@struktoai/mirage-core

Version:

A Unified Virtual Filesystem For AI Agents

38 lines • 1.94 kB
import { LineRegex } from '../../rs/regex.ts'; import { PathSpec } from '../../types.ts'; import type { FlagView } from '../spec/flag_view.ts'; import { RegexSyntax } from './types.ts'; export declare const NEVER_MATCH = "(?!)"; export declare function patternArg(texts: readonly string[], flags: FlagView): string | null; export declare function resolvePattern(name: string, texts: readonly string[], flags: FlagView, stream: (p: PathSpec) => AsyncIterable<Uint8Array>): Promise<{ pattern: null; neverMatch: boolean; error: string; } | { pattern: string | null; neverMatch: boolean; error: null; }>; export declare function mergePatternList(pattern: string | null, fileData: Uint8Array | null): string | null; /** * The dialect grep's matcher options pick, refusing a mixture. GNU grep 3.11 * keeps one matcher: -G, -E, -F and -P each name one, repeating the same is * harmless, and any two different ones are `conflicting matchers specified` * (exit 2) in either order. -F is carried as `fixedString`, so it only takes * part in the check. */ export declare function matcherSyntax(fl: FlagView, prog?: string): RegexSyntax; /** * GNU grep's compile-time warnings for a pattern list, as stderr. Only an * extended expression has any: GNU warns about a repetition operator at the * start of an expression (`grep: warning: * at start of expression`), once per * occurrence, which is also how GNU reads `(?<=...)`. */ export declare function patternWarnings(matcher: LineRegex, prog?: string): string; /** * Compile a pattern list into one matcher; `utf8` means the lines are text * under a UTF-8 locale. A refusal is GNU grep's wording, and exits 2 as grep * does. */ export declare function compilePattern(pattern: string, ignoreCase?: boolean, fixedString?: boolean, wholeWord?: boolean, syntax?: RegexSyntax, utf8?: boolean, lineRegexp?: boolean): LineRegex; //# sourceMappingURL=grep_pattern.d.ts.map