models/communities/Mention.js

export default class Mention {
  /**
   * Creates a new Mention instance.
   *
   * @constructor Mention
   * @param {Object} mentionMap - Mention parameters
   * @param {string} mentionMap.userId - User ID
   * @param {string} mentionMap.type - Type
   * @param {string} mentionMap.startIndex - Character index where mention starts
   * @param {string} mentionMap.endIndex - Character index where mention ends
   */
  constructor(mentionMap) {
      this.userId = mentionMap.userId;
      this.type = mentionMap.type;
      this.startIndex = mentionMap.startIndex;
      this.endIndex = mentionMap.endIndex;
      Object.freeze(this);
  }
}