@trtc/calls-uikit-react 4.4.3-beta.2 → 4.4.4

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 (75) hide show
  1. package/package.json +4 -3
  2. package/src/Components/assets/aiAssistant/desktop/subtitleSettings.svg +4 -0
  3. package/src/Components/assets/aiAssistant/mobile/close-aiAssistant.svg +7 -0
  4. package/src/Components/assets/aiAssistant/mobile/open-aiAssistant.svg +7 -0
  5. package/src/Components/assets/aiAssistant/mobile/subtitleSettings.svg +3 -0
  6. package/src/Components/components/base/CustomSelect/CustomSelect.scss +116 -0
  7. package/src/Components/components/base/CustomSelect/CustomSelect.tsx +96 -0
  8. package/src/Components/components/common/AIAssistant/AISubtitle.scss +109 -0
  9. package/src/Components/components/common/AIAssistant/AISubtitle.tsx +52 -66
  10. package/src/Components/components/common/AIAssistant/components/AITranscriberSwitchH5.tsx +39 -0
  11. package/src/Components/components/common/AIAssistant/components/AITranscriberSwitchPC.scss +46 -0
  12. package/src/Components/components/common/AIAssistant/components/AITranscriberSwitchPC.tsx +42 -0
  13. package/src/Components/components/common/AIAssistant/components/SubtitleContent.scss +67 -0
  14. package/src/Components/components/common/AIAssistant/components/SubtitleContent.tsx +134 -0
  15. package/src/Components/components/common/AIAssistant/components/SubtitleSettingsH5.scss +275 -0
  16. package/src/Components/components/common/AIAssistant/components/SubtitleSettingsH5.tsx +265 -0
  17. package/src/Components/components/common/AIAssistant/components/SubtitleSettingsPC.scss +98 -0
  18. package/src/Components/components/common/AIAssistant/components/SubtitleSettingsPC.tsx +198 -0
  19. package/src/Components/components/common/AIAssistant/components/index.ts +5 -0
  20. package/src/Components/components/common/AIAssistant/index.ts +3 -1
  21. package/src/Components/components/common/TopBar/h5/TopBarH5.tsx +11 -1
  22. package/src/Components/components/common/TopBar/pc/TopBarPC.module.scss +20 -0
  23. package/src/Components/components/common/TopBar/pc/TopBarPC.tsx +14 -9
  24. package/src/Components/components/common/UIKitModal/UIKitModal.tsx +250 -0
  25. package/src/Components/components/common/UIKitModal/UIKitModalState.ts +177 -0
  26. package/src/Components/components/common/UIKitModal/index.module.scss +176 -0
  27. package/src/Components/components/common/UIKitModal/index.ts +3 -0
  28. package/src/Components/hooks/index.ts +2 -0
  29. package/src/Components/hooks/useAIAssistant.ts +174 -0
  30. package/src/TUICallService/CallService/AIAssistant.ts +285 -39
  31. package/src/TUICallService/CallService/UIKitModal.ts +72 -6
  32. package/src/TUICallService/CallService/bellContext.ts +25 -2
  33. package/src/TUICallService/CallService/engineEventHandler.ts +6 -1
  34. package/src/TUICallService/CallService/index.ts +72 -39
  35. package/src/TUICallService/CallService/miniProgram.ts +0 -12
  36. package/src/TUICallService/TUIStore/callStore.ts +6 -1
  37. package/src/TUICallService/UIKitModal/UIKitModal.ts +117 -0
  38. package/src/TUICallService/UIKitModal/index.ts +2 -0
  39. package/src/TUICallService/UIKitModal/type.ts +15 -0
  40. package/src/TUICallService/const/index.ts +4 -0
  41. package/src/TUICallService/interface/ICallStore.ts +5 -0
  42. package/src/TUICallService/locales/en.ts +17 -1
  43. package/src/TUICallService/locales/ja_JP.ts +17 -1
  44. package/src/TUICallService/locales/zh-cn.ts +17 -1
  45. package/src/TUICallService/utils/common-utils.ts +1 -1
  46. package/src/index.ts +1 -1
  47. package/tuicall-uikit-react.es.js +4009 -3940
  48. package/tuicall-uikit-react.umd.js +8 -33
  49. package/types/Components/components/base/CustomSelect/CustomSelect.d.ts +15 -0
  50. package/types/Components/components/common/AIAssistant/AISubtitle.d.ts +1 -0
  51. package/types/Components/components/common/AIAssistant/components/AITranscriberSwitchH5.d.ts +3 -0
  52. package/types/Components/components/common/AIAssistant/components/AITranscriberSwitchPC.d.ts +4 -0
  53. package/types/Components/components/common/AIAssistant/components/SubtitleContent.d.ts +8 -0
  54. package/types/Components/components/common/AIAssistant/components/SubtitleSettingsH5.d.ts +13 -0
  55. package/types/Components/components/common/AIAssistant/components/SubtitleSettingsPC.d.ts +13 -0
  56. package/types/Components/components/common/AIAssistant/components/index.d.ts +5 -0
  57. package/types/Components/components/common/AIAssistant/index.d.ts +1 -0
  58. package/types/Components/components/common/UIKitModal/UIKitModal.d.ts +21 -0
  59. package/types/Components/components/common/UIKitModal/UIKitModalState.d.ts +27 -0
  60. package/types/Components/components/common/UIKitModal/index.d.ts +3 -0
  61. package/types/Components/hooks/index.d.ts +2 -1
  62. package/types/Components/hooks/useAIAssistant.d.ts +22 -0
  63. package/types/TUICallService/CallService/AIAssistant.d.ts +72 -15
  64. package/types/TUICallService/CallService/bellContext.d.ts +3 -0
  65. package/types/TUICallService/CallService/index.d.ts +4 -3
  66. package/types/TUICallService/CallService/miniProgram.d.ts +0 -1
  67. package/types/TUICallService/UIKitModal/UIKitModal.d.ts +4 -0
  68. package/types/TUICallService/UIKitModal/index.d.ts +2 -0
  69. package/types/TUICallService/UIKitModal/type.d.ts +13 -0
  70. package/types/TUICallService/interface/ICallStore.d.ts +4 -0
  71. package/types/TUICallService/locales/en.d.ts +15 -0
  72. package/types/TUICallService/locales/ja_JP.d.ts +15 -0
  73. package/types/TUICallService/locales/zh-cn.d.ts +15 -0
  74. package/src/TUICallService/utils/validate/validateStatus.ts +0 -26
  75. package/types/TUICallService/utils/validate/validateStatus.d.ts +0 -5
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import './CustomSelect.scss';
3
+ export interface SelectOption {
4
+ label: string;
5
+ value: string | number;
6
+ }
7
+ interface CustomSelectProps {
8
+ value: string | number;
9
+ options: SelectOption[];
10
+ placeholder?: string;
11
+ disabled?: boolean;
12
+ onChange: (value: string | number) => void;
13
+ }
14
+ declare const CustomSelect: React.FC<CustomSelectProps>;
15
+ export default CustomSelect;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import './AISubtitle.scss';
2
3
  interface AISubtitleProps {
3
4
  customClass?: string;
4
5
  customStyle?: React.CSSProperties;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const AITranscriberSwitchH5: React.FC;
3
+ export default AITranscriberSwitchH5;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './AITranscriberSwitchPC.scss';
3
+ declare const AITranscriberSwitchPC: React.FC;
4
+ export default AITranscriberSwitchPC;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import './SubtitleContent.scss';
3
+ interface SubtitleContentProps {
4
+ onOpenSettings: () => void;
5
+ className?: string;
6
+ }
7
+ declare const SubtitleContent: React.FC<SubtitleContentProps>;
8
+ export default SubtitleContent;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import './SubtitleSettingsH5.scss';
3
+ interface SubtitleSettingsH5Props {
4
+ visible: boolean;
5
+ onVisibleChange: (visible: boolean) => void;
6
+ onConfirm: (settings: {
7
+ recognitionLanguage: string;
8
+ translationLanguage: string;
9
+ subtitleEnabled: boolean;
10
+ }) => void;
11
+ }
12
+ declare const SubtitleSettingsH5: React.FC<SubtitleSettingsH5Props>;
13
+ export default SubtitleSettingsH5;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import './SubtitleSettingsPC.scss';
3
+ interface SubtitleSettingsPCProps {
4
+ visible: boolean;
5
+ onVisibleChange: (visible: boolean) => void;
6
+ onConfirm: (settings: {
7
+ recognitionLanguage: string;
8
+ translationLanguage: string;
9
+ subtitleDisplay: string;
10
+ }) => void;
11
+ }
12
+ declare const SubtitleSettingsPC: React.FC<SubtitleSettingsPCProps>;
13
+ export default SubtitleSettingsPC;
@@ -0,0 +1,5 @@
1
+ export { default as SubtitleContent } from './SubtitleContent';
2
+ export { default as SubtitleSettingsPC } from './SubtitleSettingsPC';
3
+ export { default as SubtitleSettingsH5 } from './SubtitleSettingsH5';
4
+ export { default as AITranscriberSwitchPC } from './AITranscriberSwitchPC';
5
+ export { default as AITranscriberSwitchH5 } from './AITranscriberSwitchH5';
@@ -2,3 +2,4 @@ import AIAssistant, { ASREvent } from "./AIAssistant";
2
2
  import AISubtitle from "./AISubtitle";
3
3
  declare const aiAssistant: AIAssistant;
4
4
  export { aiAssistant, ASREvent, AISubtitle, };
5
+ export * from './components';
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import type { ReactNode } from 'react';
3
+ export interface UIKitModalConfig {
4
+ id: number;
5
+ title: string;
6
+ content: string | ReactNode;
7
+ type: 'info' | 'warning' | 'error' | 'success';
8
+ onConfirm?: () => void;
9
+ onCancel?: () => void;
10
+ }
11
+ export type UIKitModalOptions = UIKitModalConfig;
12
+ interface UIKitModalComponentProps extends UIKitModalOptions {
13
+ visible: boolean;
14
+ }
15
+ export declare function UIKitModalComponent(props: UIKitModalComponentProps): React.ReactPortal;
16
+ export declare const UIKitModal: {
17
+ openModal: (config: UIKitModalOptions) => Promise<{
18
+ action: string;
19
+ }>;
20
+ };
21
+ export {};
@@ -0,0 +1,27 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface UIKitModalConfig {
3
+ id: number;
4
+ title: string;
5
+ content: string | ReactNode;
6
+ type: 'info' | 'warning' | 'error' | 'success';
7
+ onConfirm?: () => void;
8
+ onCancel?: () => void;
9
+ }
10
+ export type UIKitModalOptions = UIKitModalConfig;
11
+ interface UIKitModalState {
12
+ modalData: UIKitModalConfig | null;
13
+ activeModalId: number | null;
14
+ modalOpenTime: number | null;
15
+ }
16
+ interface UIKitModalActions {
17
+ openModal: (config: UIKitModalConfig) => void;
18
+ closeModal: (action?: 'confirm' | 'cancel' | 'mask' | 'timeout') => void;
19
+ getState: () => UIKitModalState & UIKitModalActions;
20
+ }
21
+ export declare const uikitModalState: {
22
+ getState: () => UIKitModalState & UIKitModalActions;
23
+ openModal: (config: UIKitModalConfig) => void;
24
+ closeModal: (action?: "confirm" | "cancel" | "mask" | "timeout") => void;
25
+ subscribe: (listener: () => void) => () => boolean;
26
+ };
27
+ export default uikitModalState;
@@ -0,0 +1,3 @@
1
+ export { UIKitModal, UIKitModalComponent } from './UIKitModal';
2
+ export type { UIKitModalConfig, UIKitModalOptions } from './UIKitModal';
3
+ export { uikitModalState } from './UIKitModalState';
@@ -1,4 +1,5 @@
1
1
  import useTranslate from "./useTranslate";
2
2
  import useDeviceList from "./useDeviceList";
3
3
  import useCallDuration from "./useCallDuration";
4
- export { useTranslate, useDeviceList, useCallDuration, };
4
+ import { useAIAssistant } from "./useAIAssistant";
5
+ export { useTranslate, useDeviceList, useCallDuration, useAIAssistant, };
@@ -0,0 +1,22 @@
1
+ interface ITranslationContent {
2
+ language: string;
3
+ text: string;
4
+ }
5
+ interface ITranslationInfo {
6
+ roundId: string;
7
+ sender: string;
8
+ nick?: string;
9
+ text: string;
10
+ end: boolean;
11
+ translation: ITranslationContent[];
12
+ }
13
+ /**
14
+ * AI Assistant hook
15
+ * Provides state management for AI transcription functionality
16
+ */
17
+ export declare function useAIAssistant(): {
18
+ isAITranscriberEnabled: boolean;
19
+ isAITranscriberRunning: boolean;
20
+ subtitleInfoList: ITranslationInfo[];
21
+ };
22
+ export {};
@@ -1,15 +1,72 @@
1
- interface IAIAssistant {
2
- enableAISubtitle: (enable: boolean) => void;
3
- setEngineInstance: (engineInstance: any) => void;
4
- setImInstance: (imInstance: any) => void;
5
- }
6
- export declare class AIAssistant implements IAIAssistant {
7
- static instance: IAIAssistant;
8
- private _tuiCallEngine;
9
- private _imInstance;
10
- static getInstance(): IAIAssistant;
11
- enableAISubtitle(enable: boolean): void;
12
- setEngineInstance(engineInstance: any): void;
13
- setImInstance(imInstance: any): void;
14
- }
15
- export {};
1
+ export declare enum RealtimeTranscriberEvent {
2
+ onReceiveTranscriberMessage = "onReceiveTranscriberMessage",
3
+ onRealtimeTranscriberStarted = "onRealtimeTranscriberStarted",
4
+ onRealtimeTranscriberStopped = "onRealtimeTranscriberStopped",
5
+ onRealtimeTranscriberError = "onRealtimeTranscriberError"
6
+ }
7
+ export type TranscriberLanguage = string;
8
+ export interface TranscriberMessage {
9
+ segmentId: string;
10
+ speakerUserId: string;
11
+ sourceText: string;
12
+ translationTexts?: Map<string, string>;
13
+ timestamp: number;
14
+ isCompleted: boolean;
15
+ }
16
+ export interface RealtimeTranscriberEventInfoMap {
17
+ [RealtimeTranscriberEvent.onReceiveTranscriberMessage]: {
18
+ roomId: string | number;
19
+ message: TranscriberMessage;
20
+ };
21
+ [RealtimeTranscriberEvent.onRealtimeTranscriberStarted]: {
22
+ roomId: string | number;
23
+ transcriberRobotId: string;
24
+ sourceLanguage: string;
25
+ };
26
+ [RealtimeTranscriberEvent.onRealtimeTranscriberStopped]: {
27
+ roomId: string | number;
28
+ transcriberRobotId: string;
29
+ };
30
+ [RealtimeTranscriberEvent.onRealtimeTranscriberError]: {
31
+ roomId: string | number;
32
+ transcriberRobotId: string;
33
+ error: number;
34
+ errorMessage: string;
35
+ };
36
+ }
37
+ export type RealtimeTranscriberEventCallback = <T extends RealtimeTranscriberEvent>(eventInfo: RealtimeTranscriberEventInfoMap[T]) => void;
38
+ export default class AIAssistant {
39
+ static instance: AIAssistant;
40
+ private _callService;
41
+ private eventListeners;
42
+ constructor(options: {
43
+ callService: any;
44
+ });
45
+ static getInstance(options: {
46
+ callService: any;
47
+ }): AIAssistant;
48
+ /**
49
+ * Get AI Transcriber Manager instance
50
+ * @returns AITranscriberManager instance or null if not available
51
+ */
52
+ private getTranscriberManager;
53
+ private triggerEvent;
54
+ startRealtimeTranscriber: (config: {
55
+ sourceLanguage: TranscriberLanguage;
56
+ translationLanguages?: TranscriberLanguage[];
57
+ }) => Promise<any>;
58
+ stopRealtimeTranscriber: () => Promise<void>;
59
+ updateRealTimeTranscriber: (config: {
60
+ sourceLanguage: TranscriberLanguage;
61
+ translationLanguages?: TranscriberLanguage[];
62
+ }) => Promise<any>;
63
+ subscribeEvent: (event: RealtimeTranscriberEvent, callback: RealtimeTranscriberEventCallback) => void;
64
+ unsubscribeEvent: (event: RealtimeTranscriberEvent, callback: RealtimeTranscriberEventCallback) => void;
65
+ private onReceiveTranscriberMessage;
66
+ private onRealtimeTranscriberStarted;
67
+ private onRealtimeTranscriberStopped;
68
+ private onRealtimeTranscriberError;
69
+ bindEvent: () => void;
70
+ unbindEvent: () => void;
71
+ reset: () => void;
72
+ }
@@ -5,6 +5,7 @@ export declare class BellContext {
5
5
  private _calleeBellFilePath;
6
6
  private _callRole;
7
7
  private _callStatus;
8
+ private _isPlaying;
8
9
  constructor();
9
10
  setBellSrc(): void;
10
11
  setBellProperties(bellParams: IBellParams): void;
@@ -12,6 +13,8 @@ export declare class BellContext {
12
13
  stop(): Promise<void>;
13
14
  setBellMute(enable: boolean): Promise<void>;
14
15
  destroy(): void;
16
+ private _delay;
17
+ private _delayCallback;
15
18
  private _handleAudioInterruptionBegin;
16
19
  private _handleAudioInterruptionEnd;
17
20
  private _addListenBellContextEvent;
@@ -8,6 +8,7 @@ export { TUIGlobal, TUIStore, uiDesign };
8
8
  export default class TUICallService {
9
9
  static instance: TUICallService;
10
10
  _tuiCallEngine: any;
11
+ _aiAssistant: any;
11
12
  private _tim;
12
13
  private _TUICore;
13
14
  private _timerId;
@@ -15,7 +16,6 @@ export default class TUICallService {
15
16
  private _bellContext;
16
17
  private _isFromChat;
17
18
  private _currentGroupId;
18
- private _preDevicePermission;
19
19
  private _offlinePushInfo;
20
20
  private _permissionCheckTimer;
21
21
  private _chatCombine;
@@ -39,6 +39,7 @@ export default class TUICallService {
39
39
  setSelfInfo(params: ISelfInfoParams): Promise<void>;
40
40
  enableVirtualBackground(enable: boolean): Promise<void>;
41
41
  enableAIVoice(enable: boolean): Promise<void>;
42
+ enableAITranscriber(enable: boolean): Promise<void>;
42
43
  setCallingBell(filePath?: string): Promise<void>;
43
44
  enableMuteMode(enable: boolean): Promise<void>;
44
45
  hideFeatureButton(buttonName: FeatureButton): void;
@@ -46,9 +47,9 @@ export default class TUICallService {
46
47
  setRemoteViewBackgroundImage(userId: string, url: string): void;
47
48
  setLayoutMode(layoutMode: LayoutMode): void;
48
49
  setCameraDefaultState(isOpen: boolean): void;
49
- enableAISubtitle(enable: boolean): void;
50
50
  callExperimentalAPI(jsonStr: string): void;
51
51
  accept(): Promise<void>;
52
+ private _handleAcceptResponse;
52
53
  hangup(): Promise<void>;
53
54
  reject(): Promise<void>;
54
55
  openCamera(videoViewDomID: string): Promise<void>;
@@ -87,7 +88,7 @@ export default class TUICallService {
87
88
  private _getFeatureButtonDefaultState;
88
89
  private _updateCallDuration;
89
90
  private _stopTimer;
90
- private _cleanupAllAvoidRepeatCallState;
91
+ private _cleanupAvoidRepeatCallState;
91
92
  private _resetCallStore;
92
93
  getGroupMemberList(count: number, offset: number): Promise<any>;
93
94
  getGroupProfile(): Promise<any>;
@@ -3,5 +3,4 @@ export declare function initialUI(): void;
3
3
  export declare function checkRunPlatform(): void;
4
4
  export declare function initAndCheckRunEnv(): void;
5
5
  export declare function beforeCall(type: CallMediaType, that: any): Promise<CallStatus.IDLE | CallStatus.CALLING>;
6
- export declare function handlePackageError(error: any): void;
7
6
  export declare function handleNoPusherCapabilityError(): void;
@@ -0,0 +1,4 @@
1
+ import type { UIKitModalOptions, UIKitModalResult } from './type';
2
+ export declare const UIKitModal: {
3
+ openModal: (config: UIKitModalOptions) => Promise<UIKitModalResult>;
4
+ };
@@ -0,0 +1,2 @@
1
+ export { UIKitModal } from './UIKitModal';
2
+ export type { UIKitModalOptions, UIKitModalResult, ModalType } from './type';
@@ -0,0 +1,13 @@
1
+ export type ModalType = 'info' | 'warning' | 'error' | 'success';
2
+ export interface UIKitModalOptions {
3
+ id: number;
4
+ title: string;
5
+ content: string;
6
+ type: ModalType;
7
+ onConfirm?: () => void;
8
+ onCancel?: () => void;
9
+ }
10
+ export interface UIKitModalResult {
11
+ action: 'confirm' | 'cancel';
12
+ raw?: any;
13
+ }
@@ -44,4 +44,8 @@ export interface ICallStore {
44
44
  pusherId: string;
45
45
  translate: Function;
46
46
  isForceUseV2API: boolean;
47
+ transcriberRobotId: string | null;
48
+ realtimeMessageList: [];
49
+ isAITranscriberEnabled: boolean;
50
+ isAITranscriberRunning: boolean;
47
51
  }
@@ -136,5 +136,20 @@ export declare const en: {
136
136
  'error.10008': string;
137
137
  'error.10012': string;
138
138
  'error.10013': string;
139
+ 'error.10014': string;
139
140
  error: string;
141
+ 'ai-subtitle': string;
142
+ 'ai-subtitle-settings': string;
143
+ 'recognition-language': string;
144
+ 'translation-language': string;
145
+ 'subtitle-display-settings': string;
146
+ 'subtitle-display-bilingual': string;
147
+ 'no-translation': string;
148
+ 'show-bilingual': string;
149
+ 'show-original-only': string;
150
+ save: string;
151
+ 'select-recognition-language': string;
152
+ 'select-translation-language': string;
153
+ confirm: string;
154
+ 'recognition-and-translation-settings': string;
140
155
  };
@@ -135,5 +135,20 @@ export declare const ja_JP: {
135
135
  'error.10008': string;
136
136
  'error.10012': string;
137
137
  'error.10013': string;
138
+ 'error.10014': string;
138
139
  error: string;
140
+ 'ai-subtitle': string;
141
+ 'ai-subtitle-settings': string;
142
+ 'recognition-language': string;
143
+ 'translation-language': string;
144
+ 'subtitle-display-settings': string;
145
+ 'subtitle-display-bilingual': string;
146
+ 'no-translation': string;
147
+ 'show-bilingual': string;
148
+ 'show-original-only': string;
149
+ save: string;
150
+ 'select-recognition-language': string;
151
+ 'select-translation-language': string;
152
+ confirm: string;
153
+ 'recognition-and-translation-settings': string;
139
154
  };
@@ -131,5 +131,20 @@ export declare const zh: {
131
131
  'error.10008': string;
132
132
  'error.10012': string;
133
133
  'error.10013': string;
134
+ 'error.10014': string;
134
135
  error: string;
136
+ 'ai-subtitle': string;
137
+ 'ai-subtitle-settings': string;
138
+ 'recognition-language': string;
139
+ 'translation-language': string;
140
+ 'subtitle-display-settings': string;
141
+ 'subtitle-display-bilingual': string;
142
+ 'no-translation': string;
143
+ 'show-bilingual': string;
144
+ 'show-original-only': string;
145
+ save: string;
146
+ 'select-recognition-language': string;
147
+ 'select-translation-language': string;
148
+ confirm: string;
149
+ 'recognition-and-translation-settings': string;
135
150
  };
@@ -1,26 +0,0 @@
1
- import { NAME } from "../../const/index";
2
- import { t } from '../../locales/index';
3
-
4
- interface IStatusValidateParams {
5
- engineInstance?: boolean;
6
- }
7
-
8
- export function statusValidate (config: IStatusValidateParams) {
9
- return function (target, propertyName: string, descriptor: PropertyDescriptor) {
10
- let method = descriptor.value;
11
- descriptor.value = function (...args: Array<any>) {
12
- doValidate.call(this, config, args, propertyName);
13
- return method.apply(this, args);
14
- };
15
- return descriptor;
16
- };
17
- }
18
-
19
- function doValidate(config) {
20
- if (config?.engineInstance && !this._tuiCallEngine) {
21
- const error = `${NAME.PREFIX} ${t('TUICallKit init is not complete')}`;
22
- console.error(error);
23
- throw error;
24
- }
25
- }
26
-
@@ -1,5 +0,0 @@
1
- interface IStatusValidateParams {
2
- engineInstance?: boolean;
3
- }
4
- export declare function statusValidate(config: IStatusValidateParams): (target: any, propertyName: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
5
- export {};