@uzum-tech/ui 1.7.2 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/index.js +1548 -998
  2. package/dist/index.prod.js +3 -3
  3. package/es/chat/index.d.ts +4 -0
  4. package/es/chat/index.js +2 -0
  5. package/es/chat/src/Chat.d.ts +19 -6
  6. package/es/chat/src/Chat.js +53 -14
  7. package/es/chat/src/ChatListItems.d.ts +6027 -0
  8. package/es/chat/src/ChatListItems.js +187 -0
  9. package/es/chat/src/ChatMessages.d.ts +6049 -0
  10. package/es/chat/src/ChatMessages.js +308 -0
  11. package/es/chat/src/ChatParts/ChatAttachment.js +4 -3
  12. package/es/chat/src/ChatParts/MainArea.d.ts +0 -2
  13. package/es/chat/src/ChatParts/MainArea.js +108 -229
  14. package/es/chat/src/ChatParts/Sidebar.js +16 -80
  15. package/es/chat/src/interface.d.ts +6 -1
  16. package/es/chat/src/styles/index.cssr.js +3 -2
  17. package/es/locales/common/arDZ.js +2 -1
  18. package/es/locales/common/deDE.js +2 -1
  19. package/es/locales/common/enGB.js +2 -1
  20. package/es/locales/common/enUS.d.ts +1 -0
  21. package/es/locales/common/enUS.js +2 -1
  22. package/es/locales/common/eo.js +2 -1
  23. package/es/locales/common/esAR.js +2 -1
  24. package/es/locales/common/faIR.js +2 -1
  25. package/es/locales/common/frFR.js +2 -1
  26. package/es/locales/common/idID.js +2 -1
  27. package/es/locales/common/itIT.js +2 -1
  28. package/es/locales/common/jaJP.js +2 -1
  29. package/es/locales/common/koKR.js +2 -1
  30. package/es/locales/common/nbNO.js +2 -1
  31. package/es/locales/common/nlNL.js +2 -1
  32. package/es/locales/common/plPL.js +2 -1
  33. package/es/locales/common/ptBR.js +2 -1
  34. package/es/locales/common/ruRU.js +2 -1
  35. package/es/locales/common/skSK.js +2 -1
  36. package/es/locales/common/svSE.js +2 -1
  37. package/es/locales/common/thTH.js +2 -1
  38. package/es/locales/common/trTR.js +2 -1
  39. package/es/locales/common/ukUA.js +2 -1
  40. package/es/locales/common/viVN.js +2 -1
  41. package/es/locales/common/zhCN.js +2 -1
  42. package/es/locales/common/zhTW.js +2 -1
  43. package/es/version.d.ts +1 -1
  44. package/es/version.js +1 -1
  45. package/lib/chat/index.d.ts +4 -0
  46. package/lib/chat/index.js +5 -1
  47. package/lib/chat/src/Chat.d.ts +19 -6
  48. package/lib/chat/src/Chat.js +52 -13
  49. package/lib/chat/src/ChatListItems.d.ts +6027 -0
  50. package/lib/chat/src/ChatListItems.js +193 -0
  51. package/lib/chat/src/ChatMessages.d.ts +6049 -0
  52. package/lib/chat/src/ChatMessages.js +314 -0
  53. package/lib/chat/src/ChatParts/ChatAttachment.js +4 -3
  54. package/lib/chat/src/ChatParts/MainArea.d.ts +0 -2
  55. package/lib/chat/src/ChatParts/MainArea.js +107 -228
  56. package/lib/chat/src/ChatParts/Sidebar.js +17 -78
  57. package/lib/chat/src/interface.d.ts +6 -1
  58. package/lib/chat/src/styles/index.cssr.js +3 -2
  59. package/lib/locales/common/arDZ.js +2 -1
  60. package/lib/locales/common/deDE.js +2 -1
  61. package/lib/locales/common/enGB.js +2 -1
  62. package/lib/locales/common/enUS.d.ts +1 -0
  63. package/lib/locales/common/enUS.js +2 -1
  64. package/lib/locales/common/eo.js +2 -1
  65. package/lib/locales/common/esAR.js +2 -1
  66. package/lib/locales/common/faIR.js +2 -1
  67. package/lib/locales/common/frFR.js +2 -1
  68. package/lib/locales/common/idID.js +2 -1
  69. package/lib/locales/common/itIT.js +2 -1
  70. package/lib/locales/common/jaJP.js +2 -1
  71. package/lib/locales/common/koKR.js +2 -1
  72. package/lib/locales/common/nbNO.js +2 -1
  73. package/lib/locales/common/nlNL.js +2 -1
  74. package/lib/locales/common/plPL.js +2 -1
  75. package/lib/locales/common/ptBR.js +2 -1
  76. package/lib/locales/common/ruRU.js +2 -1
  77. package/lib/locales/common/skSK.js +2 -1
  78. package/lib/locales/common/svSE.js +2 -1
  79. package/lib/locales/common/thTH.js +2 -1
  80. package/lib/locales/common/trTR.js +2 -1
  81. package/lib/locales/common/ukUA.js +2 -1
  82. package/lib/locales/common/viVN.js +2 -1
  83. package/lib/locales/common/zhCN.js +2 -1
  84. package/lib/locales/common/zhTW.js +2 -1
  85. package/lib/version.d.ts +1 -1
  86. package/lib/version.js +1 -1
  87. package/package.json +1 -1
  88. package/volar.d.ts +2 -0
  89. package/web-types.json +149 -1
  90. package/es/chat/src/ChatGlobalState.d.ts +0 -13
  91. package/es/chat/src/ChatGlobalState.js +0 -32
  92. package/lib/chat/src/ChatGlobalState.d.ts +0 -13
  93. package/lib/chat/src/ChatGlobalState.js +0 -36
