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.21 kB
/** * @module Lock */ import { type TimeSpan } from "../../time-span/implementations/_module.js"; /** * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Contracts */ export declare const LOCK_STATE: { readonly EXPIRED: "EXPIRED"; readonly UNAVAILABLE: "UNAVAILABLE"; readonly ACQUIRED: "ACQUIRED"; }; /** * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Contracts */ export type LockStateLiterals = (typeof LOCK_STATE)[keyof typeof LOCK_STATE]; /** * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Contracts */ export type ILockExpiredState = { type: (typeof LOCK_STATE)["EXPIRED"]; }; /** * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Contracts */ export type ILockUnavailableState = { type: (typeof LOCK_STATE)["UNAVAILABLE"]; owner: string; }; /** * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Contracts */ export type ILockAcquiredState = { type: (typeof LOCK_STATE)["ACQUIRED"]; remainingTime: TimeSpan | null; }; /** * * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"` * @group Contracts */ export type ILockState = ILockUnavailableState | ILockAcquiredState | ILockExpiredState;