import { StatefulSocketWrapper, DeepstreamServices, UnauthenticatedSocketWrapper, NamespacedLogger } from '@deepstream/types'; import { TOPIC, CONNECTION_ACTION, Message, ParseResult } from '../../constants'; /** * This class wraps around a websocket * and provides higher level methods that are integrated * with deepstream's message structure */ export declare class MQTTSocketWrapper implements UnauthenticatedSocketWrapper { private socket; private handshakeData; private services; private logger; socketType: string; userId: string | null; serverData: object | null; clientData: object | null; isRemote: false; isClosed: boolean; uuid: number; authCallback: Function | null; authAttempts: number; private closeCallbacks; constructor(socket: any, handshakeData: any, services: DeepstreamServices, logger: NamespacedLogger); get isOpen(): boolean; flush(): void; /** * Sends a message based on the provided action and topic */ sendMessage(message: { topic: TOPIC; action: CONNECTION_ACTION; } | Message, allowBuffering?: boolean): void; /** * Sends a message based on the provided action and topic */ sendAckMessage(message: Message, allowBuffering?: boolean): void; getMessage(message: Message): Message; parseData(message: Message): true | Error; onMessage(messages: Message[]): void; /** * Destroys the socket. Removes all deepstream specific * logic and closes the connection */ destroy(): void; close(): void; parseMessage(serializedMessage: any): ParseResult[]; /** * Returns a map of parameters that were collected * during the initial http request that established the * connection */ getHandshakeData(): any; onClose(callback: (socketWrapper: StatefulSocketWrapper) => void): void; removeOnClose(callback: (socketWrapper: StatefulSocketWrapper) => void): void; sendBuiltMessage(message: Message, buffer?: boolean): void; } export declare const createMQTTSocketWrapper: (socket: any, handshakeData: any, services: DeepstreamServices, logger: NamespacedLogger) => MQTTSocketWrapper;