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.

77 lines (76 loc) 2.94 kB
/** * @module Lock */ import { type ISerializedError, type OneOrMore } from "../../utilities/_module-exports.js"; import type { ISerderRegister, ISerializable } from "../../serde/contracts/_module-exports.js"; /** * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Errors */ export declare class LockError extends Error implements ISerializable<ISerializedError> { static deserialize(serializedError: ISerializedError): LockError; constructor(message: string, cause?: unknown); serialize(): ISerializedError; } /** * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Errors */ export declare class UnexpectedLockError extends LockError implements ISerializable<ISerializedError> { static deserialize(serializedError: ISerializedError): UnexpectedLockError; constructor(message: string, cause?: unknown); serialize(): ISerializedError; } /** * The error is thrown when trying to acquire a lock that is owned by a different owner. * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Errors */ export declare class KeyAlreadyAcquiredLockError extends LockError implements ISerializable<ISerializedError> { static deserialize(serializedError: ISerializedError): KeyAlreadyAcquiredLockError; constructor(message: string, cause?: unknown); serialize(): ISerializedError; } /** * The error is thrown when trying to release a lock that is owned by a different owner. * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Errors */ export declare class UnownedReleaseLockError extends LockError implements ISerializable<ISerializedError> { static deserialize(serializedError: ISerializedError): UnownedReleaseLockError; constructor(message: string, cause?: unknown); serialize(): ISerializedError; } /** * The error is thrown when trying to referesh a lock that is owned by a different owner. * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Errors */ export declare class UnownedRefreshLockError extends LockError implements ISerializable<ISerializedError> { static deserialize(serializedError: ISerializedError): UnownedRefreshLockError; constructor(message: string, cause?: unknown); serialize(): ISerializedError; } /** * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Errors */ export declare const LOCK_ERRORS: { readonly Base: typeof LockError; readonly Unexpected: typeof UnexpectedLockError; readonly KeyAlreadyAcquired: typeof KeyAlreadyAcquiredLockError; readonly UnownedRelease: typeof UnownedReleaseLockError; }; /** * The `registerLockErrorsToSerde` function registers all {@link ILock | `ILock`} related errors with `IFlexibleSerde`, ensuring they will properly be serialized and deserialized. * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Errors */ export declare function registerLockErrorsToSerde(serde: OneOrMore<ISerderRegister>): void;