@lorikeetai/react-native-sdk 2.0.0-alpha.2 → 2.0.0-alpha.3

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/dist/index.d.ts CHANGED
@@ -4,50 +4,118 @@ import { WebView, WebViewMessageEvent, WebViewProps } from "react-native-webview
4
4
  type ConversationMetadata = Record<string, unknown>;
5
5
  //#endregion
6
6
  //#region src/customisations.d.ts
7
+ /**
8
+ * What the chat page accepts as `customisations`, as the SDK's own types.
9
+ *
10
+ * A copy of the web SDK's shape rather than an import of it. The web SDK is a
11
+ * browser bundle an app has no reason to install, and importing a type from it
12
+ * left the published `dist/index.d.ts` referencing a module consumers do not
13
+ * have: `Customisations` then degraded to `any` and typed nothing.
14
+ * `ConversationMetadata` is duplicated here for the same reason.
15
+ *
16
+ * `src/customisations.web-sdk-parity.ts` fails the build if the two drift.
17
+ *
18
+ * Fields that only mean something on a web page, the viewport sizes and the
19
+ * launcher button, are kept so the page's behaviour is unchanged and so a host
20
+ * sharing one configuration object with its web widget still type-checks.
21
+ */
22
+ /** Sizing for one viewport. Desktop only: the page is full-screen on mobile. */
7
23
  interface ViewportCustomisations {
24
+ /** Clamped to a 2rem maximum. */
8
25
  borderRadius?: string;
9
26
  default_open?: boolean;
27
+ /** Clamped to the viewport minus `topClearance`, and to a 20rem minimum. */
10
28
  height?: string;
29
+ /** Reserved space above the widget. Desktop default 6.5rem. */
11
30
  topClearance?: string;
12
31
  width?: string;
13
32
  }
14
33
  interface Customisations {
34
+ /** Falls back to the logo image. */
15
35
  avatarUrl?: string;
16
36
  botName?: string;
17
37
  desktop?: ViewportCustomisations;
38
+ /**
39
+ * Which header the customer gets, not whether there is one. `true` hides the
40
+ * page's own; `false` keeps it, and it carries Close and End chat.
41
+ *
42
+ * What replaces a hidden one is the host's business, so there is no one
43
+ * default to quote. `LorikeetWidgetView` substitutes its own header, a title
44
+ * and new chat, and does so when this is omitted. `LorikeetClient` only
45
+ * serialises the flag and renders nothing, so a composed host keeps the page's
46
+ * header unless it asks for it to go, and must render `LorikeetWidgetHeader`
47
+ * itself when it does.
48
+ */
18
49
  hideHeader?: boolean;
50
+ /** @default '_blank' */
19
51
  linkTarget?: '_blank' | '_parent';
20
52
  logoUrl?: string;
21
53
  messages?: {
54
+ /** Shown when the widget is in an unexpectedly failed state. */
22
55
  failOver?: string;
56
+ /** Shown when live chat has been switched off deliberately. */
23
57
  unavailable?: string;
58
+ /**
59
+ * Replaces the line under "Someone is taking a look", for a conversation
60
+ * handed to a person. Say where the reply will come from when the default
61
+ * should not promise it.
62
+ */
24
63
  escalated?: string;
25
64
  };
26
65
  mobile?: ViewportCustomisations;
27
66
  mode?: 'controlled' | 'uncontrolled';
67
+ /**
68
+ * Styling for the launcher button the web widget renders. The React Native
69
+ * SDK renders no launcher, so this reaches the page and does nothing.
70
+ *
71
+ * @danger Experimental and may change.
72
+ */
28
73
  rootElement?: {
29
74
  border?: string;
30
75
  borderRadius?: string;
31
76
  zIndex?: number;
32
77
  bottom?: string;
33
78
  right?: string;
79
+ /** Any CSS size value. Defaults to 3rem. */
34
80
  size?: string;
35
81
  };
82
+ /** Show dates as well as times, on every message. */
36
83
  showVerboseTimestamps?: boolean;
37
84
  theme?: CustomisationTheme;
38
85
  title?: string;
86
+ /** @default false */
39
87
  useSubtleBranding?: boolean;
40
88
  }