@@ -131,7 +131,8 @@ const enGB = {
131
131
  inputPlaceholder: 'Type a message...',
132
132
  typingText: 'Typing...',
133
133
  retryText: 'Resend',
134
- closeButtonText: 'Close chat'
134
+ closeButtonText: 'Close chat',
135
+ unreadNotificationText: 'new messages'
135
136
  }
136
137
  };
137
138
  exports.default = enGB;
@@ -129,6 +129,7 @@ declare const enUS: {
129
129
  typingText: string;
130
130
  retryText: string;
131
131
  closeButtonText: string;
132
+ unreadNotificationText: string;
132
133
  };
133
134
  };
134
135
  export type ULocale = typeof enUS;
@@ -131,7 +131,8 @@ const enUS = {
131
131
  inputPlaceholder: 'Type a message...',
132
132
  typingText: 'Typing...',
133
133
  retryText: 'Resend',
134
- closeButtonText: 'Close chat'
134
+ closeButtonText: 'Close chat',
135
+ unreadNotificationText: 'new messages'
135
136
  }
136
137
  };
137
138
  exports.default = enUS;
@@ -132,7 +132,8 @@ const eo = {
132
132
  inputPlaceholder: 'Type a message...',
133
133
  typingText: 'Typing...',
134
134
  retryText: 'Resend',
135
- closeButtonText: 'Close chat'
135
+ closeButtonText: 'Close chat',
136
+ unreadNotificationText: 'new messages'
136
137
  }
137
138
  };
138
139
  exports.default = eo;
@@ -134,7 +134,8 @@ const esAR = {
134
134
  inputPlaceholder: 'Type a message...',
135
135
  typingText: 'Typing...',
136
136
  retryText: 'Resend',
137
- closeButtonText: 'Close chat'
137
+ closeButtonText: 'Close chat',
138
+ unreadNotificationText: 'new messages'
138
139
  }
139
140
  };
140
141
  exports.default = esAR;
@@ -130,7 +130,8 @@ const faIR = {
130
130
  inputPlaceholder: 'Type a message...',
131
131
  typingText: 'Typing...',
132
132
  retryText: 'Resend',
133
- closeButtonText: 'Close chat'
133
+ closeButtonText: 'Close chat',
134
+ unreadNotificationText: 'new messages'
134
135
  }
135
136
  };
136
137
  exports.default = faIR;
