@dialstack/sdk-react 3.8.0 → 3.10.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.
- package/dist/ai-agent.cjs +1 -1
- package/dist/ai-agent.cjs.map +1 -1
- package/dist/ai-agent.mjs +1 -1
- package/dist/ai-agent.mjs.map +1 -1
- package/dist/call-history.cjs +1 -1
- package/dist/call-history.cjs.map +1 -1
- package/dist/call-history.mjs +1 -1
- package/dist/call-history.mjs.map +1 -1
- package/dist/call-logs.cjs +1 -1
- package/dist/call-logs.cjs.map +1 -1
- package/dist/call-logs.d.cts +4 -0
- package/dist/call-logs.d.ts +4 -0
- package/dist/call-logs.mjs +1 -1
- package/dist/call-logs.mjs.map +1 -1
- package/dist/dial-plan.cjs +1 -1
- package/dist/dial-plan.cjs.map +1 -1
- package/dist/dial-plan.d.cts +1 -1
- package/dist/dial-plan.d.ts +1 -1
- package/dist/dial-plan.mjs +1 -1
- package/dist/dial-plan.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -2
- package/dist/index.d.ts +21 -2
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/onboarding.cjs +1 -1
- package/dist/onboarding.cjs.map +1 -1
- package/dist/onboarding.mjs +1 -1
- package/dist/onboarding.mjs.map +1 -1
- package/dist/phone-number-ordering.cjs +1 -1
- package/dist/phone-number-ordering.cjs.map +1 -1
- package/dist/phone-number-ordering.mjs +1 -1
- package/dist/phone-number-ordering.mjs.map +1 -1
- package/dist/phone-numbers.cjs +1 -1
- package/dist/phone-numbers.cjs.map +1 -1
- package/dist/phone-numbers.mjs +1 -1
- package/dist/phone-numbers.mjs.map +1 -1
- package/dist/softphone.cjs +1 -1
- package/dist/softphone.cjs.map +1 -1
- package/dist/softphone.d.cts +86 -40
- package/dist/softphone.d.ts +86 -40
- package/dist/softphone.mjs +1 -1
- package/dist/softphone.mjs.map +1 -1
- package/dist/voicemails.cjs +1 -1
- package/dist/voicemails.cjs.map +1 -1
- package/dist/voicemails.d.cts +4 -0
- package/dist/voicemails.d.ts +4 -0
- package/dist/voicemails.mjs +1 -1
- package/dist/voicemails.mjs.map +1 -1
- package/package.json +3 -3
package/dist/softphone.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Call, EmergencyAddress, EmergencyAddressInput, CallState, DialStackPhone, CallEndReason } from '@dialstack/sdk-webrtc';
|
|
2
|
+
import { Call, EmergencyAddress, EmergencyAddressInput, PresenceStatus, CallState, DialStackPhone, CallEndReason } from '@dialstack/sdk-webrtc';
|
|
3
3
|
import { CountryCode } from 'libphonenumber-js';
|
|
4
4
|
import { Locale } from '@dialstack/sdk-js';
|
|
5
5
|
import { Locale as Locale$1, AppearanceOptions, FormattingOptions, ClientAppInfo } from '@dialstack/sdk-js/pure';
|
|
@@ -134,14 +134,14 @@ declare function useCallDuration(call: Call | null, intervalMs?: number): string
|
|
|
134
134
|
* `useEmergencyBinding` — the Softphone's built-in E911 provisioning logic.
|
|
135
135
|
*
|
|
136
136
|
* Model: "always send it, the server decides." The server binds the presented
|
|
137
|
-
* emergency address to the connection's network at the `authenticate` handshake
|
|
138
|
-
* and is the authority on whether it's valid
|
|
139
|
-
* the `network.changed` signal.
|
|
137
|
+
* emergency address to the connection's network, at the `authenticate` handshake
|
|
138
|
+
* or in-band on the open socket, and is the authority on whether it's valid
|
|
139
|
+
* here — it rejects a mismatch via the `network.changed` signal.
|
|
140
140
|
*
|
|
141
141
|
* - On connect, if the session has a saved address but presented none (fresh
|
|
142
|
-
* browser), auto-present it (
|
|
143
|
-
*
|
|
144
|
-
* (network.changed) → we prompt.
|
|
142
|
+
* browser), auto-present it (one in-band rebind). Same network → the server
|
|
143
|
+
* binds it silently (reused). Different network → the server denies
|
|
144
|
+
* (network.changed) → we prompt. Live calls are unaffected either way.
|
|
145
145
|
* - `bound` is true unless the server denied (network.changed) or there is no
|
|
146
146
|
* saved address to present at all.
|
|
147
147
|
*
|
|
@@ -164,15 +164,15 @@ interface UseEmergencyBinding {
|
|
|
164
164
|
bound: boolean;
|
|
165
165
|
/** Saved addresses to offer as "Are you here?" choices. */
|
|
166
166
|
savedAddresses: EmergencyAddress[];
|
|
167
|
-
/** True while an address submit (confirm/create
|
|
167
|
+
/** True while an address submit (confirm/create) is in flight. */
|
|
168
168
|
submitting: boolean;
|
|
169
169
|
/** Last error (e.g. a carrier rejection). */
|
|
170
170
|
error: string | null;
|
|
171
171
|
/** Called from the Softphone when the phone emits `network.changed` (denied). */
|
|
172
172
|
onNetworkChanged: () => void;
|
|
173
|
-
/** Confirm an existing saved address for this network (
|
|
173
|
+
/** Confirm an existing saved address for this network (clears its anchor + rebinds). */
|
|
174
174
|
confirm: (id: string) => Promise<void>;
|
|
175
|
-
/** Create + validate a new address, then bind it
|
|
175
|
+
/** Create + validate a new address, then bind it. */
|
|
176
176
|
create: (input: EmergencyAddressInput) => Promise<void>;
|
|
177
177
|
}
|
|
178
178
|
|
|
@@ -215,35 +215,16 @@ interface PeerInfo {
|
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
217
|
/**
|
|
218
|
-
* Looks up the remote party of a call; may be async. Called once per
|
|
219
|
-
* each resolver identity
|
|
220
|
-
*
|
|
218
|
+
* Looks up the remote party of a call; may be async. Called once per remote
|
|
219
|
+
* number for each resolver identity: calls to or from the same number share
|
|
220
|
+
* the answer, so base it on the number, and a call whose other party changes
|
|
221
|
+
* is asked about again. Pass a new function (e.g. `useCallback` over the data
|
|
222
|
+
* it reads) when its answers would change, and keep it stable otherwise.
|
|
221
223
|
* A `null`/`undefined` result, a rejection or a throw all leave the call on the
|
|
222
224
|
* default display (caller-id name, else the number).
|
|
223
225
|
*/
|
|
224
226
|
type ResolvePeer = (call: Call) => PeerInfo | null | undefined | Promise<PeerInfo | null | undefined>;
|
|
225
227
|
|
|
226
|
-
interface UseDialInput {
|
|
227
|
-
/**
|
|
228
|
-
* Handle a per-keystroke value change: strip display separators only (typing
|
|
229
|
-
* stays natural; no mid-field E.164 rewrite). Pass the raw field value.
|
|
230
|
-
*/
|
|
231
|
-
onType: (raw: string) => void;
|
|
232
|
-
/**
|
|
233
|
-
* Handle a paste: a pasted value is complete, so fully normalize it — a
|
|
234
|
-
* formatted `(581) 319-5082` becomes `+15813195082`, so the user sees exactly
|
|
235
|
-
* what will be dialed. Pass the raw clipboard text.
|
|
236
|
-
*/
|
|
237
|
-
onPasteText: (raw: string) => void;
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* Shared cleaning for a dial-string input, used by BOTH the dial pad and the
|
|
241
|
-
* transfer field on web + RN so the "what may I type / what does a paste become"
|
|
242
|
-
* rule lives in one place. Each platform wires its native input event (web
|
|
243
|
-
* onChange/onPaste, RN onChangeText) to these — the string logic never diverges.
|
|
244
|
-
*/
|
|
245
|
-
declare function useDialInput(setValue: (value: string) => void): UseDialInput;
|
|
246
|
-
|
|
247
228
|
/**
|
|
248
229
|
* Pure, platform-agnostic view-model helpers shared by the web and React Native
|
|
249
230
|
* softphones. No React, no DOM, no React Native — just functions over the headless
|
|
@@ -332,6 +313,14 @@ declare function sanitizeDestination(value: string, defaultCountry?: CountryCode
|
|
|
332
313
|
* state shows which label, without forcing a shared i18n table.
|
|
333
314
|
*/
|
|
334
315
|
declare function callStateLabelKey(state: CallState): keyof Locale['softphone'];
|
|
316
|
+
/**
|
|
317
|
+
* The in-call status line: "Reconnecting…" while the signalling socket is down
|
|
318
|
+
* and the call is being resumed, the call state otherwise.
|
|
319
|
+
*/
|
|
320
|
+
declare function callStatusLabelKey(call: {
|
|
321
|
+
state: CallState;
|
|
322
|
+
isReconnecting: boolean;
|
|
323
|
+
}): keyof Locale['softphone'];
|
|
335
324
|
declare function errorMessageKey(code: string): keyof Locale['softphone'];
|
|
336
325
|
/**
|
|
337
326
|
* One entry of the host's directory, offered when transferring or adding a
|
|
@@ -364,8 +353,35 @@ interface DirectoryContact {
|
|
|
364
353
|
* call"), and matched by the search like the other fields.
|
|
365
354
|
*/
|
|
366
355
|
tags?: readonly string[];
|
|
356
|
+
/**
|
|
357
|
+
* The entry's live availability, drawn as a status dot with its label beside
|
|
358
|
+
* the destination, and matched by the search like a tag. Leave it unset for
|
|
359
|
+
* entries that have no presence (a department, an outside number).
|
|
360
|
+
*/
|
|
361
|
+
presence?: PresenceStatus;
|
|
367
362
|
}
|
|
368
363
|
|
|
364
|
+
interface UseDialInput {
|
|
365
|
+
/**
|
|
366
|
+
* Handle a per-keystroke value change: strip display separators only (typing
|
|
367
|
+
* stays natural; no mid-field E.164 rewrite). Pass the raw field value.
|
|
368
|
+
*/
|
|
369
|
+
onType: (raw: string) => void;
|
|
370
|
+
/**
|
|
371
|
+
* Handle a paste: a pasted value is complete, so fully normalize it — a
|
|
372
|
+
* formatted `(581) 319-5082` becomes `+15813195082`, so the user sees exactly
|
|
373
|
+
* what will be dialed. Pass the raw clipboard text.
|
|
374
|
+
*/
|
|
375
|
+
onPasteText: (raw: string) => void;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Shared cleaning for a dial-string input, used by BOTH the dial pad and the
|
|
379
|
+
* transfer field on web + RN so the "what may I type / what does a paste become"
|
|
380
|
+
* rule lives in one place. Each platform wires its native input event (web
|
|
381
|
+
* onChange/onPaste, RN onChangeText) to these — the string logic never diverges.
|
|
382
|
+
*/
|
|
383
|
+
declare function useDialInput(setValue: (value: string) => void): UseDialInput;
|
|
384
|
+
|
|
369
385
|
/**
|
|
370
386
|
* Shared design tokens for the DialStack Softphone.
|
|
371
387
|
*
|
|
@@ -430,6 +446,14 @@ interface SoftphoneContextBase {
|
|
|
430
446
|
* web and React Native can't drift on when the overlays reset.
|
|
431
447
|
*/
|
|
432
448
|
overlays: UseCallOverlays;
|
|
449
|
+
/**
|
|
450
|
+
* Live `m:ss` duration of the active call.
|
|
451
|
+
*
|
|
452
|
+
* @deprecated Use `useCallDuration(activeCall)`. This field changes on every
|
|
453
|
+
* clock tick, so it re-renders every `useSoftphone()` consumer twice a second
|
|
454
|
+
* during a call, even ones that never read it. It will be removed in the next
|
|
455
|
+
* major release.
|
|
456
|
+
*/
|
|
433
457
|
duration: string;
|
|
434
458
|
consultCall: Call | null;
|
|
435
459
|
transferOriginal: Call | null;
|
|
@@ -469,8 +493,17 @@ interface SoftphoneContextBase {
|
|
|
469
493
|
peerInfo: (call: Call | null | undefined) => PeerInfo | null;
|
|
470
494
|
/** The size tier the host asked for (`'auto'` unless pinned). */
|
|
471
495
|
layoutVariant: SoftphoneLayoutVariant;
|
|
472
|
-
/**
|
|
496
|
+
/**
|
|
497
|
+
* What the transfer / add-call picker lists: the users from
|
|
498
|
+
* `accountDirectory` when on, then the host's `directory`. Empty when neither
|
|
499
|
+
* has entries.
|
|
500
|
+
*/
|
|
473
501
|
directory: readonly DirectoryContact[];
|
|
502
|
+
/**
|
|
503
|
+
* The name for a call's number, or null: the host's `directory` first, then
|
|
504
|
+
* the account's users when they are listed, matched in `defaultCountry`.
|
|
505
|
+
*/
|
|
506
|
+
peerName: (number: string) => string | null;
|
|
474
507
|
}
|
|
475
508
|
|
|
476
509
|
/**
|
|
@@ -564,11 +597,23 @@ interface SoftphoneProviderProps {
|
|
|
564
597
|
layoutVariant?: SoftphoneLayoutVariant;
|
|
565
598
|
/**
|
|
566
599
|
* People and places the user can pick from instead of typing a number (a
|
|
567
|
-
* directory of
|
|
568
|
-
* list
|
|
569
|
-
* still works. Pass a new array when the list changes.
|
|
600
|
+
* directory of people or departments, say). Offered as a searchable
|
|
601
|
+
* list from the dial pad and when transferring or adding a call; typing a
|
|
602
|
+
* destination still works. Pass a new array when the list changes.
|
|
570
603
|
*/
|
|
571
604
|
directory?: readonly DirectoryContact[];
|
|
605
|
+
/**
|
|
606
|
+
* Also list the other users in the signed-in user's DialStack account, with
|
|
607
|
+
* live presence. Unset, it is on unless you pass `directory` (even an empty
|
|
608
|
+
* one, so a list that is still loading never shows the account's users
|
|
609
|
+
* first); `true` lists both, the account's users first, and `false` turns it
|
|
610
|
+
* off. Each user is dialled on their first extension; users without one are
|
|
611
|
+
* left out. Presence is watched for the first 100 (the server's limit); the
|
|
612
|
+
* rest are listed without a status. A `directory` entry whose `id` is a
|
|
613
|
+
* user's id replaces them in the list and keeps their presence. Listed
|
|
614
|
+
* users also name calls to and from their extensions.
|
|
615
|
+
*/
|
|
616
|
+
accountDirectory?: boolean;
|
|
572
617
|
/**
|
|
573
618
|
* Your application's name and version, reported to DialStack with the SDK's
|
|
574
619
|
* own package versions. Ignored inside a `<DialstackComponentsProvider>`:
|
|
@@ -654,7 +699,8 @@ declare const Softphone: React.FC<SoftphoneProps>;
|
|
|
654
699
|
|
|
655
700
|
/**
|
|
656
701
|
* DialPad — the idle/outbound screen of the softphone: connection status chip, a
|
|
657
|
-
* destination field, the 12-key pad, and the call button.
|
|
702
|
+
* destination field, the 12-key pad, and the call button. With a directory, a
|
|
703
|
+
* switch swaps the field and pad for the searchable list. Reads connection +
|
|
658
704
|
* `placeCall` from the softphone context and owns only its own `destination` text.
|
|
659
705
|
*
|
|
660
706
|
* The E911 prompt is NOT rendered here — `<EmergencyBanner>` is a separate
|
|
@@ -727,5 +773,5 @@ declare const OngoingCall: React.FC;
|
|
|
727
773
|
|
|
728
774
|
declare const EmergencyBanner: React.FC;
|
|
729
775
|
|
|
730
|
-
export { DIAL_COUNTRY, DialPad, EmergencyBanner, IncomingCall, IncomingStack, OngoingCall, Softphone, SoftphoneProvider, callPeerName, callPeerNumber, callStateLabelKey, errorMessageKey, formatCallDuration, formatDisplayNumber, isCallActive, isIncomingRinging, sanitizeDestination, selectScreen, shouldRingIncoming, stripToDialString, useActiveCall, useCallActions, useCallDuration, useDialInput, useIncomingCall, useLastError, useSoftphone };
|
|
776
|
+
export { DIAL_COUNTRY, DialPad, EmergencyBanner, IncomingCall, IncomingStack, OngoingCall, Softphone, SoftphoneProvider, callPeerName, callPeerNumber, callStateLabelKey, callStatusLabelKey, errorMessageKey, formatCallDuration, formatDisplayNumber, isCallActive, isIncomingRinging, sanitizeDestination, selectScreen, shouldRingIncoming, stripToDialString, useActiveCall, useCallActions, useCallDuration, useDialInput, useIncomingCall, useLastError, useSoftphone };
|
|
731
777
|
export type { DialPadProps, DirectoryContact, PeerInfo, ResolvePeer, SoftphoneConnectionState, SoftphoneContextValue, SoftphoneError, SoftphoneLayoutVariant, SoftphoneProps, SoftphoneProviderProps, SoftphoneScreen, UseCallActions, UseCallActionsOptions, UseDialInput, UseLastError };
|
package/dist/softphone.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Call, EmergencyAddress, EmergencyAddressInput, CallState, DialStackPhone, CallEndReason } from '@dialstack/sdk-webrtc';
|
|
2
|
+
import { Call, EmergencyAddress, EmergencyAddressInput, PresenceStatus, CallState, DialStackPhone, CallEndReason } from '@dialstack/sdk-webrtc';
|
|
3
3
|
import { CountryCode } from 'libphonenumber-js';
|
|
4
4
|
import { Locale } from '@dialstack/sdk-js';
|
|
5
5
|
import { Locale as Locale$1, AppearanceOptions, FormattingOptions, ClientAppInfo } from '@dialstack/sdk-js/pure';
|
|
@@ -134,14 +134,14 @@ declare function useCallDuration(call: Call | null, intervalMs?: number): string
|
|
|
134
134
|
* `useEmergencyBinding` — the Softphone's built-in E911 provisioning logic.
|
|
135
135
|
*
|
|
136
136
|
* Model: "always send it, the server decides." The server binds the presented
|
|
137
|
-
* emergency address to the connection's network at the `authenticate` handshake
|
|
138
|
-
* and is the authority on whether it's valid
|
|
139
|
-
* the `network.changed` signal.
|
|
137
|
+
* emergency address to the connection's network, at the `authenticate` handshake
|
|
138
|
+
* or in-band on the open socket, and is the authority on whether it's valid
|
|
139
|
+
* here — it rejects a mismatch via the `network.changed` signal.
|
|
140
140
|
*
|
|
141
141
|
* - On connect, if the session has a saved address but presented none (fresh
|
|
142
|
-
* browser), auto-present it (
|
|
143
|
-
*
|
|
144
|
-
* (network.changed) → we prompt.
|
|
142
|
+
* browser), auto-present it (one in-band rebind). Same network → the server
|
|
143
|
+
* binds it silently (reused). Different network → the server denies
|
|
144
|
+
* (network.changed) → we prompt. Live calls are unaffected either way.
|
|
145
145
|
* - `bound` is true unless the server denied (network.changed) or there is no
|
|
146
146
|
* saved address to present at all.
|
|
147
147
|
*
|
|
@@ -164,15 +164,15 @@ interface UseEmergencyBinding {
|
|
|
164
164
|
bound: boolean;
|
|
165
165
|
/** Saved addresses to offer as "Are you here?" choices. */
|
|
166
166
|
savedAddresses: EmergencyAddress[];
|
|
167
|
-
/** True while an address submit (confirm/create
|
|
167
|
+
/** True while an address submit (confirm/create) is in flight. */
|
|
168
168
|
submitting: boolean;
|
|
169
169
|
/** Last error (e.g. a carrier rejection). */
|
|
170
170
|
error: string | null;
|
|
171
171
|
/** Called from the Softphone when the phone emits `network.changed` (denied). */
|
|
172
172
|
onNetworkChanged: () => void;
|
|
173
|
-
/** Confirm an existing saved address for this network (
|
|
173
|
+
/** Confirm an existing saved address for this network (clears its anchor + rebinds). */
|
|
174
174
|
confirm: (id: string) => Promise<void>;
|
|
175
|
-
/** Create + validate a new address, then bind it
|
|
175
|
+
/** Create + validate a new address, then bind it. */
|
|
176
176
|
create: (input: EmergencyAddressInput) => Promise<void>;
|
|
177
177
|
}
|
|
178
178
|
|
|
@@ -215,35 +215,16 @@ interface PeerInfo {
|
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
217
|
/**
|
|
218
|
-
* Looks up the remote party of a call; may be async. Called once per
|
|
219
|
-
* each resolver identity
|
|
220
|
-
*
|
|
218
|
+
* Looks up the remote party of a call; may be async. Called once per remote
|
|
219
|
+
* number for each resolver identity: calls to or from the same number share
|
|
220
|
+
* the answer, so base it on the number, and a call whose other party changes
|
|
221
|
+
* is asked about again. Pass a new function (e.g. `useCallback` over the data
|
|
222
|
+
* it reads) when its answers would change, and keep it stable otherwise.
|
|
221
223
|
* A `null`/`undefined` result, a rejection or a throw all leave the call on the
|
|
222
224
|
* default display (caller-id name, else the number).
|
|
223
225
|
*/
|
|
224
226
|
type ResolvePeer = (call: Call) => PeerInfo | null | undefined | Promise<PeerInfo | null | undefined>;
|
|
225
227
|
|
|
226
|
-
interface UseDialInput {
|
|
227
|
-
/**
|
|
228
|
-
* Handle a per-keystroke value change: strip display separators only (typing
|
|
229
|
-
* stays natural; no mid-field E.164 rewrite). Pass the raw field value.
|
|
230
|
-
*/
|
|
231
|
-
onType: (raw: string) => void;
|
|
232
|
-
/**
|
|
233
|
-
* Handle a paste: a pasted value is complete, so fully normalize it — a
|
|
234
|
-
* formatted `(581) 319-5082` becomes `+15813195082`, so the user sees exactly
|
|
235
|
-
* what will be dialed. Pass the raw clipboard text.
|
|
236
|
-
*/
|
|
237
|
-
onPasteText: (raw: string) => void;
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* Shared cleaning for a dial-string input, used by BOTH the dial pad and the
|
|
241
|
-
* transfer field on web + RN so the "what may I type / what does a paste become"
|
|
242
|
-
* rule lives in one place. Each platform wires its native input event (web
|
|
243
|
-
* onChange/onPaste, RN onChangeText) to these — the string logic never diverges.
|
|
244
|
-
*/
|
|
245
|
-
declare function useDialInput(setValue: (value: string) => void): UseDialInput;
|
|
246
|
-
|
|
247
228
|
/**
|
|
248
229
|
* Pure, platform-agnostic view-model helpers shared by the web and React Native
|
|
249
230
|
* softphones. No React, no DOM, no React Native — just functions over the headless
|
|
@@ -332,6 +313,14 @@ declare function sanitizeDestination(value: string, defaultCountry?: CountryCode
|
|
|
332
313
|
* state shows which label, without forcing a shared i18n table.
|
|
333
314
|
*/
|
|
334
315
|
declare function callStateLabelKey(state: CallState): keyof Locale['softphone'];
|
|
316
|
+
/**
|
|
317
|
+
* The in-call status line: "Reconnecting…" while the signalling socket is down
|
|
318
|
+
* and the call is being resumed, the call state otherwise.
|
|
319
|
+
*/
|
|
320
|
+
declare function callStatusLabelKey(call: {
|
|
321
|
+
state: CallState;
|
|
322
|
+
isReconnecting: boolean;
|
|
323
|
+
}): keyof Locale['softphone'];
|
|
335
324
|
declare function errorMessageKey(code: string): keyof Locale['softphone'];
|
|
336
325
|
/**
|
|
337
326
|
* One entry of the host's directory, offered when transferring or adding a
|
|
@@ -364,8 +353,35 @@ interface DirectoryContact {
|
|
|
364
353
|
* call"), and matched by the search like the other fields.
|
|
365
354
|
*/
|
|
366
355
|
tags?: readonly string[];
|
|
356
|
+
/**
|
|
357
|
+
* The entry's live availability, drawn as a status dot with its label beside
|
|
358
|
+
* the destination, and matched by the search like a tag. Leave it unset for
|
|
359
|
+
* entries that have no presence (a department, an outside number).
|
|
360
|
+
*/
|
|
361
|
+
presence?: PresenceStatus;
|
|
367
362
|
}
|
|
368
363
|
|
|
364
|
+
interface UseDialInput {
|
|
365
|
+
/**
|
|
366
|
+
* Handle a per-keystroke value change: strip display separators only (typing
|
|
367
|
+
* stays natural; no mid-field E.164 rewrite). Pass the raw field value.
|
|
368
|
+
*/
|
|
369
|
+
onType: (raw: string) => void;
|
|
370
|
+
/**
|
|
371
|
+
* Handle a paste: a pasted value is complete, so fully normalize it — a
|
|
372
|
+
* formatted `(581) 319-5082` becomes `+15813195082`, so the user sees exactly
|
|
373
|
+
* what will be dialed. Pass the raw clipboard text.
|
|
374
|
+
*/
|
|
375
|
+
onPasteText: (raw: string) => void;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Shared cleaning for a dial-string input, used by BOTH the dial pad and the
|
|
379
|
+
* transfer field on web + RN so the "what may I type / what does a paste become"
|
|
380
|
+
* rule lives in one place. Each platform wires its native input event (web
|
|
381
|
+
* onChange/onPaste, RN onChangeText) to these — the string logic never diverges.
|
|
382
|
+
*/
|
|
383
|
+
declare function useDialInput(setValue: (value: string) => void): UseDialInput;
|
|
384
|
+
|
|
369
385
|
/**
|
|
370
386
|
* Shared design tokens for the DialStack Softphone.
|
|
371
387
|
*
|
|
@@ -430,6 +446,14 @@ interface SoftphoneContextBase {
|
|
|
430
446
|
* web and React Native can't drift on when the overlays reset.
|
|
431
447
|
*/
|
|
432
448
|
overlays: UseCallOverlays;
|
|
449
|
+
/**
|
|
450
|
+
* Live `m:ss` duration of the active call.
|
|
451
|
+
*
|
|
452
|
+
* @deprecated Use `useCallDuration(activeCall)`. This field changes on every
|
|
453
|
+
* clock tick, so it re-renders every `useSoftphone()` consumer twice a second
|
|
454
|
+
* during a call, even ones that never read it. It will be removed in the next
|
|
455
|
+
* major release.
|
|
456
|
+
*/
|
|
433
457
|
duration: string;
|
|
434
458
|
consultCall: Call | null;
|
|
435
459
|
transferOriginal: Call | null;
|
|
@@ -469,8 +493,17 @@ interface SoftphoneContextBase {
|
|
|
469
493
|
peerInfo: (call: Call | null | undefined) => PeerInfo | null;
|
|
470
494
|
/** The size tier the host asked for (`'auto'` unless pinned). */
|
|
471
495
|
layoutVariant: SoftphoneLayoutVariant;
|
|
472
|
-
/**
|
|
496
|
+
/**
|
|
497
|
+
* What the transfer / add-call picker lists: the users from
|
|
498
|
+
* `accountDirectory` when on, then the host's `directory`. Empty when neither
|
|
499
|
+
* has entries.
|
|
500
|
+
*/
|
|
473
501
|
directory: readonly DirectoryContact[];
|
|
502
|
+
/**
|
|
503
|
+
* The name for a call's number, or null: the host's `directory` first, then
|
|
504
|
+
* the account's users when they are listed, matched in `defaultCountry`.
|
|
505
|
+
*/
|
|
506
|
+
peerName: (number: string) => string | null;
|
|
474
507
|
}
|
|
475
508
|
|
|
476
509
|
/**
|
|
@@ -564,11 +597,23 @@ interface SoftphoneProviderProps {
|
|
|
564
597
|
layoutVariant?: SoftphoneLayoutVariant;
|
|
565
598
|
/**
|
|
566
599
|
* People and places the user can pick from instead of typing a number (a
|
|
567
|
-
* directory of
|
|
568
|
-
* list
|
|
569
|
-
* still works. Pass a new array when the list changes.
|
|
600
|
+
* directory of people or departments, say). Offered as a searchable
|
|
601
|
+
* list from the dial pad and when transferring or adding a call; typing a
|
|
602
|
+
* destination still works. Pass a new array when the list changes.
|
|
570
603
|
*/
|
|
571
604
|
directory?: readonly DirectoryContact[];
|
|
605
|
+
/**
|
|
606
|
+
* Also list the other users in the signed-in user's DialStack account, with
|
|
607
|
+
* live presence. Unset, it is on unless you pass `directory` (even an empty
|
|
608
|
+
* one, so a list that is still loading never shows the account's users
|
|
609
|
+
* first); `true` lists both, the account's users first, and `false` turns it
|
|
610
|
+
* off. Each user is dialled on their first extension; users without one are
|
|
611
|
+
* left out. Presence is watched for the first 100 (the server's limit); the
|
|
612
|
+
* rest are listed without a status. A `directory` entry whose `id` is a
|
|
613
|
+
* user's id replaces them in the list and keeps their presence. Listed
|
|
614
|
+
* users also name calls to and from their extensions.
|
|
615
|
+
*/
|
|
616
|
+
accountDirectory?: boolean;
|
|
572
617
|
/**
|
|
573
618
|
* Your application's name and version, reported to DialStack with the SDK's
|
|
574
619
|
* own package versions. Ignored inside a `<DialstackComponentsProvider>`:
|
|
@@ -654,7 +699,8 @@ declare const Softphone: React.FC<SoftphoneProps>;
|
|
|
654
699
|
|
|
655
700
|
/**
|
|
656
701
|
* DialPad — the idle/outbound screen of the softphone: connection status chip, a
|
|
657
|
-
* destination field, the 12-key pad, and the call button.
|
|
702
|
+
* destination field, the 12-key pad, and the call button. With a directory, a
|
|
703
|
+
* switch swaps the field and pad for the searchable list. Reads connection +
|
|
658
704
|
* `placeCall` from the softphone context and owns only its own `destination` text.
|
|
659
705
|
*
|
|
660
706
|
* The E911 prompt is NOT rendered here — `<EmergencyBanner>` is a separate
|
|
@@ -727,5 +773,5 @@ declare const OngoingCall: React.FC;
|
|
|
727
773
|
|
|
728
774
|
declare const EmergencyBanner: React.FC;
|
|
729
775
|
|
|
730
|
-
export { DIAL_COUNTRY, DialPad, EmergencyBanner, IncomingCall, IncomingStack, OngoingCall, Softphone, SoftphoneProvider, callPeerName, callPeerNumber, callStateLabelKey, errorMessageKey, formatCallDuration, formatDisplayNumber, isCallActive, isIncomingRinging, sanitizeDestination, selectScreen, shouldRingIncoming, stripToDialString, useActiveCall, useCallActions, useCallDuration, useDialInput, useIncomingCall, useLastError, useSoftphone };
|
|
776
|
+
export { DIAL_COUNTRY, DialPad, EmergencyBanner, IncomingCall, IncomingStack, OngoingCall, Softphone, SoftphoneProvider, callPeerName, callPeerNumber, callStateLabelKey, callStatusLabelKey, errorMessageKey, formatCallDuration, formatDisplayNumber, isCallActive, isIncomingRinging, sanitizeDestination, selectScreen, shouldRingIncoming, stripToDialString, useActiveCall, useCallActions, useCallDuration, useDialInput, useIncomingCall, useLastError, useSoftphone };
|
|
731
777
|
export type { DialPadProps, DirectoryContact, PeerInfo, ResolvePeer, SoftphoneConnectionState, SoftphoneContextValue, SoftphoneError, SoftphoneLayoutVariant, SoftphoneProps, SoftphoneProviderProps, SoftphoneScreen, UseCallActions, UseCallActionsOptions, UseDialInput, UseLastError };
|