41
89
  interface CustomisationTheme {
90
+ /**
91
+ * Colour or gradient for the main area. Any colour value, and any gradient
92
+ * function including multiple layers. Image-based backgrounds are not
93
+ * supported. Takes precedence over `backgroundColor`.
94
+ */
42
95
  background?: string;
43
96
  backgroundColor?: string;
97
+ /** Accent fill, currently the header. Resolves to a neutral when unset. */
44
98
  brandAccentColor?: string;
45
99
  brandColor?: string;
100
+ /** @default 'light' */
46
101
  colorMode?: 'light' | 'dark';
47
102
  fontFamily?: string;
103
+ /**
104
+ * Google Fonts CSS URL declaring the `@font-face` rules for `fontFamily`.
105
+ * The page ships Inter only, so a brand font the device lacks falls back
106
+ * unless its files are loaded. Host must be `fonts.googleapis.com`, path
107
+ * `/css` or `/css2`, and only `family` and `display` params; anything else is
108
+ * ignored.
109
+ */
48
110
  fontUrl?: string;
111
+ /**
112
+ * Colour or gradient for the header, on the same terms as `background`.
113
+ * Takes precedence over `brandAccentColor`.
114
+ */
49
115
  headerBackground?: string;
116
+ /** For text on a dark background. */
50
117
  inverseTextColor?: string;
118
+ /** Falls back to the brand colour. */
51
119
  linkColor?: string;
52
120
  linkHoverColor?: string;
53
121
  secondaryBrandColor?: string;
@@ -56,84 +124,346 @@ interface CustomisationTheme {
56
124
  }
57
125
  //#endregion
58
126
  //#region src/events.d.ts
59
- type LorikeetWidgetEvent = {
127
+ /**
128
+ * What the page reports, as events rather than as raw bridge messages.
129
+ *
130
+ * Names follow the web SDK's (`LorikeetEvent` in `@lorikeetai/web-sdk/types`)
131
+ * wherever it has one, because a host that integrates both should not have to
132
+ * learn two vocabularies. The rest cover what the page tells a host that owns
133
+ * its own layout and storage, which on web the SDK handles internally and never
134
+ * surfaces: the close handshake, the persistence messages, the logout
135
+ * confirmation, and error codes. `logout_failed` is the one the SDK reports
136
+ * itself, for a page that said nothing when it had to.
137
+ *
138
+ * `token_expiry` is deliberately absent. The credential model it belongs to is
139
+ * being rewritten, and an event is the hardest thing to take back. Nothing
140
+ * carrying a credential is translated at all, for the same reason.
141
+ */
142
+ type LorikeetWidgetEvent =
143
+ /** The page is up and the conversation is usable. */
144
+ {
60
145
  type: 'ready';
61
- } | {
146
+ } |
147
+ /**
148
+ * A ticket that did not exist before this page loaded. Once per ticket, and
149
+ * never for a resume, matching the web SDK.
150
+ */
151
+ {
62
152
  type: 'ticket_created';
63
153
  ticketId: string;
64
- } | {
154
+ } |
155
+ /** The customer sent something. */
156
+ {
65
157
  type: 'customer_message';
66
- } | {
158
+ } |
159
+ /**
160
+ * The agent sent something. `markUnread` is the page asking for an unread
161
+ * indicator, which it only does where its live chat experience is on; the web
162
+ * SDK's launcher dot is driven by it, and it badges only while the widget is
163
+ * out of sight.
164
+ *
165
+ * Absent from a page older than the release that added it, which is not the
166
+ * same as `false`.
167
+ */
168
+ {
67
169
  type: 'agent_message';
68
170
  markUnread?: boolean;
69
- } | {
171
+ } |
172
+ /**
173
+ * The page closed itself, and why. `ended_by_customer` is followed by a
174
+ * `new_chat`, seconds later, so a host that tears down here never sees the
175
+ * rest of the handshake. `minimised` has nothing behind it: the conversation
176
+ * is intact and hiding it is enough.
177
+ *
178
+ * `reason` is absent from a page older than the release that added it.
179
+ */
180
+ {
70
181
  type: 'close';
71
182
  reason?: 'ended_by_customer' | 'minimised';
72
- } | {
183
+ } |
184
+ /**
185
+ * The conversation ended without the customer ending it: an agent closed it,
186
+ * or it timed out. Nothing follows, and nothing is asking the host to hide
187
+ * anything. Left unhandled, this is the customer stranded on a conversation
188
+ * that can no longer be used.
189
+ */
190
+ {
73
191
  type: 'conversation_ended';
74
- } | {
192
+ } |
193
+ /**
194
+ * The page asking for a replacement conversation. It cannot navigate itself,
195
+ * so acting on this is the host's half of End chat.
196
+ */
197
+ {
75
198
  type: 'new_chat';
76
- } | {
199
+ } |
200
+ /**
201
+ * Store this against the customer, alongside the session. A resume needs both:
202
+ * the ticket alone fails with `CUSTOMER_ID_MISSING`.
203
+ */
204
+ {
77
205
  type: 'persist_ticket_id';
78
206
  ticketId: string;
79
- } | {
207
+ } |
208
+ /** The other half of the stored pair. Arrives separately and in no order. */
209
+ {
80
210
  type: 'persist_session';
81
211
  session: string;
82
- } | {
212
+ } |
213
+ /**
214
+ * `/logout` cleared the frame: the chat's cookies for this key, server-side,
215
+ * and the storage the page kept. Reached by navigating the WebView to
216
+ * `LorikeetClient.getLogoutUrl()`, and the only confirmation that the
217
+ * clearing happened. The page's load event is not: an error page fires that
218
+ * too.
219
+ *
220
+ * `persistAnonymousSessionToken` is deliberately not translated. It carries a
221
+ * 365-day identity credential, this SDK offers no way to use one, and the web
222
+ * SDK keeps the same message inside the frame rather than handing it to its
223
+ * host. A typed event would be a published commitment to storing it, days
224
+ * before the hand-off protocol is meant to stop putting it in a URL at all.
225
+ */
226
+ {
83
227
  type: 'logged_out';
84
- } | {
228
+ } |
229
+ /**
230
+ * The SDK's own report, not the page's: `/logout` did not confirm inside
231
+ * `LOGOUT_CONFIRMATION_TIMEOUT_MS`, so the previous customer may still be
232
+ * signed in on this device.
233
+ *
234
+ * The widget stays unavailable rather than starting the next customer's chat,
235
+ * because the alternative is handing them a device the last one's credentials
236
+ * still open. Call `logout()` again to retry.
237
+ */
238
+ {
85
239
  type: 'logout_failed';
86
- } | {
240
+ } |
241
+ /** A page-level failure. `LORIKEET_ERROR_CODES` lists the codes. */
242
+ {
87
243
  type: 'error';
88
244
  error: string;
89
- } | {
245
+ } |
246
+ /**
247
+ * The preload page finished warming, and what the server said about it.
248
+ *
249
+ * Unreachable from React Native, and published in error. The preload page
250
+ * posts straight to `window.parent` behind a `window.parent !== window`
251
+ * guard, which is false in a WebView, so it never takes the native bridge the
252
+ * page's other messages go through. Kept because removing a published union
253
+ * member is a breaking change; retire it when 2.x leaves alpha, or when the
254
+ * page learns to post it natively.
255
+ */
256
+ {
90
257
  type: 'preload_complete';
91
258
  clientStart: boolean;
92
259
  lazyTicketCreationEnabled: boolean;
93
260
  };
261
+ /** The names, spelled out rather than derived, so callers import a real type. */
94
262
  type LorikeetWidgetEventType = 'agent_message' | 'close' | 'conversation_ended' | 'customer_message' | 'error' | 'logged_out' | 'logout_failed' | 'new_chat' | 'persist_session' | 'persist_ticket_id' | 'preload_complete' | 'ready' | 'ticket_created';
95
263
  //#endregion
96
264
  //#region src/types.d.ts
97
265
  interface LorikeetInitOptions {
266
+ /**
267
+ * The base URL of the Lorikeet API for the widget to interact with.
268
+ */
98
269
  api_base?: string;
270
+ /**
271
+ * The options available to customise the widget.
272
+ */
99
273
  customisations?: Customisations;
274
+ /**
275
+ * Arbitrary context to attach to the conversation. Sent as JSON, not base64,
276
+ * which is what both the widget route and the resume route expect.
277
+ */
100
278
  metadata?: ConversationMetadata;
279
+ /**
280
+ * The public key to use.
281
+ */
101
282
  public_key: string;
102
283
  }
103
284
  type LorikeetWidgetWebViewProps = {
285
+ /**
286
+ * The URI of the widget.
287
+ */
104
288
  uri: string;
289
+ /**
290
+ * The base URL of the Lorikeet API for the widget to interact with.
291
+ */
105
292
  baseUrl?: string;
293
+ /**
294
+ * The props for the react-native-webview component
295
+ */
106
296
  webviewProps?: WebViewProps;
297
+ /**
298
+ * What the page reported, as typed events rather than raw bridge messages.
299
+ *
300
+ * This component reports; it does not act. A host composing it owns its own
301
+ * URL, layout and storage, so hiding on a close, rebuilding a resume URL or
302
+ * recovering from process loss are all theirs to do. `LorikeetWidgetView`
303
+ * consumes this same path and acts on top of it, because it owns the URL.
304
+ */
107
305
  onEvent?: (event: LorikeetWidgetEvent) => void;
108
306
  };
109
307
  type LorikeetWidgetHeaderProps = {
308
+ /**
309
+ * The title of the widget.
310
+ */
110
311
  title: string;
312
+ /**
313
+ * The style of the header text.
314
+ */
111
315
  style?: StyleProp<TextStyle>;
316
+ /**
317
+ * The icon to display in the header.
318
+ */
112
319
  icon?: React.ReactNode;
320
+ /**
321
+ * The function to call when the icon is pressed.
322
+ */
113
323
  onIconPress?: () => void;
114
324
  };
325
+ /**
326
+ * What a host can ask `LorikeetWidgetView` to do, through a ref. Imperative
327
+ * because logging out and reopening are events on the host's side rather than
328
+ * states the widget can read off its props.
329
+ */
115
330
  type LorikeetWidgetHandle = {
331
+ /**
332
+ * The conversation the widget would resume right now, or `null` when it has
333
+ * none to resume.
334
+ *
335
+ * The pull half of `persist_ticket_id` and `persist_session`. Those report a
336
+ * conversation as the page names it; this answers what the widget is on after
337
+ * it has acted, which is not always the same thing. A resume the server
338
+ * refuses is replaced, and a new chat replaces whatever came before it, so a
339
+ * host holding what it passed at mount can be holding a conversation that no
340
+ * longer exists.
341
+ *
342
+ * `null` means exactly that the widget has nothing to resume: no conversation
343
+ * reported yet, only half of one, the credentials have moved on, or the
344
+ * customer has been logged out. It does not mean the conversation is over. A
345
+ * conversation the customer ended is still reported, because that is still
346
+ * what the widget is on and what its own recovery would resume; `close` and
347
+ * its `reason` are how you hear that it ended.
348
+ *
349
+ * Reports what is on screen, so inside an `onEvent` handler it is still what
350
+ * was on screen before that event: read `reason` on the `close` rather than
351
+ * calling this from the handler. Read it again after a change rather than
352
+ * caching what it said.
353
+ */
116
354
  getConversation: () => {
117
355
  minimised: boolean;
118
356
  session?: string;
119
357
  ticketId?: string;
120
358
  } | null;
359
+ /**
360
+ * Clear this customer's chat from the device, for the credentials currently in
361
+ * props. Navigates the WebView to the page's own `/logout`, which drops the
362
+ * chat's cookies and the storage the page keeps; neither is reachable from
363
+ * native code, so clearing your stored `ticketId` and `session` alone leaves
364
+ * the conversation reopenable by the next person on the device.
365
+ *
366
+ * The widget renders nothing but that page until it confirms, and changing
367
+ * `publicKey`, `baseUrl` or `authToken` does not cut it short: signing the
368
+ * next customer in mid-clear would leave the previous one's cookies on the
369
+ * device. Wait for `logged_out` on `onEvent`, then pass the next credentials.
370
+ *
371
+ * A page that does not confirm within ten seconds reports `logout_failed` and
372
+ * leaves the widget unavailable rather than opening a chat on a device the
373
+ * previous customer's credentials still unlock. Call this again to retry; a
374
+ * retry while one is pending retries that customer, not whoever is in props
375
+ * by then.
376
+ *
377
+ * `logout_failed` outlives this component, and the obligation with it. The
378
+ * SDK stores nothing, so a widget unmounted before the clear confirmed, by a
379
+ * screen change or an app restart, comes back with no memory of it and will
380
+ * open a chat normally. Record the failure where you record the conversation,
381
+ * and call `logout()` again before you mount a chat for anyone else.
382
+ *
383
+ * Clear your own stored `ticketId` and `session` as well.
384
+ */
121
385
  logout: () => void;
386
+ /**
387
+ * Show a minimised conversation again, exactly as the customer left it.
388
+ * Nothing reloads and nothing is reported, so the conversation keeps its
389
+ * place, its draft and its stream.
390
+ *
391
+ * For a host with its own launcher. The widget already offers a control of
392
+ * its own while minimised, and it does the same thing.
393
+ *
394
+ * A no-op unless the widget is minimised. A conversation the customer ended
395
+ * is left alone, because it only reopens read-only, and so is one the
396
+ * credentials have moved on from.
397
+ */
122
398
  reopen: () => void;
123
399
  };
124
400
  type LorikeetWidgetViewProps = {
401
+ /**
402
+ * The public key to use.
403
+ */
125
404
  publicKey: string;
405
+ /**
406
+ * The base URL of the Lorikeet API for the widget to interact with.
407
+ */
126
408
  baseUrl?: string;
409
+ /**
410
+ * The auth token to use when retrieving the widget URL.
411
+ */
127
412
  authToken: string;
413
+ /**
414
+ * The function to call when a message is received from the webview.
415
+ *
416
+ * @deprecated Prefer `onEvent`, which reports the page's messages as typed
417
+ * events rather than raw JSON a host has to match on by string. Still called,
418
+ * and still additive with `webviewProps.onMessage`.
419
+ *
420
+ * `onEvent` is not a superset. Messages the SDK deliberately leaves
421
+ * untranslated, `persistAnonymousSessionToken` among them, arrive on the raw
422
+ * bridge only. Read those through `webviewProps.onMessage`, which carries the
423
+ * same stream and is not deprecated, rather than taking this prop for them.
424
+ */
128
425
  onWebViewMessage?: (event: WebViewMessageEvent) => void;
426
+ /**
427
+ * What the page reported, as typed events. The same stream
428
+ * `LorikeetWidgetWebView` emits, after the widget has acted on it.
429
+ */
129
430
  onEvent?: (event: LorikeetWidgetEvent) => void;
431
+ /**
432
+ * The options available to customise the widget.
433
+ */
130
434
  customisations?: Customisations;
435
+ /**
436
+ * The style of the components - limited to header text
437
+ */
131
438
  styles?: {
132
439
  header?: StyleProp<TextStyle>;
133
440
  };
441
+ /**
442
+ * Resume this conversation instead of starting a new one. Without it the
443
+ * widget boots `/widget`, which mints a fresh ticket on every mount.
444
+ *
445
+ * Take it from the `persistLorikeetTicketId` message and store it yourself;
446
+ * the SDK has no storage of its own.
447
+ */
134
448
  ticketId?: string;
449
+ /**
450
+ * The session token last reported by `persistLorikeetSession`, stored
451
+ * alongside `ticketId`. The ticket route needs it to authorise a WebView that
452
+ * has no cookie yet, so a resume without it fails with CUSTOMER_ID_MISSING.
453
+ */
135
454
  session?: string;
455
+ /**
456
+ * Arbitrary context to attach to the conversation, for routing or for the
457
+ * agent to read. Survives a resume: the ticket route forwards it into the
458
+ * re-init URL.
459
+ */
136
460
  metadata?: ConversationMetadata;
461
+ /**
462
+ * Props forwarded to the underlying react-native-webview. The SDK supplies
463
+ * defaults for media playback, scaling and the loading state, and any of them
464
+ * can be overridden here. `onMessage` is additive rather than an override:
465
+ * the SDK reads the bridge first and then calls yours.
466
+ */
137
467
  webviewProps?: WebViewProps;
138
468
  };
139
469
  //#endregion
@@ -156,14 +486,44 @@ declare class LorikeetClient {
156
486
  ticket_id?: string;
157
487
  token: string;
158
488
  }) => string;
489
+ /**
490
+ * The page that clears this key's credentials from the WebView: its cookies,
491
+ * server-side, and the storage the frame keeps. Navigating a WebView here is
492
+ * the only way to reach either, so a host that only drops its own copy of
493
+ * `ticketId` and `session` leaves the next person on the device able to
494
+ * reopen the conversation.
495
+ *
496
+ * The page confirms with a `loggedOut` message, which the SDK reports as
497
+ * `logged_out`. The load event does not: an error page fires that too.
498
+ */
159
499
  getLogoutUrl: () => string;
160
500
  }