@@ -130,7 +130,8 @@ const frFR = {
130
130
  inputPlaceholder: 'Type a message...',
131
131
  typingText: 'Typing...',
132
132
  retryText: 'Resend',
133
- closeButtonText: 'Close chat'
133
+ closeButtonText: 'Close chat',
134
+ unreadNotificationText: 'new messages'
134
135
  }
135
136
  };
136
137
  exports.default = frFR;
@@ -134,7 +134,8 @@ const idID = {
134
134
  inputPlaceholder: 'Type a message...',
135
135
  typingText: 'Typing...',
136
136
  retryText: 'Resend',
137
- closeButtonText: 'Close chat'
137
+ closeButtonText: 'Close chat',
138
+ unreadNotificationText: 'new messages'
138
139
  }
139
140
  };
140
141
  exports.default = idID;
@@ -133,7 +133,8 @@ const itIT = {
133
133
  inputPlaceholder: 'Type a message...',
134
134
  typingText: 'Typing...',
135
135
  retryText: 'Resend',
136
- closeButtonText: 'Close chat'
136
+ closeButtonText: 'Close chat',
137
+ unreadNotificationText: 'new messages'
137
138
  }
138
139
  };
139
140
  exports.default = itIT;
@@ -133,7 +133,8 @@ const jaJP = {
133
133
  inputPlaceholder: 'Type a message...',
134
134
  typingText: 'Typing...',
135
135
  retryText: 'Resend',
136
- closeButtonText: 'Close chat'
136
+ closeButtonText: 'Close chat',
137
+ unreadNotificationText: 'new messages'
137
138
  }
138
139
  };
139
140
  exports.default = jaJP;
@@ -133,7 +133,8 @@ const koKR = {
133
133
  inputPlaceholder: 'Type a message...',
134
134
  typingText: 'Typing...',
135
135
  retryText: 'Resend',
136
- closeButtonText: 'Close chat'
136
+ closeButtonText: 'Close chat',
137
+ unreadNotificationText: 'new messages'
137
138
  }
138
139
  };
139
140
  exports.default = koKR;
@@ -134,7 +134,8 @@ const nbNO = {
134
134
  inputPlaceholder: 'Type a message...',
135
135
  typingText: 'Typing...',
136
136
  retryText: 'Resend',
137
- closeButtonText: 'Close chat'
137
+ closeButtonText: 'Close chat',
138
+ unreadNotificationText: 'new messages'
138
139
  }
139
140
  };
140
141
  exports.default = nbNO;
@@ -132,7 +132,8 @@ const nlNL = {
132
132
  inputPlaceholder: 'Type a message...',
133
133
  typingText: 'Typing...',
134
134
  retryText: 'Resend',
135
- closeButtonText: 'Close chat'
135
+ closeButtonText: 'Close chat',
136
+ unreadNotificationText: 'new messages'
136
137
  }
137
138
  };
138
139
  exports.default = nlNL;
@@ -133,7 +133,8 @@ const plPL = {
133
133
  inputPlaceholder: 'Type a message...',
134
134
  typingText: 'Typing...',
135
135
  retryText: 'Resend',
136
- closeButtonText: 'Close chat'
136
+ closeButtonText: 'Close chat',
137
+ unreadNotificationText: 'new messages'
137
138
  }
138
139
  };
139
140
  exports.default = plPL;
@@ -130,7 +130,8 @@ const ptBR = {
130
130
  inputPlaceholder: 'Type a message...',
131
131
  typingText: 'Typing...',
132
132
  retryText: 'Resend',
133
- closeButtonText: 'Close chat'
133
+ closeButtonText: 'Close chat',
134
+ unreadNotificationText: 'new messages'
134
135
  }
135
136
  };
136
137
  exports.default = ptBR;
@@ -135,7 +135,8 @@ const ruRu = {
135
135
  inputPlaceholder: 'Написать сообщение...',
136
136
  typingText: 'Печатает...',
137
137
  retryText: 'Повторно отправить',
138
- closeButtonText: 'Завершить чат'
138
+ closeButtonText: 'Завершить чат',
139
+ unreadNotificationText: 'новых сообщений'
139
140
  }
