import type { Handlers } from "./context.ts"; import type { ConnNext, Persistence } from "./deps.ts"; import type { Configuration, ConfigurationInput } from "./config.ts"; /** * Configuration options for creating an MqttServer instance. */ export type MqttServerOptions = { /** Optional persistence layer implementation. Defaults to MemoryPersistence. */ persistence?: Persistence; /** Optional custom handlers for authentication and authorization. */ handlers?: Handlers; /** Optional configuration data */ configuration?: ConfigurationInput; }; /** * The MqttServer class provides an MQTT server with configurable persistence and * authentication/authorization handlers. * * The default handlers are: * - isAuthenticated: always returns ok * - isAuthorizedToPublish: always returns true * - isAuthorizedToSubscribe: always returns true * * To customize the handlers, pass in a Handlers object. * To customize the persistence, pass in a Persistence object. */ export declare class MqttServer { /** The registered authentication and authorization handlers. */ handlers: Handlers; /** The persistence layer used for storing sessions and messages. */ persistence: Persistence; /** The persistence layer used for storing sessions and messages. */ configuration: Configuration; /** * Initializes a new instance of the MqttServer. * * @param {MqttServerOptions} options - The configuration options for the server. */ constructor({ persistence, handlers, configuration, }: MqttServerOptions); /** * Serve a new client connection. * @param conn - The socket connection to serve. * @returns {Promise} A promise that resolves when the connection is closed. */ serve(conn: ConnNext): Promise; /** * Close the server and all active client connections. * @param {boolean} cleanUp - If true, clean up client sessions on close. */ close(cleanUp?: boolean): Promise; } //# sourceMappingURL=server.d.ts.map