import type { CodecOpts, Dup, Payload, QoS, Topic } from "./types.ts"; import type { ProtocolLevelNoV5 } from "./protocolLevels.ts"; import type { PublishProperties } from "./Properties.ts"; import { PacketType } from "./PacketType.ts"; /** * PublishPacket is used to send data from client to server and * from server to subscribers */ export type PublishPacketV4 = { type: PacketType; protocolLevel: ProtocolLevelNoV5; topic: Topic; payload: Payload; dup?: Dup | undefined; retain?: boolean | undefined; qos?: QoS | undefined; id?: number | undefined; }; export type PublishPacketV5 = { type: PacketType; protocolLevel: 5; topic: Topic; payload: Payload; dup?: Dup | undefined; retain?: boolean | undefined; qos?: QoS | undefined; id?: number | undefined; properties?: PublishProperties | undefined; }; /** Publish packet (v4|v5). */ export type PublishPacket = PublishPacketV4 | PublishPacketV5; export declare function encode(packet: PublishPacket, codecOpts: CodecOpts): Uint8Array; export declare function decode(buffer: Uint8Array, flags: number, codecOpts: CodecOpts, packetType: PacketType): PublishPacket; //# sourceMappingURL=publish.d.ts.map