140
141
  };
141
142
  exports.default = ruRu;
@@ -134,7 +134,8 @@ const skSK = {
134
134
  inputPlaceholder: 'Type a message...',
135
135
  typingText: 'Typing...',
136
136
  retryText: 'Resend',
137
- closeButtonText: 'Close chat'
137
+ closeButtonText: 'Close chat',
138
+ unreadNotificationText: 'new messages'
138
139
  }
139
140
  };
140
141
  exports.default = skSK;
@@ -130,7 +130,8 @@ const svSE = {
130
130
  inputPlaceholder: 'Type a message...',
131
131
  typingText: 'Typing...',
132
132
  retryText: 'Resend',
133
- closeButtonText: 'Close chat'
133
+ closeButtonText: 'Close chat',
134
+ unreadNotificationText: 'new messages'
134
135
  }
135
136
  };
136
137
  exports.default = svSE;
@@ -134,7 +134,8 @@ const thTH = {
134
134
  inputPlaceholder: 'Type a message...',
135
135
  typingText: 'Typing...',
136
136
  retryText: 'Resend',
137
- closeButtonText: 'Close chat'
137
+ closeButtonText: 'Close chat',
138
+ unreadNotificationText: 'new messages'
138
139
  }
139
140
  };
140
141
  exports.default = thTH;
@@ -131,7 +131,8 @@ const trTR = {
131
131
  inputPlaceholder: 'Type a message...',
132
132
  typingText: 'Typing...',
133
133
  retryText: 'Resend',
134
- closeButtonText: 'Close chat'
134
+ closeButtonText: 'Close chat',
135
+ unreadNotificationText: 'new messages'
135
136
  }
136
137
  };
137
138
  exports.default = trTR;
@@ -131,7 +131,8 @@ const ukUA = {
131
131
  inputPlaceholder: 'Type a message...',
132
132
  typingText: 'Typing...',
133
133
  retryText: 'Resend',
134
- closeButtonText: 'Close chat'
134
+ closeButtonText: 'Close chat',
135
+ unreadNotificationText: 'new messages'
135
136
  }
136
137
  };
137
138
  exports.default = ukUA;
@@ -130,7 +130,8 @@ const viVN = {
130
130
  inputPlaceholder: 'Type a message...',
131
131
  typingText: 'Typing...',
132
132
  retryText: 'Resend',
133
- closeButtonText: 'Close chat'
133
+ closeButtonText: 'Close chat',
134
+ unreadNotificationText: 'new messages'
134
135
  }
135
136
  };
136
137
  exports.default = viVN;
@@ -130,7 +130,8 @@ const zhCN = {
130
130
  inputPlaceholder: 'Type a message...',
131
131
  typingText: 'Typing...',
132
132
  retryText: 'Resend',
133
- closeButtonText: 'Close chat'
133
+ closeButtonText: 'Close chat',
134
+ unreadNotificationText: 'new messages'
134
135
  }
135
136
  };
136
137
  exports.default = zhCN;
@@ -130,7 +130,8 @@ const zhTW = {
130
130
  inputPlaceholder: 'Type a message...',
131
131
  typingText: 'Typing...',
132
132
  retryText: 'Resend',
133
- closeButtonText: 'Close chat'
133
+ closeButtonText: 'Close chat',
134
+ unreadNotificationText: 'new messages'
134
135
  }
135
136
  };
136
137
  exports.default = zhTW;
package/lib/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "1.7.2";
1
+ declare const _default: "1.8.0";
2
2
  export default _default;
package/lib/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = '1.7.2';
3
+ exports.default = '1.8.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uzum-tech/ui",
3
- "version": "1.7.2",
3
+ "version": "1.8.0",
4
4
  "description": "A Vue 3 Component Library. Fairly Complete, Theme Customizable, Uses TypeScript, Fast",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
