@seriousme/opifex
Version:
MQTT client & server for Deno & NodeJS
27 lines • 910 B
TypeScript
import { type Handlers } from "./context.ts";
import { type IPersistence, type SockConn } from "./deps.ts";
/**
* The options to configure the MqttServer
*/
export type MqttServerOptions = {
persistence?: IPersistence;
handlers?: Handlers;
};
/** The MqttServer class provides a 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 {
handlers: Handlers;
persistence: IPersistence;
constructor({ persistence, handlers, }: MqttServerOptions);
serve(conn: SockConn): Promise<void>;
}
//# sourceMappingURL=server.d.ts.map