@unblu/embedded-app-component 8.19.1 → 8.21.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 (54) hide show
  1. package/dist/lib/index.d.ts +39 -0
  2. package/dist/lib/internal/internal-embedded-api.d.ts +16 -0
  3. package/dist/lib/internal/module/embedded-meta-module.d.ts +17 -0
  4. package/dist/lib/internal/module/general-module.d.ts +16 -0
  5. package/dist/lib/shared/api-state.d.ts +8 -0
  6. package/dist/lib/shared/conversation.d.ts +313 -0
  7. package/dist/lib/shared/internal/api-bridge.d.ts +36 -0
  8. package/dist/lib/shared/internal/event.d.ts +6 -0
  9. package/dist/lib/shared/internal/initialized-unblu-api.d.ts +10 -0
  10. package/dist/lib/shared/internal/initialized-unblu-element.d.ts +10 -0
  11. package/dist/lib/shared/internal/java-error-codes.d.ts +5 -0
  12. package/dist/lib/shared/internal/model/destroy-mode.d.ts +4 -0
  13. package/dist/lib/shared/internal/model/destroy-options.d.ts +4 -0
  14. package/dist/lib/shared/internal/module/agent-availability-module.d.ts +14 -0
  15. package/dist/lib/shared/internal/module/base-general-module.d.ts +35 -0
  16. package/dist/lib/shared/internal/module/conversation-module.d.ts +64 -0
  17. package/dist/lib/shared/internal/module/module.d.ts +10 -0
  18. package/dist/lib/shared/internal/unblu-floating-api.d.ts +15 -0
  19. package/dist/lib/shared/internal/unblu-util.d.ts +76 -0
  20. package/dist/lib/shared/internal/util/event-emitter.d.ts +44 -0
  21. package/dist/lib/shared/model/agent-availability-state.d.ts +18 -0
  22. package/dist/lib/shared/model/branchclient/language.d.ts +14 -0
  23. package/dist/lib/shared/model/branchclient/named-area-agent-availability.d.ts +19 -0
  24. package/dist/lib/shared/model/call-connection-state.d.ts +18 -0
  25. package/dist/lib/shared/model/call-state.d.ts +30 -0
  26. package/dist/lib/shared/model/configuration.d.ts +53 -0
  27. package/dist/lib/shared/model/connection-state.d.ts +27 -0
  28. package/dist/lib/shared/model/conversation-info.d.ts +42 -0
  29. package/dist/lib/shared/model/conversation-message-info.d.ts +14 -0
  30. package/dist/lib/shared/model/conversation-participant.d.ts +15 -0
  31. package/dist/lib/shared/model/conversation-participation-type.d.ts +18 -0
  32. package/dist/lib/shared/model/conversation-recipient-type.d.ts +18 -0
  33. package/dist/lib/shared/model/conversation-recipient.d.ts +18 -0
  34. package/dist/lib/shared/model/conversation-state.d.ts +37 -0
  35. package/dist/lib/shared/model/conversation-type.d.ts +47 -0
  36. package/dist/lib/shared/model/customaction/custom-action-invocation.d.ts +27 -0
  37. package/dist/lib/shared/model/customaction/custom-conversation-action-invocation.d.ts +6 -0
  38. package/dist/lib/shared/model/customaction/custom-message-action-invocation.d.ts +16 -0
  39. package/dist/lib/shared/model/customaction/custom-person-action-invocation.d.ts +11 -0
  40. package/dist/lib/shared/model/new-conversation-interceptor-result.d.ts +14 -0
  41. package/dist/lib/shared/model/new-conversation-recipient-type.d.ts +10 -0
  42. package/dist/lib/shared/model/new-conversation-recipient.d.ts +14 -0
  43. package/dist/lib/shared/model/person-info.d.ts +5 -0
  44. package/dist/lib/shared/new-conversation-interceptor.d.ts +24 -0
  45. package/dist/lib/shared/unblu-api-error.d.ts +117 -0
  46. package/dist/lib/unblu-embedded-api.d.ts +554 -0
  47. package/dist/lib/unblu-embedded-api.js +1 -3
  48. package/dist/lib/unblu-embedded-api.js.map +1 -1
  49. package/dist/lib/unblu-embedded-app-element.d.ts +708 -0
  50. package/dist/lib/unblu-embedded-app-element.js +1 -3
  51. package/dist/lib/unblu-embedded-app-element.js.map +1 -1
  52. package/dist/lib/view-mode.d.ts +5 -0
  53. package/dist/lib/web-types.json +1 -1
  54. package/package.json +1 -1
