@myinterview/chatbot 0.1.72-experimental-bf5bb52 → 0.1.72-experimental-8fd5453

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.
@@ -1 +1 @@
1
- {"version":3,"file":"audioVisualizer.worker-DaYxk4EK.js","sources":["../src/interfaces/audioVisualizerInterface.ts","../src/workers/audioVisualizer.worker.ts"],"sourcesContent":["export const enum AudioVisualizerMessageAction {\n INIT = 'init',\n SET = 'set',\n CLEAR = 'clear',\n}\n\nexport type AudioVisualizerMessageParams = { action: AudioVisualizerMessageAction, payload: { canvas?: OffscreenCanvas, data?: Uint8Array } };\nexport type AudioVisualizerMessage = MessageEvent<AudioVisualizerMessageParams>;\n","/* eslint-disable no-plusplus */\nimport { AudioVisualizerMessage, AudioVisualizerMessageAction } from '../interfaces/audioVisualizerInterface';\n\ntype MessagePayload = AudioVisualizerMessage['data']['payload'];\n\nlet canvas: OffscreenCanvas | null = null;\nlet ctx: OffscreenCanvasRenderingContext2D | null = null;\nlet baseRadius = 40;\nconst MARGIN = 20;\n\nconst actions: { [K in AudioVisualizerMessageAction]: (payload: MessagePayload) => void } = {\n [AudioVisualizerMessageAction.INIT]: (payload: MessagePayload) => {\n if (!payload.canvas) return;\n canvas = payload.canvas;\n baseRadius = Math.min(canvas.width, canvas.height) / 5;\n ctx = canvas.getContext('2d');\n ctx!.fillStyle = '#6690ff';\n ctx!.scale(1, 1);\n },\n [AudioVisualizerMessageAction.SET]: ({ data }: MessagePayload) => {\n if (!canvas || !ctx || !data) return;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n const arraySum = data.reduce((a:number, value:number) => a + value, 0);\n const average = arraySum / data.length;\n const percentage = Math.round((average / 255) * 100);\n ctx.beginPath();\n const radius = Math.min(baseRadius + percentage / 2, canvas.width / 2 - MARGIN);\n ctx.fillStyle = '#6690ff55';\n ctx.arc(canvas.width / 2, canvas.height / 2, radius + 5, 0, 2 * Math.PI);\n ctx.fill();\n ctx.beginPath();\n ctx.fillStyle = '#6690ff';\n ctx.arc(canvas.width / 2, canvas.height / 2, radius, 0, 2 * Math.PI);\n ctx.fill();\n },\n [AudioVisualizerMessageAction.CLEAR]: () => {\n if (!canvas || !ctx) return;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n },\n};\n\nonmessage = (event: AudioVisualizerMessage) => {\n const { action, payload } = event.data;\n actions[action](payload);\n};\n"],"names":["AudioVisualizerMessageAction","canvas","ctx","baseRadius","MARGIN","actions","payload","data","average","a","value","percentage","radius","event","action"],"mappings":"yBAAkB,IAAAA,GAAAA,IAChBA,EAAA,KAAO,OACPA,EAAA,IAAM,MACNA,EAAA,MAAQ,QAHQA,IAAAA,GAAA,CAAA,CAAA,ECKlB,IAAIC,EAAiC,KACjCC,EAAgD,KAChDC,EAAa,GACjB,MAAMC,EAAS,GAETC,EAAsF,CAC1F,CAACL,EAA6B,IAAI,EAAIM,GAA4B,CAC3DA,EAAQ,SACbL,EAASK,EAAQ,OACjBH,EAAa,KAAK,IAAIF,EAAO,MAAOA,EAAO,MAAM,EAAI,EAC/CC,EAAAD,EAAO,WAAW,IAAI,EAC5BC,EAAK,UAAY,UACZA,EAAA,MAAM,EAAG,CAAC,EACjB,EACA,CAACF,EAA6B,GAAG,EAAG,CAAC,CAAE,KAAAO,KAA2B,CAChE,GAAI,CAACN,GAAU,CAACC,GAAO,CAACK,EAAM,OAC9BL,EAAI,UAAU,EAAG,EAAGD,EAAO,MAAOA,EAAO,MAAM,EAEzC,MAAAO,EADWD,EAAK,OAAO,CAACE,EAAUC,IAAiBD,EAAIC,EAAO,CAAC,EAC1CH,EAAK,OAC1BI,EAAa,KAAK,MAAOH,EAAU,IAAO,GAAG,EACnDN,EAAI,UAAU,EACR,MAAAU,EAAS,KAAK,IAAIT,EAAaQ,EAAa,EAAGV,EAAO,MAAQ,EAAIG,CAAM,EAC9EF,EAAI,UAAY,YAChBA,EAAI,IAAID,EAAO,MAAQ,EAAGA,EAAO,OAAS,EAAGW,EAAS,EAAG,EAAG,EAAI,KAAK,EAAE,EACvEV,EAAI,KAAK,EACTA,EAAI,UAAU,EACdA,EAAI,UAAY,UACZA,EAAA,IAAID,EAAO,MAAQ,EAAGA,EAAO,OAAS,EAAGW,EAAQ,EAAG,EAAI,KAAK,EAAE,EACnEV,EAAI,KAAK,CACX,EACA,CAACF,EAA6B,KAAK,EAAG,IAAM,CACtC,CAACC,GAAU,CAACC,GAChBA,EAAI,UAAU,EAAG,EAAGD,EAAO,MAAOA,EAAO,MAAM,CACjD,CACF,EAEA,UAAaY,GAAkC,CAC7C,KAAM,CAAE,OAAAC,EAAQ,QAAAR,GAAYO,EAAM,KAC1BR,EAAAS,CAAM,EAAER,CAAO,CACzB"}
1
+ {"version":3,"file":"audioVisualizer.worker-DaYxk4EK.js","sources":["../src/interfaces/audioVisualizerInterface.ts","../src/workers/audioVisualizer.worker.ts"],"sourcesContent":["export const enum AudioVisualizerMessageAction {\n INIT = 'init',\n SET = 'set',\n CLEAR = 'clear',\n}\n\nexport type AudioVisualizerMessageParams = { action: AudioVisualizerMessageAction, payload: { canvas?: OffscreenCanvas, data?: Uint8Array } };\nexport type AudioVisualizerMessage = MessageEvent<AudioVisualizerMessageParams>;\n","/* eslint-disable no-plusplus */\nimport { AudioVisualizerMessage, AudioVisualizerMessageAction } from '../interfaces/audioVisualizerInterface';\n\ntype MessagePayload = AudioVisualizerMessage['data']['payload'];\n\nlet canvas: OffscreenCanvas | null = null;\nlet ctx: OffscreenCanvasRenderingContext2D | null = null;\nlet baseRadius = 40;\nconst MARGIN = 20;\n\nconst actions: { [K in AudioVisualizerMessageAction]: (payload: MessagePayload) => void } = {\n [AudioVisualizerMessageAction.INIT]: (payload: MessagePayload) => {\n if (!payload.canvas) return;\n canvas = payload.canvas;\n baseRadius = Math.min(canvas.width, canvas.height) / 5;\n ctx = canvas.getContext('2d');\n ctx!.fillStyle = '#6690ff';\n ctx!.scale(1, 1);\n },\n [AudioVisualizerMessageAction.SET]: ({ data }: MessagePayload) => {\n if (!canvas || !ctx || !data) return;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n const arraySum = data.reduce((a:number, value:number) => a + value, 0);\n const average = arraySum / data.length;\n const percentage = Math.round((average / 255) * 100);\n ctx.beginPath();\n const radius = Math.min(baseRadius + percentage / 2, canvas.width / 2 - MARGIN);\n ctx.fillStyle = '#6690ff55';\n ctx.arc(canvas.width / 2, canvas.height / 2, radius + 5, 0, 2 * Math.PI);\n ctx.fill();\n ctx.beginPath();\n ctx.fillStyle = '#6690ff';\n ctx.arc(canvas.width / 2, canvas.height / 2, radius, 0, 2 * Math.PI);\n ctx.fill();\n },\n [AudioVisualizerMessageAction.CLEAR]: () => {\n if (!canvas || !ctx) return;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n },\n};\n\nonmessage = (event: AudioVisualizerMessage) => {\n const { action, payload } = event.data;\n actions[action](payload);\n};\n"],"names":["AudioVisualizerMessageAction","canvas","ctx","baseRadius","MARGIN","actions","payload","data","average","a","value","percentage","radius","event","action"],"mappings":"yBAAO,IAAWA,GAAAA,IAChBA,EAAA,KAAO,OACPA,EAAA,IAAM,MACNA,EAAA,MAAQ,QAHQA,IAAAA,GAAA,CAAA,CAAA,ECKlB,IAAIC,EAAiC,KACjCC,EAAgD,KAChDC,EAAa,GACjB,MAAMC,EAAS,GAETC,EAAsF,CAC1F,CAACL,EAA6B,IAAI,EAAIM,GAA4B,CAC3DA,EAAQ,SACbL,EAASK,EAAQ,OACjBH,EAAa,KAAK,IAAIF,EAAO,MAAOA,EAAO,MAAM,EAAI,EACrDC,EAAMD,EAAO,WAAW,IAAI,EAC5BC,EAAK,UAAY,UACjBA,EAAK,MAAM,EAAG,CAAC,EACjB,EACA,CAACF,EAA6B,GAAG,EAAG,CAAC,CAAE,KAAAO,KAA2B,CAChE,GAAI,CAACN,GAAU,CAACC,GAAO,CAACK,EAAM,OAC9BL,EAAI,UAAU,EAAG,EAAGD,EAAO,MAAOA,EAAO,MAAM,EAE/C,MAAMO,EADWD,EAAK,OAAO,CAACE,EAAUC,IAAiBD,EAAIC,EAAO,CAAC,EAC1CH,EAAK,OAC1BI,EAAa,KAAK,MAAOH,EAAU,IAAO,GAAG,EACnDN,EAAI,UAAA,EACJ,MAAMU,EAAS,KAAK,IAAIT,EAAaQ,EAAa,EAAGV,EAAO,MAAQ,EAAIG,CAAM,EAC9EF,EAAI,UAAY,YAChBA,EAAI,IAAID,EAAO,MAAQ,EAAGA,EAAO,OAAS,EAAGW,EAAS,EAAG,EAAG,EAAI,KAAK,EAAE,EACvEV,EAAI,KAAA,EACJA,EAAI,UAAA,EACJA,EAAI,UAAY,UAChBA,EAAI,IAAID,EAAO,MAAQ,EAAGA,EAAO,OAAS,EAAGW,EAAQ,EAAG,EAAI,KAAK,EAAE,EACnEV,EAAI,KAAA,CACN,EACA,CAACF,EAA6B,KAAK,EAAG,IAAM,CACtC,CAACC,GAAU,CAACC,GAChBA,EAAI,UAAU,EAAG,EAAGD,EAAO,MAAOA,EAAO,MAAM,CACjD,CACF,EAEA,UAAaY,GAAkC,CAC7C,KAAM,CAAE,OAAAC,EAAQ,QAAAR,CAAA,EAAYO,EAAM,KAClCR,EAAQS,CAAM,EAAER,CAAO,CACzB"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,80 @@
1
+ import { Conversation } from '@twilio/conversations';
1
2
  import { JSX as JSX_2 } from 'react/jsx-runtime';
3
+ import { LastMessage } from '@twilio/conversations';
4
+ import { Media } from '@twilio/conversations';
5
+ import { Message } from '@twilio/conversations';
6
+ import { Participant } from '@twilio/conversations';
7
+ import { User } from '@twilio/conversations';
8
+
9
+ declare type AvailabilityModule = ChatModule<ModuleName.AVAILABILITY, ModuleType.QUESTION, MultiAnswerQuestions>;
2
10
 
3
11
  export declare const ChatbotClient: (clientConfig?: IChatbotClient) => JSX_2.Element;
4
12
 
13
+ declare type ChatModule<N extends ModuleName, T extends ModuleType, D extends ModuleDataAnswer | EmptyObject = EmptyObject> = {
14
+ id: string;
15
+ name: N;
16
+ type: T;
17
+ completed: boolean;
18
+ data: GenericConfig & D;
19
+ };
20
+
21
+ declare const enum CustomAction {
22
+ SEND_MESSAGE = "sendMessage",
23
+ SHOW_TNC = "showTnc",
24
+ SHOW_FEEDBACK = "showFeedback",
25
+ OPEN_LINK = "openLink"
26
+ }
27
+
28
+ declare const enum DateFormat {
29
+ GBR = "DD/MM/YYYY",
30
+ US = "MM/DD/YYYY"
31
+ }
32
+
33
+ declare type DateFormatData = {
34
+ format: DateFormat;
35
+ };
36
+
37
+ declare type DateModule = ChatModule<ModuleName.DATE, ModuleType.DATE, DateFormatData>;
38
+
39
+ declare enum DocumentType_2 {
40
+ Passport = "P",
41
+ DriversLicense = "D",
42
+ IdentityCard = "I"
43
+ }
44
+
45
+ declare type DropdownModule = ChatModule<ModuleName.DROPDOWN, ModuleType.DROPDOWN, SingleSelect>;
46
+
47
+ declare type EmailModule = ChatModule<ModuleName.EMAIL, ModuleType.EMAIL>;
48
+
49
+ declare type EmptyObject = Record<never, never>;
50
+
51
+ declare type Feedback = {
52
+ points: 1 | 0 | -1;
53
+ note?: string;
54
+ };
55
+
56
+ declare type FeedbackModule = ChatModule<ModuleName.FEEDBACK, ModuleType.FEEDBACK, Feedback>;
57
+
58
+ declare type FileUploadModule = ChatModule<ModuleName.FILE_UPLOAD, ModuleType.FILE_UPLOAD>;
59
+
60
+ declare type FreeTextModule = ChatModule<ModuleName.FREE_TEXT, ModuleType.FREE_TEXT>;
61
+
62
+ declare type GenericConfig = {
63
+ title: string;
64
+ description: string;
65
+ required?: boolean;
66
+ questionMedia?: QuestionMedia;
67
+ antiCheat?: boolean;
68
+ forceRecording?: boolean;
69
+ buttonText?: string;
70
+ };
71
+
72
+ declare type GenericOption = {
73
+ id: string;
74
+ title: string;
75
+ selected: boolean;
76
+ };
77
+
5
78
  declare interface IChatbot {
6
79
  config: IConfig;
7
80
  candidate_id?: string;
@@ -34,21 +107,59 @@ declare interface IConfig {
34
107
  primaryDarkColor: string;
35
108
  secondaryDarkColor: string;
36
109
  };
110
+ enabledIntercom?: boolean;
37
111
  dtnc?: boolean;
38
112
  onOpen?: () => void;
39
113
  onClose?: () => void;
40
- onConversationCreated?: ({ sid, candidate_id }: {
114
+ onConversationCreated?: ({ sid, candidate_id, user_identity, conversation_attributes }: {
41
115
  sid: string;
42
116
  candidate_id: string;
117
+ user_identity: IMain['currentUser']['identity'];
118
+ conversation_attributes: IMain['conversations'][number]['attributes'];
43
119
  }) => void;
120
+ onHelpClicked?: ({ candidate_id, conversation_sid, user_identity, conversation_attributes }: Partial<{
121
+ candidate_id: string;
122
+ conversation_sid: IMain['selectedConversationId'];
123
+ user_identity: IMain['currentUser']['identity'];
124
+ conversation_attributes: IMain['conversations'][number]['attributes'];
125
+ }>) => void;
44
126
  onFinish?: (data: IOnFinishData) => void;
45
127
  onError?: (data: IOnErrorData) => void;
46
128
  }
47
129
 
48
130
  declare type IConfigClient = Partial<Omit<IConfig, 'usePopup' | 'isReady' | 'validationStatus' | 'dtnc'>>;
49
131
 
132
+ declare type IDAnalayzerMethod = {
133
+ methods: DocumentType_2[];
134
+ };
135
+
136
+ declare type IDAnalayzerModule = ChatModule<ModuleName.ID_ANALYZER, ModuleType.ID_ANALYZER, IDAnalayzerMethod>;
137
+
50
138
  declare type IEnv = 'development' | 'staging' | 'production';
51
139
 
140
+ declare interface IMain {
141
+ users: {
142
+ [userId: ReduxUser['identity']]: ReduxUser;
143
+ };
144
+ currentUser: ReduxUser;
145
+ conversations: ReduxConversation[];
146
+ messages: {
147
+ [convoSid: Conversation['sid']]: ReduxMessage[];
148
+ };
149
+ participants: {
150
+ [convoSid: Conversation['sid']]: ReduxParticipant[];
151
+ };
152
+ typingData: {
153
+ [convoSid: Conversation['sid']]: ReduxParticipant['sid'][];
154
+ };
155
+ selectedConversationId: string;
156
+ }
157
+
158
+ declare interface IMediaDimensions {
159
+ width: number;
160
+ height: number;
161
+ }
162
+
52
163
  declare interface IOnErrorData {
53
164
  errorMessage: string;
54
165
  }
@@ -63,13 +174,240 @@ declare type ITheme = 'light' | 'dark' | 'deviceDefault';
63
174
 
64
175
  declare type ITimeFormat = '12h' | '24h' | 'deviceDefault';
65
176
 
177
+ declare type JobsModule = ChatModule<ModuleName.JOBS, ModuleType.JOBS, JobsModuleData>;
178
+
179
+ declare type JobsModuleData = {
180
+ jobs: {
181
+ job_id: string;
182
+ title: string;
183
+ }[];
184
+ count: number;
185
+ selected_id: string;
186
+ };
187
+
188
+ declare type LinkModule = ChatModule<ModuleName.URL, ModuleType.LINK>;
189
+
190
+ declare type LocationModule = ChatModule<ModuleName.LOCATION, ModuleType.LOCATION>;
191
+
192
+ declare type MatrixModule = ChatModule<ModuleName.MATRIX_CHOICE, ModuleType.QUESTION, MultiAnswerQuestions>;
193
+
194
+ declare type MessageModule = (AvailabilityModule | DateModule | DropdownModule | EmailModule | FileUploadModule | FreeTextModule | IDAnalayzerModule | LinkModule | LocationModule | MatrixModule | MultiSelectModule | NumberModule | PhoneNumberModule | ScheduleModule | SingleSelectModule | WidgetModule | YesNoSelectModule | JobsModule | TncModule | FeedbackModule);
195
+
196
+ declare type ModuleDataAnswer = SingleSelect | MultiSelect | MultiAnswerQuestions | DateFormatData | IDAnalayzerMethod | ScheduleConfig | JobsModuleData | TncConfig | Feedback;
197
+
198
+ declare const enum ModuleName {
199
+ YES_NO = "YES_NO",
200
+ SINGLE_CHOICE = "SINGLE_CHOICE",
201
+ MULTIPLE_CHOICE = "MULTIPLE_CHOICE",
202
+ FREE_TEXT = "FREE_TEXT",
203
+ LOCATION = "LOCATION",
204
+ DATE = "DATE",
205
+ EMAIL = "EMAIL",
206
+ PHONE_NUMBER = "PHONE_NUMBER",
207
+ FILE_UPLOAD = "FILE_UPLOAD",
208
+ URL = "URL",
209
+ NUMBER = "NUMBER",
210
+ DROPDOWN = "DROPDOWN",
211
+ WIDGET = "WIDGET",
212
+ SCHEDULE = "SCHEDULE",
213
+ MATRIX_CHOICE = "MATRIX_CHOICE",
214
+ AVAILABILITY = "AVAILABILITY",
215
+ ID_ANALYZER = "ID_ANALYZER",
216
+ JOBS = "JOBS",
217
+ TNC = "TNC",
218
+ FEEDBACK = "FEEDBACK",
219
+ THANK_YOU = "THANK_YOU",
220
+ REJECT = "REJECT"
221
+ }
222
+
223
+ declare const enum ModuleType {
224
+ YES_NO = "yesNoSelectInput",
225
+ SINGLE_SELECT = "singleSelectInput",
226
+ MULTI_SELECT = "multiSelectInput",
227
+ DROPDOWN = "dropdownInput",
228
+ FREE_TEXT = "freeTextInput",
229
+ LOCATION = "locationInput",
230
+ DATE = "dateInput",
231
+ EMAIL = "emailInput",
232
+ PHONE_NUMBER = "phoneNumberInput",
233
+ FILE_UPLOAD = "fileUploadInput",
234
+ LINK = "linkInput",
235
+ NUMBER = "numberInput",
236
+ QUESTION = "questions",
237
+ SCHEDULE_MEETING = "scheduleMeeting",
238
+ WIDGET = "widget",
239
+ ID_ANALYZER = "idAnalyzer",
240
+ JOBS = "jobs",
241
+ TNC = "tnc",
242
+ FEEDBACK = "feedback"
243
+ }
244
+
245
+ declare type MultiAnswerQuestions = Questions<{
246
+ selected_ids: GenericOption['id'][];
247
+ }>;
248
+
249
+ declare type MultiSelect = Options<{
250
+ selected_ids: GenericOption['id'][];
251
+ maxSelected: number;
252
+ minSelected: number;
253
+ }>;
254
+
255
+ declare type MultiSelectModule = ChatModule<ModuleName.MULTIPLE_CHOICE, ModuleType.MULTI_SELECT, MultiSelect>;
256
+
257
+ declare type NumberModule = ChatModule<ModuleName.NUMBER, ModuleType.NUMBER>;
258
+
259
+ declare type Options<T> = {
260
+ options: GenericOption[];
261
+ } & T;
262
+
263
+ declare type PhoneNumberModule = ChatModule<ModuleName.PHONE_NUMBER, ModuleType.PHONE_NUMBER>;
264
+
265
+ declare type Question = {
266
+ id: string;
267
+ title: string;
268
+ selectAllTitle?: string;
269
+ answers: GenericOption[];
270
+ };
271
+
272
+ declare type QuestionMedia = {
273
+ questionType?: QuestionType;
274
+ questionUrl?: string;
275
+ };
276
+
277
+ declare type Questions<T> = {
278
+ questions: (Question & T)[];
279
+ };
280
+
281
+ declare const enum QuestionType {
282
+ TEXT_ONLY = "",
283
+ IMAGE = "image",
284
+ VIDEO = "video"
285
+ }
286
+
287
+ declare type ReduxConversation = Pick<Conversation, 'friendlyName' | 'lastReadMessageIndex' | 'notificationLevel' | 'sid'> & {
288
+ readonly dateUpdated: number | null;
289
+ readonly dateCreated: number | null;
290
+ readonly lastMessage: {
291
+ readonly dateCreated: number | undefined;
292
+ readonly index: LastMessage['index'];
293
+ };
294
+ readonly attributes: ReduxConversationAttributes;
295
+ };
296
+
297
+ declare type ReduxConversationAttributes = {
298
+ candidate_id: string;
299
+ video_id: string;
300
+ company_id: string;
301
+ job_id: string;
302
+ locale_calendar: string;
303
+ locale_day: string;
304
+ locale_locale: string;
305
+ locale_month: string;
306
+ locale_numberingSystem: string;
307
+ locale_timeZone: string;
308
+ locale_year: string;
309
+ photoUrl: string;
310
+ bot_action?: string;
311
+ email?: string;
312
+ username?: string;
313
+ lang?: string;
314
+ text?: {
315
+ online?: string;
316
+ offline?: string;
317
+ input_placeholder?: string;
318
+ waiting_for_permission?: string;
319
+ record_answer?: string;
320
+ };
321
+ };
322
+
323
+ declare type ReduxCurrentUserAttributes = {
324
+ thumb?: string;
325
+ };
326
+
327
+ declare type ReduxMedia = Pick<Media, 'sid' | 'filename' | 'contentType' | 'size' | 'category'>;
328
+
329
+ declare type ReduxMessage = Pick<Message, 'sid' | 'author' | 'body' | 'index' | 'participantSid' | 'type'> & {
330
+ readonly dateCreated: number | null;
331
+ readonly attributes: ReduxMessageAttributes;
332
+ readonly attachedMedia: ReduxMedia[] | null;
333
+ readonly type?: string;
334
+ };
335
+
336
+ declare type ReduxMessageAttributes = {
337
+ module?: MessageModule;
338
+ module_id?: string;
339
+ ts?: number;
340
+ mediaDimensions?: IMediaDimensions;
341
+ photoUrl?: string;
342
+ transcript?: string;
343
+ suggestions?: Suggestion[];
344
+ };
345
+
346
+ declare type ReduxParticipant = Pick<Participant, 'sid' | 'identity' | 'type' | 'lastReadMessageIndex'> & {
347
+ readonly attributes: ReduxParticipantAttributes;
348
+ };
349
+
350
+ declare type ReduxParticipantAttributes = {
351
+ thumb?: string;
352
+ };
353
+
354
+ declare type ReduxUser = Pick<User, 'identity'> & {
355
+ readonly attributes: ReduxCurrentUserAttributes;
356
+ };
357
+
358
+ declare type ScheduleConfig = {
359
+ schedule: {
360
+ availability_days: number;
361
+ conferencing: {
362
+ name: string;
363
+ profile_id: string;
364
+ };
365
+ description: string;
366
+ required_duration: number;
367
+ title: string;
368
+ };
369
+ buttonText?: {
370
+ scheduled: 'Scheduled';
371
+ scheduling: 'Scheduling...';
372
+ schedule: 'Schedule';
373
+ };
374
+ };
375
+
376
+ declare type ScheduleModule = ChatModule<ModuleName.SCHEDULE, ModuleType.SCHEDULE_MEETING, ScheduleConfig>;
377
+
378
+ declare type SingleSelect = Options<{
379
+ selected_id: GenericOption['id'];
380
+ }>;
381
+
382
+ declare type SingleSelectModule = ChatModule<ModuleName.SINGLE_CHOICE, ModuleType.SINGLE_SELECT, SingleSelect>;
383
+
384
+ declare type Suggestion = {
385
+ text: string;
386
+ attributes: Record<string, unknown>;
387
+ customActions: CustomAction[];
388
+ layouts?: SuggestionLayouts[];
389
+ };
390
+
391
+ declare type SuggestionLayouts = 'box';
392
+
393
+ declare type TncConfig = {
394
+ company: string;
395
+ url?: string;
396
+ agreed: boolean;
397
+ header?: string;
398
+ body?: string;
399
+ buttonText?: {
400
+ cta: string;
401
+ agree: string;
402
+ disagree: string;
403
+ };
404
+ };
405
+
406
+ declare type TncModule = ChatModule<ModuleName.TNC, ModuleType.TNC, TncConfig>;
407
+
66
408
  export declare const usePopupChatbot: () => {
67
- init: (clientConfig: Partial<Omit<IChatbot, "config"> & {
68
- config: Partial<Omit<IConfig, "usePopup" | "isReady" | "validationStatus" | "dtnc">>;
69
- }>) => void;
70
- update: (clientConfig?: Partial<Omit<IChatbot, "config"> & {
71
- config: Partial<Omit<IConfig, "usePopup" | "isReady" | "validationStatus" | "dtnc">>;
72
- }>) => void;
409
+ init: (clientConfig: IChatbotClient) => void;
410
+ update: (clientConfig?: IChatbotClient) => void;
73
411
  shutdown: () => void;
74
412
  };
75
413
 
@@ -79,4 +417,16 @@ declare const enum ValidationStatus {
79
417
  NOT_FOUND = 2
80
418
  }
81
419
 
420
+ declare type Widget = {
421
+ buttonText?: {
422
+ start: string;
423
+ resume: string;
424
+ completed: string;
425
+ };
426
+ };
427
+
428
+ declare type WidgetModule = ChatModule<ModuleName.WIDGET, ModuleType.WIDGET, Widget>;
429
+
430
+ declare type YesNoSelectModule = ChatModule<ModuleName.YES_NO, ModuleType.YES_NO, SingleSelect>;
431
+
82
432
  export { }