161
501
  //#endregion
162
502
  //#region src/errors.d.ts
503
+ /**
504
+ * Codes the chat page posts to the host as `{ type: 'error', error: CODE }`.
505
+ * Mirrored here because the page publishes them nowhere else, so a host would
506
+ * otherwise be matching on strings it discovered by observation.
507
+ */
163
508
  declare const LORIKEET_ERROR_CODES: readonly ["MISSING_TOKEN", "CORRUPT_TOKEN_DATA", "DECRYPT_FAILED", "EXPIRED_TOKEN", "MALFORMED_TOKEN", "MISSING_PUBLIC_KEY", "UNKNOWN_PUBLIC_KEY", "CUSTOMER_ID_CONFLICT", "CUSTOMER_ID_MISSING", "FATAL_ERROR", "INVALID_SESSION", "DOMAIN_NOT_ALLOWED", "TICKET_NOT_FOUND"];
164
509
  type LorikeetErrorCode = (typeof LORIKEET_ERROR_CODES)[number];
510
+ /** Whether an error code means the stored conversation cannot be reopened. */
165
511
  declare function isUnusableConversationCode(code: string): boolean;
166
512
  declare function isUnusableConversation(message: unknown): boolean;
167
513
  //#endregion
168
- export { type CustomisationTheme, type Customisations, LORIKEET_ERROR_CODES, LorikeetClient, type LorikeetErrorCode, type LorikeetInitOptions, type LorikeetWidgetEvent, type LorikeetWidgetEventType, type LorikeetWidgetHandle, LorikeetWidgetHeader, type LorikeetWidgetHeaderProps, LorikeetWidgetView, type LorikeetWidgetViewProps, LorikeetWidgetWebView, type LorikeetWidgetWebViewProps, isUnusableConversation, isUnusableConversationCode };
514
+ //#region src/lifecycle.d.ts
515
+ /**
516
+ * How long `/logout` gets to confirm it cleared the frame before the host is
517
+ * told it did not. Matches the web SDK's own budget, and like it, a logout that
518
+ * misses the deadline leaves the widget unavailable rather than letting the next
519
+ * customer start a chat on a device the previous one's credentials still open.
520
+ *
521
+ * `LorikeetWidgetView` applies this to its own `logout()`. Exported because a
522
+ * composed host has to run the timer itself and nothing else will report
523
+ * `logout_failed` for it, and two hosts choosing their own budgets is how one
524
+ * app calls a clear failed that the other never does.
525
+ */
526
+ declare const LOGOUT_CONFIRMATION_TIMEOUT_MS = 10000;
527
+ //#endregion
528
+ export { type CustomisationTheme, type Customisations, LOGOUT_CONFIRMATION_TIMEOUT_MS, LORIKEET_ERROR_CODES, LorikeetClient, type LorikeetErrorCode, type LorikeetInitOptions, type LorikeetWidgetEvent, type LorikeetWidgetEventType, type LorikeetWidgetHandle, LorikeetWidgetHeader, type LorikeetWidgetHeaderProps, LorikeetWidgetView, type LorikeetWidgetViewProps, LorikeetWidgetWebView, type LorikeetWidgetWebViewProps, isUnusableConversation, isUnusableConversationCode };
169
529
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/conversation-metadata.ts","../src/customisations.ts","../src/events.ts","../src/types.ts","../src/widget.tsx","../src/client.ts","../src/errors.ts"],"mappings":";;;KAEY,uBAAuB;;;UCezB;EAER;EACA;EAEA;EAEA;EACA;;UAGe;EAEf;EACA;EACA,UAAU;EAEV;EAEA;EACA;EACA;IAEE;IAEA;IAMA;;EAEF,SAAS;EACT;EAOA;IACE;IACA;IACA;IACA;IACA;IAEA;;EAGF;EACA,QAAQ;EACR;EAEA;;UAGe;EAMf;EACA;EAEA;EACA;EAEA;EACA;EAQA;EAKA;EAEA;EAEA;EACA;EACA;EACA;EACA;;;;KC9FU;EAEN;;EAKA;EAAwB;;EAExB;;EAUA;EAAuB;;EASvB;EAAe;;EAOf;;EAKA;;EAKA;EAA2B;;EAE3B;EAAyB;;EAczB;;EAUA;;EAEA;EAAe;;EAYf;EACA;EACA;;KAIM;;;UCnGK;EAIf;EAIA,iBAAiB;EAKjB,WAAW;EAIX;;KAGU;EAIV;EAIA;EAIA,eAAe;EASf,WAAW,OAAO;;KAGR;EAIV;EAIA,QAAQ,UAAU;EAIlB,OAAO,MAAM;EAIb;;KAQU;EAwBV;IACE;IACA;IACA;;EA4BF;EAaA;;KAGU;EAIV;EAIA;EAIA;EAQA,oBAAoB,OAAO;EAK3B,WAAW,OAAO;EAIlB,iBAAiB;EAIjB;IACE,SAAS,UAAU;;EASrB;EAMA;EAMA,WAAW;EAOX,eAAe;;;;cCtHJ,uCAAqB,0BAAA,6CAAA,cAAA;cA2HrB,yBAAwB,OAAA,OAAA,MAAA,eAKlC,8CAAyB,IAAA;cAYf,oCAAkB,0BAAA,0CAAA,cAAA;;;cCjOlB;EACX;EACA,gBAAgB;EAChB,UAAU;EACV;EAEY,cACV,gBACA,UACA,UACA,cACC;EAeH,kBAAiB,gBAAA,eAAA,OAAA,WAAA;IAOf;IACA;IACA;IACA;IACA;;EAmDF;;;;cCxFW;KAgBD,4BAA4B;iBAexB,2BAA2B;iBAK3B,uBAAuB"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/conversation-metadata.ts","../src/customisations.ts","../src/events.ts","../src/types.ts","../src/widget.tsx","../src/client.ts","../src/errors.ts","../src/lifecycle.ts"],"mappings":";;;KAEY,uBAAuB;;;;;;;;;;;;;;;;;;;UCezB;;EAER;EACA;;EAEA;;EAEA;EACA;;UAGe;;EAEf;EACA;EACA,UAAU;;;;;;;;;;;;EAYV;;EAEA;EACA;EACA;;IAEE;;IAEA;;;;;;IAMA;;EAEF,SAAS;EACT;;;;;;;EAOA;IACE;IACA;IACA;IACA;IACA;;IAEA;;;EAGF;EACA,QAAQ;EACR;;EAEA;;UAGe;;;;;;EAMf;EACA;;EAEA;EACA;;EAEA;EACA;;;;;;;;EAQA;;;;;EAKA;;EAEA;;EAEA;EACA;EACA;EACA;EACA;;;;;;;;;;;;;;;;;;;KCxGU;;;EAEN;;;;;;;EAKA;EAAwB;;;;EAExB;;;;;;;;;;;;EAUA;EAAuB;;;;;;;;;;;EASvB;EAAe;;;;;;;;;EAOf;;;;;;;EAKA;;;;;;;EAKA;EAA2B;;;;EAE3B;EAAyB;;;;;;;;;;;;;;;;EAczB;;;;;;;;;;;;EAUA;;;;EAEA;EAAe;;;;;;;;;;;;;EAYf;EACA;EACA;;;KAIM;;;UCnGK;;;;EAIf;;;;EAIA,iBAAiB;;;;;EAKjB,WAAW;;;;EAIX;;KAGU;;;;EAIV;;;;EAIA;;;;EAIA,eAAe;;;;;;;;;EASf,WAAW,OAAO;;KAGR;;;;EAIV;;;;EAIA,QAAQ,UAAU;;;;EAIlB,OAAO,MAAM;;;;EAIb;;;;;;;KAQU;;;;;;;;;;;;;;;;;;;;;;;;EAwBV;IACE;IACA;IACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BF;;;;;;;;;;;;;EAaA;;KAGU;;;;EAIV;;;;EAIA;;;;EAIA;;;;;;;;;;;;;EAaA,oBAAoB,OAAO;;;;;EAK3B,WAAW,OAAO;;;;EAIlB,iBAAiB;;;;EAIjB;IACE,SAAS,UAAU;;;;;;;;;EASrB;;;;;;EAMA;;;;;;EAMA,WAAW;;;;;;;EAOX,eAAe;;;;cC3HJ,uCAAqB,0BAAA,6CAAA,cAAA;cA2HrB,yBAAwB,OAAA,OAAA,MAAA,eAKlC,8CAAyB,IAAA;cAYf,oCAAkB,0BAAA,0CAAA,cAAA;;;cCjOlB;EACX;EACA,gBAAgB;EAChB,UAAU;EACV;EAEY,cACV,gBACA,UACA,UACA,cACC;EAeH,kBAAiB,gBAAA,eAAA,OAAA,WAAA;IAOf;IACA;IACA;IACA;IACA;;;;;;;;;;;;EAmDF;;;;;;;;;cCxFW;KAgBD,4BAA4B;;iBAexB,2BAA2B;iBAK3B,uBAAuB;;;;;;;;;;;;;;cCjB1B"}
package/dist/index.js CHANGED
@@ -283,6 +283,11 @@ const BACKGROUND_RELOAD_THRESHOLD_MS = 18e4;
283
283
  * told it did not. Matches the web SDK's own budget, and like it, a logout that
