/** * @module Semaphore */ import { type InferInstance } from "../../utilities/_module.js"; /** * The error is thrown when trying to acquire a semaphore slot, but all slots are already taken. * * IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"` * @group Errors */ export declare class LimitReachedSemaphoreError extends Error { static create(key: string, cause?: unknown): LimitReachedSemaphoreError; /** * Note: Do not instantiate `LimitReachedSemaphoreError` directly via the constructor. Use the static `create()` factory method instead. * The constructor remains public only to maintain compatibility with errorPolicy types and prevent type errors. * @internal */ constructor(message: string, cause?: unknown); } /** * The error is thrown when trying to refresh a semaphore slot that is already expired. * * IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"` * @group Errors */ export declare class FailedRefreshSemaphoreError extends Error { static create(key: string, slotId: string, cause?: unknown): FailedRefreshSemaphoreError; /** * Note: Do not instantiate `FailedRefreshSemaphoreError` directly via the constructor. Use the static `create()` factory method instead. * The constructor remains public only to maintain compatibility with errorPolicy types and prevent type errors. * @internal */ constructor(message: string, cause?: unknown); } /** * The error is thrown when trying to release a semaphore slot that is already expired. * * IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"` * @group Errors */ export declare class FailedReleaseSemaphoreError extends Error { static create(key: string, slotId: string, cause?: unknown): FailedReleaseSemaphoreError; /** * Note: Do not instantiate `FailedReleaseSemaphoreError` directly via the constructor. Use the static `create()` factory method instead. * The constructor remains public only to maintain compatibility with errorPolicy types and prevent type errors. * @internal */ constructor(message: string, cause?: unknown); } /** * IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"` * @group Errors */ export declare const SEMAPHORE_ERRORS: { readonly ReachedLimit: typeof LimitReachedSemaphoreError; readonly FailedRefresh: typeof FailedRefreshSemaphoreError; readonly FailedRelease: typeof FailedReleaseSemaphoreError; }; /** * IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"` * @group Errors */ export type AllSemaphoreErrors = InferInstance<(typeof SEMAPHORE_ERRORS)[keyof typeof SEMAPHORE_ERRORS]>; /** * IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"` * @group Errors */ export declare function isSemaphoreError(value: unknown): value is AllSemaphoreErrors;