import type { CodecOpts, PacketId, TopicFilter } from "./types.ts"; import type { ProtocolLevelNoV5 } from "./protocolLevels.ts"; import type { UnsubscribeProperties } from "./Properties.ts"; import { PacketType } from "./PacketType.ts"; /** * Represents an MQTT UNSUBSCRIBE packet conforming to MQTT version 3.1.1 (Protocol Level 4) or lower. */ export type UnsubscribePacketV4 = { /** The type of the MQTT control packet. */ type: PacketType; /** The protocol version level, restricted to non-v5 variants. */ protocolLevel: ProtocolLevelNoV5; /** The unique 16-bit packet identifier. */ id: PacketId; /** The list of topic filters from which the client intends to unsubscribe. */ topicFilters: TopicFilter[]; }; /** * Represents an MQTT UNSUBSCRIBE packet conforming to MQTT version 5.0. */ export type UnsubscribePacketV5 = { /** The type of the MQTT control packet. */ type: PacketType; /** The protocol version level, strictly set to 5. */ protocolLevel: 5; /** The unique 16-bit packet identifier. */ id: PacketId; /** Optional user and protocol properties introduced in MQTT v5. */ properties?: UnsubscribeProperties; /** The list of topic filters from which the client intends to unsubscribe. */ topicFilters: TopicFilter[]; }; /** * Represents a union of available MQTT UNSUBSCRIBE packets (v4 or v5) sent from client to server. */ export type UnsubscribePacket = UnsubscribePacketV4 | UnsubscribePacketV5; /** * Codec utility object responsible for encoding and decoding MQTT UNSUBSCRIBE control packets. */ export declare function encode(packet: UnsubscribePacket, codecOpts: CodecOpts): Uint8Array; export declare function decode(buffer: Uint8Array, flags: number, codecOpts: CodecOpts, packetType: PacketType): UnsubscribePacket; //# sourceMappingURL=unsubscribe.d.ts.map