Fixes #3440.
@@ -43,6 +43,8 @@ export { VCard, VCards } from './plugins/vcard/index.js'; // XEP-0054 VCard-temp
import * as muc_constants from './plugins/muc/constants.js';
const constants = Object.assign({}, shared_constants, muc_constants);
+Object.assign(_converse.constants, constants);
+
export { api, converse, _converse, i18n, log, u, constants, parsers };
export default converse;
@@ -121,6 +121,12 @@ class ConversePrivateGlobal extends EventEmitter(Object) {
*/
this.exports = /** @type {Record<string, Object>} */({});
+ /**
+ * Provides a way for 3rd party plugins to access constants used by
+ * Converse.
+ */
+ this.constants = /** @type {Record<string, string|Object>} */({});
/**
* Namespace for storing the state, as represented by instances of
* Models and Collections.
@@ -60,6 +60,11 @@ declare class ConversePrivateGlobal extends ConversePrivateGlobal_base {
* converse.js as a dependency.
exports: Record<string, any>;
+ constants: Record<string, any>;
@@ -17,6 +17,7 @@ export type _converse = {
api: any;
labels: Record<string, string | Record<string, string>>;
state: any;
initSession(): void;
session: import("@converse/skeletor").Model;