UNPKG

@seriousme/opifex

Version:

MQTT client & server for Deno & NodeJS

34 lines 1.28 kB
/** * @module memoryStore */ import { type PacketId } from "./deps.ts"; import { type IStore, type PacketStore, type PendingAckOutgoing, type pendingIncoming, type PendingOutgoing, type PendingOutgoingPackets } from "./store.ts"; /** * In-memory implementation of the IStore interface for managing MQTT packet storage */ export declare class MemoryStore implements IStore { /** Current packet ID counter */ private packetId; /** Map of pending incoming packets */ pendingIncoming: PacketStore<pendingIncoming>; /** Map of pending outgoing packets */ pendingOutgoing: PacketStore<PendingOutgoing>; /** Map of pending acknowledgment outgoing packets */ pendingAckOutgoing: PacketStore<PendingAckOutgoing>; /** * Creates a new MemoryStore instance */ constructor(); /** * Generates the next available packet ID * @returns {PacketId} The next available packet ID * @throws {Error} If no unused packet ID is available */ nextId(): PacketId; /** * Asynchronously yields all pending outgoing packets * @yields {PendingOutgoingPackets} Pending outgoing packets */ pendingOutgoingPackets(): AsyncGenerator<PendingOutgoingPackets, void, unknown>; } //# sourceMappingURL=memoryStore.d.ts.map