UNPKG

@nestjs/microservices

Version:

Microservices for NestJS: message and event handlers over Kafka, RabbitMQ, NATS, Redis, MQTT, gRPC or TCP.

27 lines (26 loc) • 913 B
import { PacketMetadata } from '../interfaces/packet.interface.js'; import { BaseRpcContext } from './base-rpc.context.js'; type MqttContextArgs = [string, Record<string, any>]; /** * @publicApi */ export declare class MqttContext extends BaseRpcContext<MqttContextArgs> { constructor(args: MqttContextArgs); /** * Returns the name of the topic. */ getTopic(): string; /** * Returns the reference to the original MQTT packet. */ getPacket(): Record<string, any>; /** * Returns the packet's MQTT 5 user properties as packet metadata: what the * client attached to the packet, and every other user property with a * single value. A property with several values is only available through * `getPacket()`. MQTT 3 has no user properties, so there is nothing to * return over it. */ getMetadata(): PacketMetadata | undefined; } export {};