/** * Compile a user-supplied regex with conservative bounds against ReDoS. * * Duplicated from @wrongstack/tools/_regex.ts to avoid a circular * dependency (tools depends on core, not vice versa). Keep both copies * in sync if the heuristics change. * * V8's regex engine is backtracking-based and cannot interrupt a * synchronous match — a pattern like `(a+)+$` against a sufficiently * long line will pin a worker for seconds. */ export interface CompileResult { ok: true; regex: RegExp; } export interface CompileFail { ok: false; reason: string; } export declare function compileUserRegex(pattern: string, flags: string): CompileResult | CompileFail; //# sourceMappingURL=regex-guard.d.ts.map