import type { ImplementedProcedure } from './runtime.js'; /** * Wraps one `runProcedure` call. Interceptors run in array order with `[0]` * outermost (`applyPlugins` puts plugin interceptors before loose ones). * `next(opts)` **replaces** whatever it is given — `input`, `context`, and * `signal` each overwrite the current value for everything inside, and a key * that is passed as `undefined` clears it. Compare middleware `next()` * (`NextFn` in `middleware.ts`), which merges `context` into the current one. */ export type CallInterceptor = (ctx: { procedure: ImplementedProcedure; path: string[]; input: unknown; context: unknown; signal?: AbortSignal; next: (opts?: { /** Replaces the input for everything inside this interceptor. */ input?: unknown; /** Replaces context entirely; does not merge. */ context?: unknown; /** Replaces the signal; passing `undefined` removes it. */ signal?: AbortSignal; }) => Promise; }) => Promise; type CallState = { input: unknown; context: unknown; signal?: AbortSignal; }; export declare function runCallInterceptors(interceptors: readonly CallInterceptor[], ctx: { procedure: ImplementedProcedure; path: string[]; input: unknown; context: unknown; signal?: AbortSignal; }, execute: (current: CallState) => Promise): Promise; export {}; //# sourceMappingURL=call-interceptor.d.ts.map