@dfeidao/send-msg
Version:
消息总线
25 lines (24 loc) • 584 B
TypeScript
export interface IMessage {
id: string;
sessionid: string;
actionid: string;
err_code: number;
err_msg: string;
msg: object;
}
/**
* Push message to any mqtt client
*/
export declare function push(topic: string, msg: string): void;
/**
* Listen mqtt message
*/
export declare function listen(topic: string, callback: (msg: string) => void): Promise<{
remove(): void;
}>;
/**
* Send message to SOA
*/
export default function send_msg(spaceid: string, msg_type: string, msg: object, timeout: number, type: string): Promise<{
sessionID: string;
}>;