/** * @fileoverview resilience/callback-invocation-safe — callbacks iterated * from producer code paths (`subscribers.forEach((cb) => cb(...))`, * `for (const cb of listeners) { cb(...) }`) must be wrapped in a * `safe(...)` helper or a `try { ... }` block. A throw from a * single subscriber must never crash the producer or skip subsequent * subscribers in the same notification. * * Why it matters: callback iteration inside `setInterval` or async * drain loops will surface a subscriber throw as `uncaughtException` * — and even on a synchronous code path, an unprotected throw drops * every later subscriber in the same loop iteration. The contract is * "subscribers are isolated"; this check is the regression gate. * * Scope (deliberately narrow): * - `.ts` / `.tsx` source under `packages/`. * - Skips tests and `.d.ts`. * - Detects only iteration over identifiers ending in * `subscribers`, `listeners`, `observers`, `callbacks`, `handlers`. * * Per-site opt-out: `// @callback-invocation-safe-by-caller -- ` * on the same line or the line immediately above. A bare pragma without * `-- ` is itself flagged so reviewers can grep the rationale. * * Confidence: low. Under-flag aggressively. This is a regression guard, * not a discovery tool. * * Inspired by `opensip-ai/opensip/opensip-cli` `arch-callback-invocation-safe`. */ import { type CheckViolation } from '@opensip-cli/fitness'; /** Exported for unit tests. */ export declare function analyzeCallbackInvocationSafe(content: string, filePath: string): CheckViolation[]; export declare const callbackInvocationSafe: import("@opensip-cli/fitness").Check; //# sourceMappingURL=callback-invocation-safe.d.ts.map