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.

125 lines (124 loc) 4.04 kB
/** * @module SharedLock */ /** * The error is thrown when trying to acquire a semaphore slot, but all slots are already taken. * * IMPORT_PATH: `"@daiso-tech/core/shared-lock/contracts"` * @group Errors */ export declare class LimitReachedReaderSemaphoreError 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/shared-lock/contracts"` * @group Errors */ export declare class FailedRefreshReaderSemaphoreError 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/shared-lock/contracts"` * @group Errors */ export declare class FailedReleaseReaderSemaphoreError extends Error { constructor(message: string, cause?: unknown); } /** * * IMPORT_PATH: `"@daiso-tech/core/shared-lock/contracts"` * @group Errors */ export declare const READER_SEMAPHORE_ERRORS: { readonly ReachedLimit: typeof LimitReachedReaderSemaphoreError; readonly FailedRefresh: typeof FailedRefreshReaderSemaphoreError; readonly FailedRelease: typeof FailedReleaseReaderSemaphoreError; }; /** * * IMPORT_PATH: `"@daiso-tech/core/shared-lock/contracts"` * @group Errors */ export type AllReaderSemaphoreErrors = LimitReachedReaderSemaphoreError | FailedRefreshReaderSemaphoreError | FailedReleaseReaderSemaphoreError; /** * * IMPORT_PATH: `"@daiso-tech/core/shared-lock/contracts"` * @group Errors */ export declare function isReaderSemaphoreError(value: unknown): value is AllReaderSemaphoreErrors; /** * The error is thrown when trying to acquire a lock that is owned by a different owner. * * IMPORT_PATH: `"@daiso-tech/core/shared-lock/contracts"` * @group Errors */ export declare class FailedAcquireWriterLockError extends Error { constructor(message: string, cause?: unknown); } /** * The error is thrown when trying to release a lock that is owned by a different owner. * * IMPORT_PATH: `"@daiso-tech/core/shared-lock/contracts"` * @group Errors */ export declare class FailedReleaseWriterLockError extends Error { constructor(message: string, cause?: unknown); } /** * The error is thrown when trying to referesh a lock that is owned by a different owner. * * IMPORT_PATH: `"@daiso-tech/core/shared-lock/contracts"` * @group Errors */ export declare class FailedRefreshWriterLockError extends Error { constructor(message: string, cause?: unknown); } /** * * IMPORT_PATH: `"@daiso-tech/core/shared-lock/contracts"` * @group Errors */ export declare const WRITER_LOCK_ERRORS: { readonly FailedAcquire: typeof FailedAcquireWriterLockError; readonly FailedRelease: typeof FailedReleaseWriterLockError; readonly FailedRefresh: typeof FailedRefreshWriterLockError; }; /** * * IMPORT_PATH: `"@daiso-tech/core/shared-lock/contracts"` * @group Errors */ export type AllWriterLockErrors = FailedAcquireWriterLockError | FailedReleaseWriterLockError | FailedRefreshWriterLockError; /** * * IMPORT_PATH: `"@daiso-tech/core/shared-lock/contracts"` * @group Errors */ export declare function isWriterLockError(value: unknown): value is AllWriterLockErrors; /** * * IMPORT_PATH: `"@daiso-tech/core/shared-lock/contracts"` * @group Errors */ export declare const SHARED_LOCK_ERRORS: { readonly FailedAcquire: typeof FailedAcquireWriterLockError; readonly FailedRelease: typeof FailedReleaseWriterLockError; readonly FailedRefresh: typeof FailedRefreshWriterLockError; readonly ReachedLimit: typeof LimitReachedReaderSemaphoreError; }; /** * * IMPORT_PATH: `"@daiso-tech/core/shared-lock/contracts"` * @group Errors */ export type AllSharedLockErrors = AllWriterLockErrors | AllReaderSemaphoreErrors; /** * * IMPORT_PATH: `"@daiso-tech/core/shared-lock/contracts"` * @group Errors */ export declare function isSharedLockError(value: unknown): value is AllSharedLockErrors;