@@ -0,0 +1,708 @@
1
+ import { UnbluApiError } from "./shared/unblu-api-error";
2
+ import { ViewMode } from "./view-mode";
3
+ import { ApiState } from "./shared/api-state";
4
+ import { InitializedUnbluElement } from "./shared/internal/initialized-unblu-element";
5
+ import { UnbluEmbeddedApi } from "./unblu-embedded-api";
6
+ import { DestroyOptions } from "./shared/internal/model/destroy-options";
7
+ /**
8
+ * Event emitted whenever the API state changes
9
+ *
10
+ * @see {@link UnbluEmbeddedAppElement.STATE_CHANGE}
11
+ * @see {@link UnbluEmbeddedAppElement.addEventListener}
12
+ * @see {@link UnbluEmbeddedAppElement.removeEventListener}
13
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent | Custom Event}
14
+ * @noInheritDoc
15
+ */
16
+ export declare interface StateChangeEvent extends CustomEvent<ApiState> {
17
+ /**
18
+ * The new api state
19
+ */
20
+ readonly detail: ApiState;
21
+ }
22
+ /**
23
+ * Event emitted as soon as the API is initialized.
24
+ * It emits an instance of {@link UnbluEmbeddedApi} which can be used for further API calls.
25
+ *
26
+ * This event is useful when {@link UnbluEmbeddedAppElement.autoInit} is true to always get the latest API instance.
27
+ *
28
+ * **Note**: that this event will be triggered again after each initialization.
29
+ *
30
+ * @see {@link UnbluEmbeddedAppElement.READY}
31
+ * @see {@link UnbluEmbeddedAppElement.addEventListener}
32
+ * @see {@link UnbluEmbeddedAppElement.removeEventListener}
33
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent | Custom Event}
34
+ * @noInheritDoc
35
+ */
36
+ export declare interface ReadyEvent extends CustomEvent<UnbluEmbeddedApi> {
37
+ }
38
+ /**
39
+ * Event emitted if the API initialization fails.
40
+ *
41
+ * It usually makes sense to use this event if there is some general action that has to be triggered when the API initialization fails.
42
+ *
43
+ * @see {@link UnbluEmbeddedAppElement.ERROR}
44
+ * @see {@link UnbluEmbeddedAppElement.addEventListener}
45
+ * @see {@link UnbluEmbeddedAppElement.removeEventListener}
46
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent | Custom Event}
47
+ * @noInheritDoc
48
+ */
49
+ export declare interface ErrorEvent extends CustomEvent<UnbluApiError> {
50
+ /**
51
+ * The error which occurred
52
+ */
53
+ readonly detail: UnbluApiError;
54
+ }
55
+ /**
56
+ * Event emitted when the de-initialization of the API is started.
57
+ *
58
+ * It usually makes sense to use this event to clean up resources and/or unregistering of listeners so they don't try to use the API again until it is initialized again.
59
+ *
60
+ * @see {@link UnbluEmbeddedAppElement.DEINITIALIZING}
61
+ * @see {@link UnbluEmbeddedAppElement.addEventListener}
62
+ * @see {@link UnbluEmbeddedAppElement.removeEventListener}
63
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent | Custom Event}
64
+ * @see {@link UnbluEmbeddedApi.DeinitializationListener} for the corresponding javascript event on the initialized {@link UnbluEmbeddedApi} instance
65
+ * @noInheritDoc
66
+ */
67
+ export declare interface DeinitializationStartedEvent extends CustomEvent<null> {
68
+ }
69
+ /**
70
+ * Event emitted when the de-initialization of the API has finished.
71
+ *
72
+ * It usually makes sense to use this event if a re-initialization is required after de-init.
73
+ *
74
+ * @see {@link UnbluEmbeddedAppElement.DEINITIALIZED}
75
+ * @see {@link UnbluEmbeddedAppElement.addEventListener}
76
+ * @see {@link UnbluEmbeddedAppElement.removeEventListener}
77
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent | Custom Event}
78
+ * @see {@link UnbluEmbeddedApi.DeinitializationListener} for the corresponding javascript event on the initialized {@link UnbluEmbeddedApi} instance
79
+ * @noInheritDoc
80
+ */
81
+ export declare interface DeinitializationFinishedEvent extends CustomEvent<null> {
82
+ }
83
+ /**
84
+ * Event emitted every time the active conversation changes.
85
+ *
86
+ * @see {@link UnbluEmbeddedAppElement.ACTIVE_CONVERSATION_CHANGE}
87
+ * @see {@link UnbluEmbeddedAppElement.addEventListener}
88
+ * @see {@link UnbluEmbeddedAppElement.removeEventListener}
89
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent | Custom Event}
90
+ * @see {@link UnbluEmbeddedApi.ActiveConversationChangeListener} for the corresponding javascript event on the initialized {@link UnbluEmbeddedApi} instance
91
+ * @noInheritDoc
92
+ */
93
+ export declare interface ActiveConversationChangeEvent extends CustomEvent<string | null> {
94
+ /**
95
+ * The id of the new active conversation or null if no conversation is active
96
+ */
97
+ readonly detail: string | null;
98
+ }
99
+ /**
100
+ * Event emitted every time the embedded app switches to fullscreen mode or back.
101
+ *
102
+ * @see {@link UnbluEmbeddedAppElement.FULLSCREEN_CHANGE}
103
+ * @see {@link UnbluEmbeddedAppElement.addEventListener}
104
+ * @see {@link UnbluEmbeddedAppElement.removeEventListener}
105
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent | Custom Event}
106
+ * @see {@link UnbluEmbeddedApi.FullscreenChangeListener} for the corresponding javascript event on the initialized {@link UnbluEmbeddedApi} instance
107
+ * @noInheritDoc
108
+ */
109
+ export declare interface FullscreenChangeEvent extends CustomEvent<boolean> {
110
+ /**
111
+ * True if in fullscreen mode, false otherwise
112
+ */
113
+ readonly detail: boolean;
114
+ }
115
+ /**
116
+ * Event emitted every time the view mode changes.
117
+ *
118
+ * @see {@link UnbluEmbeddedAppElement.VIEW_MODE_CHANGE}
119
+ * @see {@link UnbluEmbeddedAppElement.addEventListener}
120
+ * @see {@link UnbluEmbeddedAppElement.removeEventListener}
121
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent | Custom Event}
122
+ * @see {@link UnbluEmbeddedApi.ViewModeChangeListener} for the corresponding javascript event on the initialized {@link UnbluEmbeddedApi} instance
123
+ * @noInheritDoc
124
+ */
125
+ export declare interface ViewModeChangeEvent extends CustomEvent<ViewMode> {
126
+ /**
127
+ * The new view mode
128
+ */
129
+ readonly detail: ViewMode;
130
+ }
131
+ /**
132
+ * #### This is a custom element which can be used to integrate Unblu into a webpage at a specific location.
133
+ * By itself this contains only the definition of the custom element and will load further JavaScript from the collaboration server on initialization to provide the full functionality.
134
+ *
135
+ * To use the custom element just place a tag named "unblu-embedded-app" somewhere into the webpage`s `body`.
136
+ *
137
+ * ```html
138
+ * ...
139
+ * <body>
140
+ * ...
141
+ * <div>
142
+ * <unblu-embedded-app></unblu-embedded-app>
143
+ * </div>
144
+ * ...
145
+ * </body>
146
+ * ...
147
+ * ```
148
+ * The size and positioning fully depends on the styles applied to the element by the website it is embedded into.
149
+ * The styling within the unblu embedded app can't be influenced by the website's styles however as a shadow root is used for its content.
150
+ * Unblu provides a large list of configuration properties to nicely integrate the unblu embedded app's visual appearance with the website it is embedded into.
151
+ *
152
+ * The example above will simply add the unblu embedded app into the `DOM` but it won't initialize anything.
153
+ * To initialize the element with Unblu content at least the attribute {@link ATTR_API_KEY} or property {@link UnbluEmbeddedAppElement.apiKey} need to be defined.
154
+ * If {@link UnbluEmbeddedAppElement.autoInit} is set to true (default), it will automatically start the initialization, as soon as the API key is defined either via its attribute {@link ATTR_API_KEY} or property {@link UnbluEmbeddedAppElement.apiKey}.
155
+ * If not a call to {@link UnbluEmbeddedAppElement.initialize} has to be done to trigger the initialization.
156
+ *
157
+ * **Initializing**:
158
+ *
159
+ * Initialization can either be done manually or automatically.
160
+ * If the element is configured to do automatic initialization {@link ATTR_AUTO_INIT} / {@link UnbluEmbeddedAppElement.autoInit} the initialization will be automatically started as soon as at least the API key {@link ATTR_API_KEY} / {@link UnbluEmbeddedAppElement.apiKey} is defined.
161
+ * If you intent to define other attributes/properties relevant for the initialization these must all be set in the same JavaScript execution cycle.
162
+ * If automatic initialization is disabled the initialization must be done manually by calling the {@link UnbluEmbeddedAppElement.initialize} method.
163
+ *
164
+ * There are additional attributes/properties which can be defined to define from where and how the Unblu JavaScript code is loaded from the collaboration server.
165
+ * - {@link ATTR_API_KEY} / {@link UnbluEmbeddedAppElement.apiKey}
166
+ * - {@link ATTR_ENTRY_PATH} / {@link UnbluEmbeddedAppElement.entryPath}
167
+ * - {@link ATTR_SERVER_URL} / {@link UnbluEmbeddedAppElement.serverUrl}
168
+ * - {@link ATTR_NAMED_AREA} / {@link UnbluEmbeddedAppElement.namedArea}
169
+ * - {@link ATTR_ACCESS_TOKEN} / {@link UnbluEmbeddedAppElement.accessToken}
170
+ * - {@link ATTR_LOCALE} / {@link UnbluEmbeddedAppElement.locale}
171
+ * - {@link ATTR_INIT_TIMEOUT} / {@link UnbluEmbeddedAppElement.initTimeout}
172
+ * - {@link ATTR_AUTO_INIT} / {@link UnbluEmbeddedAppElement.autoInit}
173
+ *
174
+ * The Unblu UI inside the custom element will always fill the whole content of the unblu-embedded-app independent of what size it is given.
175
+ *
176
+ * **Note**: if an Unblu Floating UI is already integrated on the website via the Floating JS API, the embedded app will automatically deinitialize it as there can always only one active instance of Unblu on the page.
177
+ *
178
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements | MDN Custom Element}
179
+ * @noInheritDoc
180
+ */
181
+ export declare class UnbluEmbeddedAppElement extends HTMLElement implements InitializedUnbluElement {
182
+ /**
183
+ * Event emitted whenever the API state changes
184
+ *
185
+ * @see {@link StateChangeEvent} for the event type
186
+ * @see {@link UnbluEmbeddedAppElement.addEventListener} for listener registration
187
+ * @see {@link UnbluEmbeddedAppElement.removeEventListener} to remove a listener
188
+ * @event stateChange
189
+ */
190
+ static readonly STATE_CHANGE: 'stateChange';
191
+ /**
192
+ * Event emitted as soon as the API is initialized.
193
+ *
194
+ * It usually makes sense to use this event to wait for APIs on this element to be ready. E.g. the {@link UnbluEmbeddedAppElement.personInfo} or {@link UnbluEmbeddedAppElement.agentAvailable}.
195
+ * You will find a note in the documentation of the properties when they are only available after initialization.
196
+ *
197
+ * @see {@link ReadyEvent} for the event type
198
+ * @see {@link UnbluEmbeddedAppElement.addEventListener} for listener registration
199
+ * @see {@link UnbluEmbeddedAppElement.removeEventListener} to remove a listener
200
+ * @event ready
201
+ */
202
+ static readonly READY: 'ready';
203
+ /**
204
+ * Event emitted if the API initialization fails.
205
+ *
206
+ * It usually makes sense to use this event if there is some general action that has to be triggered when the API initialization fails.
207
+ *
208
+ * @see {@link ErrorEvent} for the event type
209
+ * @see {@link UnbluEmbeddedAppElement.addEventListener} for listener registration
210
+ * @see {@link UnbluEmbeddedAppElement.removeEventListener} to remove a listener
211
+ * @event error
212
+ */
213
+ static readonly ERROR: 'error';
214
+ /**
215
+ * Event emitted when the de-initialization of the API is started..
216
+ *
217
+ * It usually makes sense to use this event to clean up resources and/or unregistering of listeners so they don't try to use the API again until it is initialized again.
218
+ *
219
+ * @see {@link DeinitializationStartedEvent} for the event type
220
+ * @see {@link UnbluEmbeddedAppElement.addEventListener} for listener registration
221
+ * @see {@link UnbluEmbeddedAppElement.removeEventListener} to remove a listener
222
+ * @see {@link UnbluEmbeddedApi.DEINITIALIZING} for the event on the initialized {@link UnbluEmbeddedApi} instance
223
+ * @event deinitializing
224
+ */
225
+ static readonly DEINITIALIZING: typeof UnbluEmbeddedApi.DEINITIALIZING;
226
+ /**
227
+ * Event emitted when the de-initialization of the API has finished.
228
+ *
229
+ * It usually makes sense to use this event if a re-initialization is required after de-init.
230
+ *
231
+ * @see {@link DeinitializationFinishedEvent} for the event type
232
+ * @see {@link UnbluEmbeddedAppElement.addEventListener} for listener registration
233
+ * @see {@link UnbluEmbeddedAppElement.removeEventListener} to remove a listener
234
+ * @see {@link UnbluEmbeddedApi.DEINITIALIZED} for the event on the initialized {@link UnbluEmbeddedApi} instance
235
+ * @event deinitialized
236
+ */
237
+ static readonly DEINITIALIZED: typeof UnbluEmbeddedApi.DEINITIALIZED;
238
+ /**
239
+ * Event emitted every time one of the conversations accessible to the current user changes or one is added or removed.
240
+ *
241
+ * @see {@link ActiveConversationChangeEvent} for the event type
242
+ * @see {@link UnbluEmbeddedAppElement.addEventListener} for listener registration
243
+ * @see {@link UnbluEmbeddedAppElement.removeEventListener} to remove a listener
244
+ * @see {@link UnbluEmbeddedApi.ACTIVE_CONVERSATION_CHANGE} for the event on the initialized {@link UnbluEmbeddedApi} instance
245
+ * @event activeConversationChange
246
+ */
247
+ static readonly ACTIVE_CONVERSATION_CHANGE: typeof UnbluEmbeddedApi.ACTIVE_CONVERSATION_CHANGE;
248
+ /**
249
+ * Event emitted every time the embedded app switches to fullscreen mode or back.
250
+ *
251
+ * @see {@link UnbluEmbeddedAppElement.FULLSCREEN_CHANGE}
252
+ * @see {@link UnbluEmbeddedAppElement.addEventListener}
253
+ * @see {@link UnbluEmbeddedAppElement.removeEventListener}
254
+ * @see {@link UnbluEmbeddedApi.FULLSCREEN_CHANGE} for the event on the initialized {@link UnbluEmbeddedApi} instance
255
+ * @event fullscreenChange
256
+ */
257
+ static readonly FULLSCREEN_CHANGE: typeof UnbluEmbeddedApi.FULLSCREEN_CHANGE;
258
+ /**
259
+ * Event emitted every time the view mode changes.
260
+ *
261
+ * @see {@link UnbluEmbeddedAppElement.VIEW_MODE_CHANGE}
262
+ * @see {@link UnbluEmbeddedAppElement.addEventListener}
263
+ * @see {@link UnbluEmbeddedAppElement.removeEventListener}
264
+ * @see {@link UnbluEmbeddedApi.VIEW_MODE_CHANGE} for the event on the initialized {@link UnbluEmbeddedApi} instance
265
+ * @event viewModeChange
266
+ */
267
+ static readonly VIEW_MODE_CHANGE: typeof UnbluEmbeddedApi.VIEW_MODE_CHANGE;
268
+ /**
269
+ * The URL to the collaboration server.
270
+ *
271
+ * If not specified it is assumed that the server is reachable on the domain of the current webpage at the defined {@link UnbluEmbeddedAppElement.entryPath}
272
+ *
273
+ * **Note**: Changes to this attribute trigger a reinitialization of Unblu if {@link UnbluEmbeddedAppElement.ATTR_AUTO_INIT} is true.
274
+ *
275
+ * @see {@link UnbluEmbeddedAppElement.serverUrl} to set or get this via a property
276
+ */
277
+ static readonly ATTR_SERVER_URL: 'server-url';
278
+ /**
279
+ * The path pointing to the root of the Unblu collaboration server.
280
+ *
281
+ * @default "/unblu".
282
+ *
283
+ * **Note**: Changes to this attribute trigger a reinitialization of Unblu if {@link UnbluEmbeddedAppElement.ATTR_AUTO_INIT} is true.
284
+ *
285
+ * @see {@link UnbluEmbeddedAppElement.entryPath} to set or get this via a property
286
+ */
287
+ static readonly ATTR_ENTRY_PATH: 'entry-path';
288
+ /**
289
+ * The API Key to connect this app with a specific Unblu account
290
+ * This is the minimum configuration that has to be done to trigger the initialization of Unblu.
291
+ *
292
+ * **Note**: Changes to this attribute trigger a reinitialization of Unblu if {@link UnbluEmbeddedAppElement.ATTR_AUTO_INIT} is true.
293
+ *
294
+ * @see {@link UnbluEmbeddedAppElement.apiKey} to set or get this via a property
295
+ */
296
+ static readonly ATTR_API_KEY: 'api-key';
297
+ /**
298
+ * The locale (language) used for all Unblu UIs.
299
+ * If not specified this is derived from the webpage or the browser.
300
+ *
301
+ * **Note**: Changes to this attribute trigger a reinitialization of Unblu if {@link UnbluEmbeddedAppElement.ATTR_AUTO_INIT} is true.
302
+ *
303
+ * @see [https://www.unblu.com/en/docs/4.3/articles/installation-and-operation/selecting-the-language.html | Setting the Language / Locale] for more information on the detection.
304
+ * @see {@link UnbluEmbeddedAppElement.locale} to set or get this via a property
305
+ */
306
+ static readonly ATTR_LOCALE: 'locale';
307
+ /**
308
+ * The named area for which the configuration should be loaded and with which new queue requests will be labeled.
309
+ * If not specified this can be derived from the corresponding meta tag on the webpage or the domain.
310
+ *
311
+ * **Note**: Changes to this attribute trigger a reinitialization of Unblu if {@link UnbluEmbeddedAppElement.ATTR_AUTO_INIT} is true.
312
+ * If this is not desired it can be prevented by changing the named area via a meta tag, however in this case this will only effect the queue routing and not the configuration.
313
+ * Alternatively you can disable the automatic initialization.
314
+ *
315
+ * @see {@link https://www.unblu.com/en/docs/latest/knowledge-base/named-areas.html | Named Area} for further details.
316
+ * @see {@link UnbluEmbeddedAppElement.namedArea} to set or get this via a property
317
+ */
318
+ static readonly ATTR_NAMED_AREA: 'named-area';
319
+ /**
320
+ * The access token used to log the user in before initializing Unblu.
321
+ *
322
+ * **Note**: Changes to this attribute trigger a reinitialization of Unblu if {@link UnbluEmbeddedAppElement.ATTR_AUTO_INIT} is true.
323
+ *
324
+ * @see {@link UnbluEmbeddedAppElement.accessToken} to set or get this via a property
325
+ */
326
+ static readonly ATTR_ACCESS_TOKEN: 'access-token';
327
+ /**
328
+ * Opens the conversation with the specified ID.
329
+ * If Unblu is not initialized yet, it will wait for the initialization and then automatically open the specified conversation.
330
+ * If Unblu is already initialized, the conversation will be opened directly.
331
+ *
332
+ * If the conversation doesn't exist or the user doesn't have the right to access it, a dialog will be displayed with the respective error message.
333
+ *
334
+ * @see {@link UnbluEmbeddedAppElement.openConversation} to set this value and also retrieve a promise to know, when the conversation was opened.
335
+ * @see {@link UnbluEmbeddedAppElement.conversationId} to read the value as property. This will always represent the currently opened conversation.
336
+ */
337
+ static readonly ATTR_CONVERSATION_ID: 'conversation-id';
338
+ /**
339
+ * Sets the view mode of the embedded app element.
340
+ *
341
+ * Depending on the view mode the UI is displayed the following way:
342
+ * - {@link ViewMode.SPLIT}: The UI will be divided into two parts.
343
+ * The list of conversations is displayed on the left and the active conversation on the right side.
344
+ *
345
+ * - {@link ViewMode.SINGLE}: Both the conversation list and the active conversation will be displayed in the same view using UI navigation to switch between them.
346
+ *
347
+ * - {@link ViewMode.AUTO}: The UI will automatically switch back and forth between the two other modes depending on the available width.
348
+ * The trigger point when to switch between the two modes can be configured on the Unblu collaboration server.
349
+ *
350
+ * This value can be set even if the API is not initialized yet.
351
+ * The value will then be applied on initialization.
352
+ *
353
+ * @see {@link UnbluEmbeddedAppElement.viewMode} to set or get this via a property
354
+ * @default {@link ViewMode.AUTO}
355
+ */
356
+ static readonly ATTR_VIEW_MODE: 'view-mode';
357
+ /**
358
+ * When this attribute is set to true, the embedded app will ignore the position and size set to its element and will used fixed positioning to display itself to cover the whole website.
359
+ *
360
+ * This is useful when the user is currently in a call.
361
+ *
362
+ * This can be set even if the API is not initialized yet.
363
+ * The value will then be applied on initialization.
364
+ *
365
+ * **Note**: The user itself can also toggle this inside the UI.
366
+ *
367
+ * @see {@link UnbluEmbeddedAppElement.fullscreen} to set or get this via a property
368
+ * @default false
369
+ */
370
+ static readonly ATTR_FULLSCREEN: 'fullscreen';
371
+ /**
372
+ * The timeout im milliseconds that should be waited for the Unblu integration to load.
373
+ *
374
+ * @default 30'000 (30 seconds).
375
+ *
376
+ * @see {@link UnbluEmbeddedAppElement.initTimeout} to set or get this via a property
377
+ */
378
+ static readonly ATTR_INIT_TIMEOUT: 'init-timeout';
379
+ /**
380
+ * Defines if Unblu automatically tries to (re-)initialize as soon as an attribute or property changes that triggers (re-)initialization.
381
+ *
382
+ * To trigger a initialization at least the attribute {@link ATTR_API_KEY} or property {@link UnbluEmbeddedAppElement.apiKey}.
383
+ *
384
+ * @default true.
385
+ *
386
+ * @see {@link UnbluEmbeddedAppElement.autoInit} to set or get this via a property
387
+ */
388
+ static readonly ATTR_AUTO_INIT: 'auto-init';
389
+ private _serverUrl;
390
+ private _entryPath;
391
+ private _apiKey;
392
+ private _namedArea;
393
+ private _accessToken;
394
+ private _locale;
395
+ private _conversationId;
396
+ private _viewMode;
397
+ private _fullscreen;
398
+ private _initTimeout;
399
+ private _autoInit;
400
+ private _configuration;
401
+ private _connected;
402
+ private _reinitTrigger;
403
+ private _initializedApi;
404
+ private _initialization;
405
+ private _ongoingDeinitialization;
406
+ private _state;
407
+ /**
408
+ * Registers for the {@link UnbluEmbeddedAppElement.STATE_CHANGE} event
409
+ * @param type
410
+ * @param listener
411
+ * @param options
412
+ */
413
+ addEventListener(type: typeof UnbluEmbeddedAppElement.STATE_CHANGE, listener: (event: StateChangeEvent) => void, options?: boolean | AddEventListenerOptions): void;
414
+ /**
415
+ * Registers for the {@link UnbluEmbeddedAppElement.READY} event
416
+ * @param type
417
+ * @param listener
418
+ * @param options
419
+ */
420
+ addEventListener(type: typeof UnbluEmbeddedAppElement.READY, listener: (event: ReadyEvent) => void, options?: boolean | AddEventListenerOptions): void;
421
+ /**
422
+ * Registers for the {@link UnbluEmbeddedAppElement.ERROR} event
423
+ * @param type
424
+ * @param listener
425
+ * @param options
426
+ */
427
+ addEventListener(type: typeof UnbluEmbeddedAppElement.ERROR, listener: (event: ErrorEvent) => void, options?: boolean | AddEventListenerOptions): void;
428
+ /**
429
+ * Registers for the {@link UnbluEmbeddedAppElement.DEINITIALIZING} event
430
+ * @param type
431
+ * @param listener
432
+ * @param options
433
+ */
434
+ addEventListener(type: typeof UnbluEmbeddedAppElement.DEINITIALIZING, listener: (event: DeinitializationStartedEvent) => void, options?: boolean | AddEventListenerOptions): void;
435
+ /**
436
+ * Registers for the {@link UnbluEmbeddedAppElement.DEINITIALIZED} event
437
+ * @param type
438
+ * @param listener
439
+ * @param options
440
+ */
441
+ addEventListener(type: typeof UnbluEmbeddedAppElement.DEINITIALIZED, listener: (event: DeinitializationFinishedEvent) => void, options?: boolean | AddEventListenerOptions): void;
442
+ /**
443
+ * Registers for the {@link UnbluEmbeddedAppElement.ACTIVE_CONVERSATION_CHANGE} event
444
+ * @param type
445
+ * @param listener
446
+ * @param options
447
+ */
448
+ addEventListener(type: typeof UnbluEmbeddedAppElement.ACTIVE_CONVERSATION_CHANGE, listener: (event: ActiveConversationChangeEvent) => void, options?: boolean | AddEventListenerOptions): void;
449
+ /**
450
+ * Registers for the {@link UnbluEmbeddedAppElement.FULLSCREEN_CHANGE} event
451
+ * @param type
452
+ * @param listener
453
+ * @param options
454
+ */
455
+ addEventListener(type: typeof UnbluEmbeddedAppElement.FULLSCREEN_CHANGE, listener: (event: FullscreenChangeEvent) => void, options?: boolean | AddEventListenerOptions): void;
456
+ /**
457
+ * Registers for the {@link UnbluEmbeddedAppElement.VIEW_MODE_CHANGE} event
458
+ * @param type
459
+ * @param listener
460
+ * @param options
461
+ */
462
+ addEventListener(type: typeof UnbluEmbeddedAppElement.VIEW_MODE_CHANGE, listener: (event: ViewModeChangeEvent) => void, options?: boolean | AddEventListenerOptions): void;
463
+ /**
464
+ * Removes a listener registration for the {@link UnbluEmbeddedAppElement.STATE_CHANGE} event
465
+ * @param type
466
+ * @param listener
467
+ */
468
+ removeEventListener(type: typeof UnbluEmbeddedAppElement.STATE_CHANGE, listener: (event: StateChangeEvent) => void): void;
469
+ /**
470
+ * Removes a listener registration for the {@link UnbluEmbeddedAppElement.READY} event
471
+ * @param type
472
+ * @param listener
473
+ */
474
+ removeEventListener(type: typeof UnbluEmbeddedAppElement.READY, listener: (event: ReadyEvent) => void): void;
475
+ /**
476
+ * Removes a listener registration for the {@link UnbluEmbeddedAppElement.ERROR} event
477
+ * @param type
478
+ * @param listener
479
+ */
480
+ removeEventListener(type: typeof UnbluEmbeddedAppElement.ERROR, listener: (event: ErrorEvent) => void): void;
481
+ /**
482
+ * Removes a listener registration for the {@link UnbluEmbeddedAppElement.DEINITIALIZING} event
483
+ * @param type
484
+ * @param listener
485
+ */
486
+ removeEventListener(type: typeof UnbluEmbeddedAppElement.DEINITIALIZING, listener: (event: DeinitializationStartedEvent) => void): void;
487
+ /**
488
+ * Removes a listener registration for the {@link UnbluEmbeddedAppElement.DEINITIALIZED} event
489
+ * @param type
490
+ * @param listener
491
+ */
492
+ removeEventListener(type: typeof UnbluEmbeddedAppElement.DEINITIALIZED, listener: (event: DeinitializationFinishedEvent) => void): void;
493
+ /**
494
+ * Removes a listener registration for the {@link UnbluEmbeddedAppElement.ACTIVE_CONVERSATION_CHANGE} event
495
+ * @param type
496
+ * @param listener
497
+ */
498
+ removeEventListener(type: typeof UnbluEmbeddedAppElement.ACTIVE_CONVERSATION_CHANGE, listener: (event: ActiveConversationChangeEvent) => void): void;
499
+ /**
500
+ * Removes a listener registration for the {@link UnbluEmbeddedAppElement.FULLSCREEN_CHANGE} event
501
+ * @param type
502
+ * @param listener
503
+ */
504
+ removeEventListener(type: typeof UnbluEmbeddedAppElement.FULLSCREEN_CHANGE, listener: (event: FullscreenChangeEvent) => void): void;
505
+ /**
506
+ * Removes a listener registration for the {@link UnbluEmbeddedAppElement.VIEW_MODE_CHANGE} event
507
+ * @param type
508
+ * @param listener
509
+ */
510
+ removeEventListener(type: typeof UnbluEmbeddedAppElement.VIEW_MODE_CHANGE, listener: (event: ViewModeChangeEvent) => void): void;
511
+ protected static get observedAttributes(): string[];
512
+ protected attributeChangedCallback(attrName: string, oldVal: string | null, newVal: string | null): void;
513
+ /**
514
+ * The URL to the collaboration server.
515
+ *
516
+ * If not specified it is assumed that the server is reachable on the same domain of the current webpage at the defined {@link UnbluEmbeddedAppElement.entryPath}
517
+ *
518
+ * **Note**: Changes to this property trigger a reinitialization of Unblu if {@link UnbluEmbeddedAppElement.autoInit} is true.
519
+ *
520
+ * @see {@link UnbluEmbeddedAppElement.ATTR_SERVER_URL} to set this as an attribute
521
+ * @param serverUrl
522
+ */
523
+ set serverUrl(serverUrl: string);
524
+ get serverUrl(): string;
525
+ /**
526
+ * The entry path on the collaboration server.
527
+ *
528
+ * @default "/unblu".
529
+ *
530
+ * **Note**: Changes to this property trigger a reinitialization of Unblu if {@link UnbluEmbeddedAppElement.autoInit} is true.
531
+ *
532
+ * @see {@link UnbluEmbeddedAppElement.ATTR_ENTRY_PATH} to set this as an attribute
533
+ * @param entryPath
534
+ */
535
+ set entryPath(entryPath: string);
536
+ get entryPath(): string;
537
+ /**
538
+ * The API Key to connect this app with a specific Unblu account.
539
+ * This is the minimum configuration that has to be done to trigger the initialization of Unblu.
540
+ *
541
+ * **Note**: Changes to this property trigger a reinitialization of Unblu if {@link UnbluEmbeddedAppElement.autoInit} is true.
542
+ *
543
+ * @see {@link UnbluEmbeddedAppElement.ATTR_API_KEY} to set this as an attribute
544
+ * @param apiKey
545
+ */
546
+ set apiKey(apiKey: string);
547
+ get apiKey(): string;
548
+ /**
549
+ * The locale (language) used for all Unblu UIs.
550
+ * If not specified this is derived from the webpage or the browser.
551
+ *
552
+ * **Note**: Changes to this property trigger a reinitialization of Unblu if {@link UnbluEmbeddedAppElement.autoInit} is true.
553
+ *
554
+ * @see {@link UnbluEmbeddedAppElement.ATTR_LOCALE} to set this as an attribute
555
+ * @param locale
556
+ */
557
+ set locale(locale: string);
558
+ get locale(): string;
559
+ /**
560
+ * The named area for which the configuration should be loaded and with which new queue requests will be labeled.
561
+ * If not specified this can be derived from meta tags on the webpage.
562
+ *
563
+ * **Note**: Changes to this property trigger a reinitialization of Unblu if {@link UnbluEmbeddedAppElement.autoInit} is true.
564
+ * If this is not desired it can be prevented by changing the named area via a meta tag, however in this case this will only effect the queue routing and not the configuration.
565
+ * Alternatively you can disable the auto init.
566
+ *
567
+ * @see {@link UnbluEmbeddedAppElement.ATTR_NAMED_AREA} to set this as an attribute
568
+ * @param namedArea
569
+ */
570
+ set namedArea(namedArea: string);
571
+ get namedArea(): string;
572
+ /**
573
+ * The access token used to log the user in before initializing Unblu.
574
+ *
575
+ * **Note**: Changes to this property trigger a reinitialization of Unblu if {@link UnbluEmbeddedAppElement.autoInit} is true.
576
+ *
577
+ * @see {@link UnbluEmbeddedAppElement.ATTR_ACCESS_TOKEN} to set this as an attribute
578
+ * @param accessToken
579
+ */
580
+ set accessToken(accessToken: string);
581
+ get accessToken(): string;
582
+ /**
583
+ * Opens the conversation for the given conversation ID.
584
+ *
585
+ * This can be set already before Unblu is initialized.
586
+ * The conversation will then be opened as soon as Unblu gets initialized.
587
+ *
588
+ * If the conversation doesn't exist or the user doesn't have the right to access it, a dialog will be displayed with the respective error message.
589
+ * In such a case the conversation ID will be reset to `null`.
590
+ *
591
+ * @see {@link UnbluEmbeddedAppElement.ATTR_CONVERSATION_ID} to set this as an attribute
592
+ * @param conversationId The id of the conversation to open
593
+ */
594
+ set conversationId(conversationId: string);
595
+ get conversationId(): string;
596
+ /**
597
+ * Sets the view mode of the embedded app element.
598
+ *
599
+ * Depending on the view mode the UI is displayed the following way:
600
+ * - {@link ViewMode.SPLIT}: The UI will be divided into two parts.
601
+ * The list of conversations is displayed on the left and the active conversation on the right side.
602
+ *
603
+ * - {@link ViewMode.SINGLE}: Both the conversation list and the active conversation will be displayed in the same view using UI navigation to switch between them.
604
+ *
605
+ * - {@link ViewMode.AUTO}: The UI will automatically switch back and forth between the two other modes depending on the available width.
606
+ * The trigger point when to switch between the two modes can be configured on the Unblu collaboration server.
607
+ *
608
+ * This value can be set even if the API is not initialized yet.
609
+ * The value will then be applied on initialization.
610
+ *
611
+ * @see {@link UnbluEmbeddedAppElement.ATTR_VIEW_MODE} to set this as an attribute
612
+ * @see {@link UnbluEmbeddedApi.setViewMode} to set this on the initialized {@link UnbluEmbeddedApi}
613
+ * @param viewMode The new view mode to use
614
+ * @default {@link ViewMode.AUTO}
615
+ */
616
+ set viewMode(viewMode: ViewMode);
617
+ get viewMode(): ViewMode;
618
+ /**
619
+ * When this attribute is set to true, the embedded app element will ignore the position and size set to its element and will used fixed positioning to display itself to cover the whole website.
620
+ *
621
+ * This is useful when the user is currently in a call.
622
+ *
623
+ * This can be set even if the API is not initialized yet.
624
+ * The value will then be applied on initialization.
625
+ *
626
+ * **Note**: The user itself can also toggle this inside the UI.
627
+ *
628
+ * @see {@link UnbluEmbeddedAppElement.ATTR_FULLSCREEN} to set this as an attribute
629
+ * @see {@link UnbluEmbeddedApi.setFullscreen} to set this on the initialized {@link UnbluEmbeddedApi}
630
+ * @param fullscreen True to enable fullscreen, false otherwise.
631
+ *
632
+ * @default false
633
+ */
634
+ set fullscreen(fullscreen: boolean);
635
+ get fullscreen(): boolean;
636
+ /**
637
+ * The timeout im milliseconds that should be waited for the Unblu integration to load.
638
+ *
639
+ * @default 30'000 (30 seconds).
640
+ *
641
+ * @see {@link UnbluEmbeddedAppElement.ATTR_INIT_TIMEOUT} to set this as an attribute
642
+ * @param initTimeout
643
+ */
644
+ set initTimeout(initTimeout: number);
645
+ get initTimeout(): number;
646
+ /**
647
+ * Defines if Unblu automatically tries to (re-)initialize as soon as an attribute or property changes that triggers (re-)initialization.
648
+ * Attributes/properties that trigger a (re-)initialization have a note in their documentation.
649
+ * At least the attribute {@link ATTR_API_KEY} or property {@link UnbluEmbeddedAppElement.apiKey} has to be configured to trigger an initialization.
650
+ *
651
+ * If this property gets set from false to true, it will automatically initialize if it is not already initialized.
652
+ * If it is already initialized, it will NOT deinitialize.
653
+ *
654
+ * @default true.
655
+ *
656
+ * @see {@link UnbluEmbeddedAppElement.ATTR_AUTO_INIT} to set this as an attribute
657
+ * @param autoInit
658
+ */
659
+ set autoInit(autoInit: boolean);
660
+ get autoInit(): boolean;
661
+ /**
662
+ * The current state of the API.
663
+ * @see {@link UnbluEmbeddedAppElement.STATE_CHANGE} to listen for changes or use one of the following for specific states.
664
+ * @see {@link UnbluEmbeddedAppElement.READY} for {@link ApiState.INITIALIZED}
665
+ * @see {@link UnbluEmbeddedAppElement.DEINITIALIZING} for {@link ApiState.DEINITIALIZING}
666
+ * @see {@link UnbluEmbeddedAppElement.DEINITIALIZED} for {@link ApiState.DEINITIALIZED}
667
+ * @see {@link UnbluEmbeddedAppElement.ERROR} for {@link ApiState.ERROR}
668
+ *
669
+ * @readonly
670
+ */
671
+ get apiState(): ApiState;
672
+ /**
673
+ * Initializes the app element to connect to the configured collaboration server and load the UI.
674
+ *
675
+ * If the API is already initializing or fully initialized, additional calls to this function will return the same instance of {@link UnbluEmbeddedApi}.
676
+ *
677
+ * This needs to be called if {@link UnbluEmbeddedAppElement.autoInit} is set to false.
678
+ *
679
+ * @return UnbluEmbeddedApi after initialization was successful
680
+ *
681
+ * @see {@link UnbluEmbeddedAppElement.deinitialize}
682
+ * @see {@link UnbluEmbeddedApi.deinitialize}
683
+ */
684
+ initialize(): Promise<UnbluEmbeddedApi>;
685
+ protected connectedCallback(): Promise<void>;
686
+ protected adoptedCallback(): void;
687
+ protected disconnectedCallback(): void;
688
+ private isConfigured;
689
+ private internalInitialize;
690
+ private internalStartUp;
691
+ private createConfigFromProperties;
692
+ private static injectUnblu;
693
+ private handleStartupError;
694
+ private populatePropertiesAndEvents;
695
+ private setApiState;
696
+ private autoReinitIfEnabled;
697
+ /**
698
+ * Deinitializes the app element and destroys all of its containing UI.
699
+ * By changing one of the attributes that trigger a reinitialization (e.g. {@link UnbluEmbeddedAppElement.apiKey}) the app element will be automatically initialized again (if the value is really changed).
700
+ *
701
+ * **Note**: Calling this method will not remove the element itself out of the DOM.
702
+ */
703
+ deinitialize(): Promise<void>;
704
+ /**
705
+ * @hidden
706
+ */
707
+ deinitialize(destroyOptions: DestroyOptions): Promise<void>;
708
+ }