Type Alias WithRateLimiterSettings<TParameters>

WithRateLimiterSettings: ErrorPolicySettings & {
    key: Invokable<TParameters, string>;
    limit: number;
    onlyError?: boolean;
}

Settings for the rate-limiter middleware.

Type Parameters

  • TParameters extends unknown[] = unknown[]

    Tuple type of the wrapped function's parameters.

Type declaration

  • key: Invokable<TParameters, string>

    A function that produces the rate-limiter key from the wrapped function's arguments. Each unique key gets its own rate-limit counter.

  • limit: number

    Maximum number of invocations allowed within the configured window.

  • OptionalonlyError?: boolean

    When true, only failed (errored) invocations count toward the rate limit. Successful calls are ignored.

    false