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.

42 lines (41 loc) 1.79 kB
/** * @module SharedLock */ import { type IEventBus } from "../../../../event-bus/contracts/_module.js"; import { type Namespace } from "../../../../namespace/_module.js"; import { type ISerdeTransformer } from "../../../../serde/contracts/_module.js"; import { type ISharedLockAdapter, type SharedLockAdapterVariants, type SharedLockEventMap } from "../../../../shared-lock/contracts/_module.js"; import { SharedLock, type ISerializedSharedLock } from "../../../../shared-lock/implementations/derivables/shared-lock-provider/shared-lock.js"; import { TimeSpan } from "../../../../time-span/implementations/_module.js"; import { type OneOrMore } from "../../../../utilities/_module.js"; /** * @internal */ export type SharedLockSerdeTransformerSettings = { adapter: ISharedLockAdapter; originalAdapter: SharedLockAdapterVariants; namespace: Namespace; defaultBlockingInterval: TimeSpan; defaultBlockingTime: TimeSpan; defaultRefreshTime: TimeSpan; eventBus: IEventBus<SharedLockEventMap>; serdeTransformerName: string; }; /** * @internal */ export declare class SharedLockSerdeTransformer implements ISerdeTransformer<SharedLock, ISerializedSharedLock> { private readonly adapter; private readonly originalAdapter; private readonly namespace; private readonly defaultBlockingInterval; private readonly defaultBlockingTime; private readonly defaultRefreshTime; private readonly eventBus; private readonly serdeTransformerName; constructor(settings: SharedLockSerdeTransformerSettings); get name(): OneOrMore<string>; isApplicable(value: unknown): value is SharedLock; deserialize(serializedValue: ISerializedSharedLock): SharedLock; serialize(deserializedValue: SharedLock): ISerializedSharedLock; }