config.ts 468 B

12345678910111213141516171819202122232425
  1. class TUIChatConfig {
  2. static instance: TUIChatConfig;
  3. private chatType: string;
  4. constructor() {
  5. this.chatType = '';
  6. }
  7. static getInstance(): TUIChatConfig {
  8. if (!TUIChatConfig.instance) {
  9. TUIChatConfig.instance = new TUIChatConfig();
  10. }
  11. return TUIChatConfig.instance;
  12. }
  13. setChatType(chatType: string) {
  14. this.chatType = chatType;
  15. }
  16. getChatType() {
  17. return this.chatType;
  18. }
  19. }
  20. export default TUIChatConfig.getInstance();