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.

101 lines 3.03 kB
/** * @module Lock */ import { BaseEvent } from "../../event-bus/contracts/_module-exports.js"; import { CORE, resolveOneOrMore, } from "../../utilities/_module-exports.js"; /** * The event is dispatched when a lock is aquired. * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Events */ export class KeyAcquiredLockEvent extends BaseEvent { } /** * The event is dispatched when a lock is released. * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Events */ export class KeyReleasedLockEvent extends BaseEvent { } /** * The event is dispatched when a lock is forcefully released. * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Events */ export class KeyForceReleasedLockEvent extends BaseEvent { } /** * The event is dispatched when trying to release a lock that is owned by a different owner. * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Events */ export class UnownedReleaseLockEvent extends BaseEvent { } /** * The event is dispatched when trying to refefresh a lock that is owned by a different owner. * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Events */ export class UnownedRefreshLockEvent extends BaseEvent { } /** * The event is dispatched when trying to acquire a lock that is owned by a different owner. * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Events */ export class KeyAlreadyAcquiredLockEvent extends BaseEvent { } /** * The event is dispatched when a lock is refreshed. * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Events */ export class KeyRefreshedLockEvent extends BaseEvent { } /** * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Events */ export class UnexpectedErrorLockEvent extends BaseEvent { } /** * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Events */ export const LOCK_EVENTS = { KeyAcquired: KeyAcquiredLockEvent, KeyReleased: KeyReleasedLockEvent, UnownedRelease: UnownedReleaseLockEvent, UnownedRefresh: UnownedRefreshLockEvent, KeyAlreadyAcquired: KeyAlreadyAcquiredLockEvent, KeyForceReleased: KeyForceReleasedLockEvent, KeyRefreshed: KeyRefreshedLockEvent, UnexpectedError: UnexpectedErrorLockEvent, }; /** * The `registerLockEventsToSerde` function registers all {@link ILock | `ILock`} related events with `IFlexibleSerde`, ensuring they will properly be serialized and deserialized. * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Events */ export function registerLockEventsToSerde(serde) { for (const serde_ of resolveOneOrMore(serde)) { serde_ .registerEvent(KeyAcquiredLockEvent, CORE) .registerEvent(KeyReleasedLockEvent, CORE) .registerEvent(UnownedReleaseLockEvent, CORE) .registerEvent(KeyAlreadyAcquiredLockEvent, CORE) .registerEvent(UnownedRefreshLockEvent, CORE) .registerEvent(UnexpectedErrorLockEvent, CORE); } } //# sourceMappingURL=lock.events.js.map