@tbisoftware/phone 1.0.11 → 1.0.13
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/README.md +309 -7
- package/dist/components/phone.d.ts +3 -0
- package/dist/components/phone.d.ts.map +1 -0
- package/dist/context/PhoneContext.d.ts +23 -0
- package/dist/context/PhoneContext.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/usePhoneManager.d.ts +69 -0
- package/dist/hooks/usePhoneManager.d.ts.map +1 -0
- package/dist/index.cjs +29 -29
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2305 -2112
- package/dist/types/index.d.ts +56 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/cn.d.ts +5 -0
- package/dist/utils/cn.d.ts.map +1 -0
- package/dist/utils/formatDuration.d.ts +5 -0
- package/dist/utils/formatDuration.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export interface CallHistoryEntry {
|
|
2
|
+
id: string;
|
|
3
|
+
number: string;
|
|
4
|
+
timestamp: number;
|
|
5
|
+
duration: number;
|
|
6
|
+
status: 'completed' | 'failed' | 'missed';
|
|
7
|
+
}
|
|
8
|
+
export type PhoneStatus = 'disconnected' | 'progress' | 'confirmed' | 'failed' | 'ended';
|
|
9
|
+
export type ConnectionStatus = 'connecting' | 'connected' | 'disconnected' | 'failed';
|
|
10
|
+
export interface PhoneConfig {
|
|
11
|
+
/** WebSocket URL for the SIP connection */
|
|
12
|
+
websocketUrl: string;
|
|
13
|
+
/** SIP URI (e.g., 'sip:user@domain.com') */
|
|
14
|
+
sipUri: string;
|
|
15
|
+
/** SIP password */
|
|
16
|
+
password: string;
|
|
17
|
+
/** Registrar server (e.g., 'sip:domain.com') */
|
|
18
|
+
registrarServer: string;
|
|
19
|
+
/** Display name for the caller */
|
|
20
|
+
displayName: string;
|
|
21
|
+
/** Authorization user */
|
|
22
|
+
authorizationUser: string;
|
|
23
|
+
}
|
|
24
|
+
export interface PhoneProps {
|
|
25
|
+
/** Configuration for the SIP connection */
|
|
26
|
+
config: PhoneConfig;
|
|
27
|
+
/** Custom class name for the phone container */
|
|
28
|
+
className?: string;
|
|
29
|
+
/** Callback when a call starts */
|
|
30
|
+
onCallStart?: (number: string) => void;
|
|
31
|
+
/** Callback when a call ends */
|
|
32
|
+
onCallEnd?: (number: string, duration: number, status: 'completed' | 'failed') => void;
|
|
33
|
+
/** Callback when status changes */
|
|
34
|
+
onStatusChange?: (status: PhoneStatus) => void;
|
|
35
|
+
/** Custom labels for internationalization */
|
|
36
|
+
labels?: Partial<PhoneLabels>;
|
|
37
|
+
}
|
|
38
|
+
export interface PhoneLabels {
|
|
39
|
+
calling: string;
|
|
40
|
+
waitingResponse: string;
|
|
41
|
+
cancel: string;
|
|
42
|
+
hangUp: string;
|
|
43
|
+
callEnded: string;
|
|
44
|
+
duration: string;
|
|
45
|
+
inactive: string;
|
|
46
|
+
inCall: string;
|
|
47
|
+
placeholder: string;
|
|
48
|
+
callHistory: string;
|
|
49
|
+
noCallsRegistered: string;
|
|
50
|
+
callsRegistered: string;
|
|
51
|
+
noCalls: string;
|
|
52
|
+
startingCall: string;
|
|
53
|
+
callInProgress: string;
|
|
54
|
+
}
|
|
55
|
+
export declare const defaultLabels: PhoneLabels;
|
|
56
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;CAC7C;AAED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CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,aAAa,EAAE,WAgB3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,KAAK,CAAC,EAAE,GAAG,MAAM,CAE5E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatDuration.d.ts","sourceRoot":"","sources":["../../src/utils/formatDuration.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAStD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tbisoftware/phone",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A reusable SIP phone component for React applications",
|
|
6
6
|
"author": "TBI",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"dev": "vite",
|
|
25
25
|
"build": "vite build && npm run build:types",
|
|
26
|
-
"build:types": "tsc
|
|
26
|
+
"build:types": "tsc -p tsconfig.build.json",
|
|
27
27
|
"lint": "eslint .",
|
|
28
28
|
"preview": "vite preview",
|
|
29
29
|
"prepublishOnly": "npm run build"
|