UNPKG

@daiso-tech/core

Version:

The library offers flexible, framework-agnostic solutions for modern web applications, built on adaptable components that integrate seamlessly with popular frameworks like Next Js.

35 lines (34 loc) 1.03 kB
/** * @module RateLimiter */ import { type RateLimiterBlockedState } from "../../rate-limiter/contracts/rate-limiter-state.contract.js"; /** * The error is throw when rate limiter blocks the attempts. * * IMPORT_PATH: `"@daiso-tech/core/rate-limiter/contracts"` * @group Errors */ export declare class BlockedRateLimiterError extends Error { readonly state: Omit<RateLimiterBlockedState, "type">; constructor(state: Omit<RateLimiterBlockedState, "type">, message?: string, cause?: unknown); } /** * * IMPORT_PATH: `"@daiso-tech/core/rate-limiter/contracts"` * @group Errors */ export declare const CIRCUIT_BREAKER_ERRORS: { readonly Blocked: typeof BlockedRateLimiterError; }; /** * * IMPORT_PATH: `"@daiso-tech/core/rate-limiter/contracts"` * @group Errors */ export type AllRateLimiterErrors = BlockedRateLimiterError; /** * * IMPORT_PATH: `"@daiso-tech/core/rate-limiter/contracts"` * @group Errors */ export declare function isRateLimiterError(value: unknown): value is AllRateLimiterErrors;