@webitel/ui-chats 0.1.44 → 0.1.46

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-chats",
3
- "version": "0.1.44",
3
+ "version": "0.1.46",
4
4
  "description": "Reusable Webitel Frontend Code for Chats UI",
5
5
  "workspaces": [
6
6
  "../../",
@@ -1,14 +1,18 @@
1
- import type { I18n } from 'vue-i18n';
2
1
  import { messages } from '../locale';
3
2
 
4
- export type UiChatsConfig = {
5
- i18n?: I18n;
3
+ /** Minimal i18n surface ui-chats needs — avoids vue-i18n schema variance issues. */
4
+ export type UiChatsI18n = {
5
+ global: {
6
+ mergeLocaleMessage: (locale: string, message: unknown) => void;
7
+ };
6
8
  };
7
9
 
8
- export const defaultConfig: UiChatsConfig = {
9
- i18n: null,
10
+ export type UiChatsConfig = {
11
+ i18n?: UiChatsI18n;
10
12
  };
11
13
 
14
+ export const defaultConfig: UiChatsConfig = {};
15
+
12
16
  export const setConfig = (conf: UiChatsConfig) => {
13
17
  Object.assign(defaultConfig, conf);
14
18
 
@@ -17,6 +21,6 @@ export const setConfig = (conf: UiChatsConfig) => {
17
21
  }
18
22
 
19
23
  Object.entries(messages).forEach(([locale, localeMessages]) => {
20
- conf.i18n.global.mergeLocaleMessage(locale, localeMessages);
24
+ conf.i18n!.global.mergeLocaleMessage(locale, localeMessages);
21
25
  });
22
26
  };
@@ -1 +1,7 @@
1
- export type { ResultCallbacks } from '@webitel/ui-sdk/src/types';
1
+ // Defined locally so consumers (and this package's .d.ts) do not depend on
2
+ // @webitel/ui-sdk/src/types package-export resolution.
3
+ export type ResultCallbacks = {
4
+ onSuccess?: () => void;
5
+ onError?: (error: Error) => void;
6
+ onComplete?: () => void;
7
+ };