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.

53 lines (52 loc) 1.61 kB
/** * @module Semaphore */ /** * 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 { constructor(message: string, cause?: unknown); } /** * The error is thrown when trying to referesh a semaphore slot that is already expired. * * IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"` * @group Errors */ export declare class FailedRefreshSemaphoreError extends Error { 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 { 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 = LimitReachedSemaphoreError | FailedRefreshSemaphoreError | FailedReleaseSemaphoreError; /** * * IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"` * @group Errors */ export declare function isSemaphoreError(value: unknown): value is AllSemaphoreErrors;