package/volar.d.ts CHANGED
@@ -147,6 +147,8 @@ declare module 'vue' {
147
147
  UWatermark: typeof import('@uzum-tech/ui')['UWatermark']
148
148
  UActionCard: typeof import('@uzum-tech/ui')['UActionCard']
149
149
  UChat: typeof import('@uzum-tech/ui')['UChat']
150
+ UChatListItems: typeof import('@uzum-tech/ui')['UChatListItems']
151
+ UChatMessages: typeof import('@uzum-tech/ui')['UChatMessages']
150
152
  }
151
153
  }
152
154
  export {}
package/web-types.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
4
  "name": "@uzum-tech/ui",
5
- "version": "1.7.2",
5
+ "version": "1.8.0",
6
6
  "js-types-syntax": "typescript",
7
7
  "contributions": {
8
8
  "html": {
@@ -2120,6 +2120,13 @@
2120
2120
  "description": "Text for close chat button.",
2121
2121
  "default": "locale default"
2122
2122
  },
2123
+ {
2124
+ "name": "unread-notification-text",
2125
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
2126
+ "type": "string",
2127
+ "description": "Text shown in unread messages notification (e.g., \"5 new messages\").",
2128
+ "default": "locale default"
2129
+ },
2123
2130
  {
2124
2131
  "name": "chat-items-loading",
2125
2132
  "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
@@ -2233,6 +2240,147 @@
2233
2240
  ]
2234
2241
  }
2235
2242
  },