284
284
  * misses the deadline leaves the widget unavailable rather than letting the next
285
285
  * customer start a chat on a device the previous one's credentials still open.
286
+ *
287
+ * `LorikeetWidgetView` applies this to its own `logout()`. Exported because a
288
+ * composed host has to run the timer itself and nothing else will report
289
+ * `logout_failed` for it, and two hosts choosing their own budgets is how one
290
+ * app calls a clear failed that the other never does.
286
291
  */
287
292
  const LOGOUT_CONFIRMATION_TIMEOUT_MS = 1e4;
288
293
  /**
@@ -851,5 +856,5 @@ const LorikeetWidgetView = forwardRef(function LorikeetWidgetView({ publicKey, b
851
856
  LorikeetWidgetView.displayName = "LorikeetWidgetView";
852
857
 
853
858
  //#endregion
854
- export { LORIKEET_ERROR_CODES, LorikeetClient, LorikeetWidgetHeader, LorikeetWidgetView, LorikeetWidgetWebView, isUnusableConversation, isUnusableConversationCode };
859
+ export { LOGOUT_CONFIRMATION_TIMEOUT_MS, LORIKEET_ERROR_CODES, LorikeetClient, LorikeetWidgetHeader, LorikeetWidgetView, LorikeetWidgetWebView, isUnusableConversation, isUnusableConversationCode };
855
860
  //# sourceMappingURL=index.js.map