2243
+ {
2244
+ "name": "UChatListItems",
2245
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
2246
+ "source": {
2247
+ "symbol": "UChatListItems"
2248
+ },
2249
+ "slots": [],
2250
+ "attributes": [],
2251
+ "props": [
2252
+ {
2253
+ "name": "chat-items",
2254
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
2255
+ "type": "Array"
2256
+ },
2257
+ {
2258
+ "name": "selected-chat-id",
2259
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat"
2260
+ },
2261
+ {
2262
+ "name": "typing-chat-ids",
2263
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
2264
+ "type": "Array"
2265
+ },
2266
+ {
2267
+ "name": "typing-text",
2268
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
2269
+ "type": "string"
2270
+ },
2271
+ {
2272
+ "name": "loading",
2273
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
2274
+ "type": "boolean"
2275
+ },
2276
+ {
2277
+ "name": "loading-count",
2278
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
2279
+ "type": "number"
2280
+ },
2281
+ {
2282
+ "name": "empty-props",
2283
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
2284
+ "type": "object"
2285
+ },
2286
+ {
2287
+ "name": "avatar-props",
2288
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
2289
+ "type": "object"
2290
+ },
2291
+ {
2292
+ "name": "badge-props",
2293
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
2294
+ "type": "object"
2295
+ },
2296
+ {
2297
+ "name": "notifications-shown",
2298
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
2299
+ "type": "object"
2300
+ }
2301
+ ],
2302
+ "js": {
2303
+ "events": [
2304
+ {
2305
+ "name": "chat-select",
2306
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat"
2307
+ }
2308
+ ]
2309
+ }
2310
+ },
2311
+ {
2312
+ "name": "UChatMessages",
2313
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
2314
+ "source": {
2315
+ "symbol": "UChatMessages"
2316
+ },
2317
+ "slots": [],
2318
+ "attributes": [],
2319
+ "props": [
2320
+ {
2321
+ "name": "messages",
2322
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
2323
+ "type": "Array"
2324
+ },
2325
+ {
2326
+ "name": "loading",
2327
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
2328
+ "type": "boolean"
2329
+ },
2330
+ {
2331
+ "name": "loading-count",
2332
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
2333
+ "type": "number"
2334
+ },
2335
+ {
2336
+ "name": "typing-chat-ids",
2337
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
2338
+ "type": "Array"
2339
+ },
2340
+ {
2341
+ "name": "selected-chat-id",
2342
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat"
2343
+ },
2344
+ {
2345
+ "name": "typing-text",
2346
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
2347
+ "type": "string"
2348
+ },
2349
+ {
2350
+ "name": "retry-text",
2351
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
2352
+ "type": "string"
2353
+ },
2354
+ {
2355
+ "name": "upload-props",
2356
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
2357
+ "type": "object"
2358
+ },
2359
+ {
2360
+ "name": "show-unread-notification",
2361
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
2362
+ "type": "boolean"
2363
+ },
2364
+ {
2365
+ "name": "unread-notification-text",
2366
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
2367
+ "type": "string"
2368
+ },
2369
+ {
2370
+ "name": "unread-notification-count",
2371
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat",
2372
+ "type": "number"
2373
+ }
2374
+ ],
2375
+ "js": {
2376
+ "events": [
2377
+ {
2378
+ "name": "message-retry",
2379
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/chat"
2380
+ }
2381
+ ]
2382
+ }
2383
+ },
2236
2384
  {
2237
2385
  "name": "UCarousel",
2238
2386
  "description": "It's usually used to display good news.",
@@ -1,13 +0,0 @@
1
- export declare class ChatGlobalState {
2
- private static instance;
3
- private readonly notificationsShown;
4
- private readonly openedChats;
5
- private constructor();
6
- static getInstance(): ChatGlobalState;
7
- hasNotificationShown(chatId: string | number | symbol): boolean;
8
- markNotificationShown(chatId: string | number | symbol): void;
9
- isChatOpened(chatId: string | number | symbol): boolean;
10
- markChatOpened(chatId: string | number | symbol): void;
11
- markChatClosed(chatId: string | number | symbol): void;
12
- reset(): void;
13
- }
@@ -1,32 +0,0 @@
1
- export class ChatGlobalState {
2
- constructor() {
3
- this.notificationsShown = new Set();
4
- this.openedChats = new Set();
5
- }
6
- static getInstance() {
7
- if (!ChatGlobalState.instance) {
8
- ChatGlobalState.instance = new ChatGlobalState();
9
- }
10
- return ChatGlobalState.instance;
11
- }
12
- hasNotificationShown(chatId) {
13
- return this.notificationsShown.has(chatId);
14
- }
15
- markNotificationShown(chatId) {
16
- this.notificationsShown.add(chatId);
17
- }
18
- isChatOpened(chatId) {
19
- return this.openedChats.has(chatId);
20
- }
21
- markChatOpened(chatId) {
22
- this.openedChats.add(chatId);
23
- }
24
- markChatClosed(chatId) {
25
- this.openedChats.delete(chatId);
26
- }
27
- reset() {
28
- this.notificationsShown.clear();
29
- this.openedChats.clear();
30
- }
31
- }
32
- ChatGlobalState.instance = null;
@@ -1,13 +0,0 @@
1
- export declare class ChatGlobalState {
2
- private static instance;
3
- private readonly notificationsShown;
4
- private readonly openedChats;
5
- private constructor();
6
- static getInstance(): ChatGlobalState;
7
- hasNotificationShown(chatId: string | number | symbol): boolean;
8
- markNotificationShown(chatId: string | number | symbol): void;
9
- isChatOpened(chatId: string | number | symbol): boolean;
10
- markChatOpened(chatId: string | number | symbol): void;
11
- markChatClosed(chatId: string | number | symbol): void;
12
- reset(): void;
13
- }
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChatGlobalState = void 0;
4
- class ChatGlobalState {
5
- constructor() {
6
- this.notificationsShown = new Set();
7
- this.openedChats = new Set();
8
- }
9
- static getInstance() {
10
- if (!ChatGlobalState.instance) {
11
- ChatGlobalState.instance = new ChatGlobalState();
12
- }
13
- return ChatGlobalState.instance;
14
- }
15
- hasNotificationShown(chatId) {
16
- return this.notificationsShown.has(chatId);
17
- }
18
- markNotificationShown(chatId) {
19
- this.notificationsShown.add(chatId);
20
- }
21
- isChatOpened(chatId) {
22
- return this.openedChats.has(chatId);
23
- }
24
- markChatOpened(chatId) {
25
- this.openedChats.add(chatId);
26
- }
27
- markChatClosed(chatId) {
28
- this.openedChats.delete(chatId);
29
- }
30
- reset() {
31
- this.notificationsShown.clear();
32
- this.openedChats.clear();
33
- }
34
- }
35
- exports.ChatGlobalState = ChatGlobalState;
36
- ChatGlobalState.instance = null;