@tmsoft/webphone 1.0.27 → 1.1.10

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 CHANGED
@@ -1,215 +1,215 @@
1
- # **📞 WebPhone Library (`@tmsoft/webphone`)**
1
+ # WebPhone Library (`@tmsoft/webphone`)
2
2
 
3
3
  [![NPM Version](https://img.shields.io/npm/v/@tmsoft/webphone)](https://www.npmjs.com/package/@tmsoft/webphone)
4
- [![License](https://img.shields.io/npm/l/@tmsoft/webphone)](LICENSE)
5
4
 
6
- **`@tmsoft/webphone`** es una librería Vue 3 que proporciona un componente de teléfono web basado en SIP con soporte para llamadas WebRTC.
5
+ Librería para Vue 3 con un componente `WebPhone` (softphone) basado en SIP y WebRTC. Incluye teclado DTMF, selección de dispositivos de audio, control de volúmenes y estado de conexión.
7
6
 
8
- ## 📌 **Características**
9
7
 
10
- - 📡 Soporte para SIP y WebRTC
11
- - 🎨 Integrado con PrimeVue y TailwindCSS
12
- - 📞 Gestión de dispositivos de audio (micrófono y altavoz)
13
- - 🔄 Mecanismo de reconexión SIP
14
- - 🛠 Fácil integración en cualquier proyecto Vue 3
8
+ ### Características
9
+ - Integración SIP sobre WebSocket (basado en JsSIP)
10
+ - Audio WebRTC con manejo de permisos de micrófono
11
+ - Teclado DTMF y estado de llamada (entrante/saliente/en curso)
12
+ - Gestión de dispositivos de audio (micrófonos y altavoces)
13
+ - Reconexión y manejo de estado SIP
14
+ - Diseño compacto y dependencias UI mínimas (PrimeVue para botones/inputs)
15
15
 
16
- ---
17
16
 
18
- ## 🚀 **Instalación**
17
+ ### Requisitos
18
+ - Vue 3.5+
19
+ - PrimeVue 4.x y PrimeIcons 7.x (peer dependencies)
20
+ - @vueuse/core 13.x (peer dependency)
21
+ - Servidor SIP con WebSocket habilitado (por ejemplo, Asterisk en `/asterisk/ws`, puerto 8089 por defecto)
22
+ - Navegador con HTTPS y permisos de micrófono
19
23
 
20
- ### 📦 Desde NPM
21
24
 
22
- ```bash
23
- npm install @tmsoft/webphone
24
- ```
25
-
26
- ```bash
27
- yarn add @tmsoft/webphone
28
- ```
25
+ ## Instalación
29
26
 
30
- ```bash
31
- pnpm add @tmsoft/webphone
32
- ```
33
-
34
- ### 🌐 Desde CDN (Sin instalación)
27
+ Instale el paquete y los peer dependencies:
35
28
 
36
- ```html
37
- <!-- Registro automático del web component -->
38
- <script src="https://unpkg.com/@tmsoft/webphone@latest/dist/webphone-standalone.umd.js"></script>
39
-
40
- <!-- O versión específica para producción -->
41
- <script src="https://unpkg.com/@tmsoft/webphone@1.0.23/dist/webphone-standalone.umd.js"></script>
29
+ ```sh
30
+ npm install @tmsoft/webphone primevue primeicons @vueuse/core
31
+ # o
32
+ yarn add @tmsoft/webphone primevue primeicons @vueuse/core
33
+ # o
34
+ pnpm add @tmsoft/webphone primevue primeicons @vueuse/core
42
35
  ```
43
36
 
44
- ### 📋 Archivos de distribución disponibles
37
+ Los estilos del componente se inyectan automáticamente en tiempo de ejecución. No es necesario configurar Tailwind en su proyecto para usar esta librería.
45
38
 
46
- | Archivo | Propósito | Formato | Registro automático |
47
- |---------|-----------|---------|-------------------|
48
- | `webphone.es.js` | Componente Vue | ES Module | ❌ |
49
- | `webphone.umd.js` | Componente Vue | UMD | ❌ |
50
- | `webphone-standalone.umd.js` | Web Component | UMD | ✅ |
51
- | `webphone-standalone.iife.js` | Web Component | IIFE | ✅ |
52
- | `webphone-web-component.es.js` | Web Component | ES Module | ❌ |
53
39
 
54
- ---
40
+ ## Uso
55
41
 
56
- ## 🛠 **Uso**
42
+ Puede utilizar la librería como plugin global o importar el componente localmente.
57
43
 
58
- ### 🎯 En aplicaciones Vue
44
+ ### Opción A: Plugin global
45
+ `main.ts`:
59
46
 
60
- ```typescript
61
- // main.ts
47
+ ```ts
62
48
  import { createApp } from 'vue'
63
- import { install as installWebPhone } from '@tmsoft/webphone'
64
49
  import App from './App.vue'
50
+ import WebphonePlugin from '@tmsoft/webphone'
65
51
 
66
52
  const app = createApp(App)
67
- app.use(installWebPhone) // Registra el componente globalmente
53
+ app.use(WebphonePlugin)
68
54
  app.mount('#app')
69
55
  ```
70
56
 
71
- ```vue
72
- <!-- MyComponent.vue -->
73
- <template>
74
- <WebPhone
75
- :extension="extension"
76
- :password="password"
77
- :domain="domain"
78
- mode="call"
79
- />
80
- </template>
57
+ Luego, en cualquier componente:
81
58
 
59
+ ```vue
82
60
  <script setup lang="ts">
83
- import { ref } from 'vue'
84
-
85
- const extension = ref('1001')
86
- const password = ref('supersecret')
87
- const domain = ref('sip.example.com')
61
+ const extension = '1001'
62
+ const password = 'supersecret'
63
+ const domain = 'sip.example.com' // ver normalización de dominio más abajo
88
64
  </script>
89
- ```
90
65
 
91
- ### 🌐 Como Web Component (Cualquier framework)
92
-
93
- ```html
94
- <!DOCTYPE html>
95
- <html>
96
- <head>
97
- <!-- Cargar desde CDN -->
98
- <script src="https://unpkg.com/@tmsoft/webphone@latest/dist/webphone-standalone.umd.js"></script>
99
- </head>
100
- <body>
101
- <!-- Usar directamente en HTML -->
102
- <web-phone
103
- extension="1001"
104
- password="supersecret"
105
- domain="sip.example.com"
106
- mode="call">
107
- </web-phone>
108
- </body>
109
- </html>
66
+ <template>
67
+ <WebPhone :extension="extension" :password="password" :domain="domain" />
68
+ </template>
110
69
  ```
111
70
 
112
- ### 📦 En otros frameworks
113
-
114
- ```javascript
115
- // React, Angular, Svelte, etc.
116
- import '@tmsoft/webphone/web-component'
71
+ ### Opción B: Importación local del componente
117
72
 
118
- // Ahora puedes usar <web-phone> en cualquier template
119
- ```
73
+ ```vue
74
+ <script setup lang="ts">
75
+ import { WebPhone } from '@tmsoft/webphone'
120
76
 
121
- ## 📚 **Documentación Detallada**
77
+ const extension = '1001'
78
+ const password = 'supersecret'
79
+ const domain = 'sip.example.com'
80
+ </script>
122
81
 
123
- - 📖 [**NPM_USAGE.md**](./NPM_USAGE.md) - Guía completa de uso desde NPM con CDN y diferentes frameworks
124
- - 🔧 [**USAGE_EXAMPLES.md**](./USAGE_EXAMPLES.md) - Ejemplos prácticos y casos de uso específicos
125
- - 📋 [**src/lib/webphone/README.md**](./src/lib/webphone/README.md) - Documentación técnica de la librería
126
- - 🌐 [**example-cdn.html**](./example-cdn.html) - Demo en vivo usando CDN
82
+ <template>
83
+ <WebPhone :extension="extension" :password="password" :domain="domain" />
84
+ </template>
85
+ ```
127
86
 
128
- ---
129
87
 
130
- ## 📌 **Props del Componente**
88
+ ## API del componente
131
89
 
132
- | Propiedad | Tipo | Requerida | Descripción |
133
- | ----------- | ---------- | --------- | --------------------------------------------------------------------------------- |
134
- | `extension` | `String` | ✅ | Número de extensión del usuario. |
135
- | `password` | `String` | ✅ | Contraseña SIP de la extensión. |
136
- | `domain` | `String` | ✅ | Dominio del servidor SIP. |
137
- | `mode` | `String` | ❌ | Tipo de llamada. Valores: `'call'`, `'webcall'`, `'video'`. Por defecto `'call'`. |
138
- | `image` | `String` | ❌ | Imagen base64 o URL para mostrar en modo `webcall`. |
139
- | `to` | `String` | ❌ | Número de destino en modo `webcall`. |
140
- | `callback` | `Function` | ❌ | Función de volver atrás en modo `webcall`. |
90
+ ### Props
141
91
 
142
- ---
92
+ | Propiedad | Tipo | Requerida | Default | Descripción |
93
+ |------------|--------------------------------------|-----------|-----------|-------------|
94
+ | `extension`| `string` | Sí | — | Extensión del usuario para registrar y originar llamadas SIP. |
95
+ | `password` | `string` | Sí | — | Contraseña SIP de la extensión. |
96
+ | `domain` | `string` | Sí | — | Dominio o URL del servidor SIP. Se normaliza automáticamente (ver detalle). |
97
+ | `mode` | `'webcall' \| 'call' \| 'video'` | No | `'webcall'` | Modo de uso. Nota: `video` aún no inicia video de forma automática. |
98
+ | `image` | `string` | No | — | URL o base64 para mostrar un logotipo en modo `webcall`. |
99
+ | `to` | `string` | No | — | Número destino en modo `webcall`. Si se define, se origina la llamada automáticamente cuando el registro SIP está activo (≈ 2 s). |
100
+ | `callback` | `(event: MouseEvent) => void` | No | — | Reservado. Actualmente no se utiliza en el componente. |
143
101
 
144
- ## 🏗 **Construcción del Paquete**
145
102
 
146
- Para compilar el paquete, ejecutar:
103
+ ### Normalización de `domain`
104
+ El componente acepta distintos formatos y construye automáticamente la URL WebSocket para SIP:
105
+ - Si recibe solo host (por ejemplo, `pbx.midominio.com`), se asume `wss://pbx.midominio.com:8089/asterisk/ws`.
106
+ - Si recibe `http://host[:puerto]` se usa `ws://host[:puerto]/asterisk/ws`.
107
+ - Si recibe `https://host[:puerto]` se usa `wss://host[:puerto]/asterisk/ws`.
108
+ - Si indica explícitamente un puerto, se respeta (de lo contrario, se usa 8089 por defecto para Asterisk).
147
109
 
148
- ```sh
149
- npm run build
150
- ```
110
+ Además, el URI SIP se compone como `sip:<extension>@<host[:puerto]>`.
151
111
 
152
- Esto generará los archivos de distribución en `dist/` con los siguientes formatos:
153
112
 
154
- - **UMD** (`webphone.umd.js`) → Para navegadores y CDNs.
155
- - **ES Module** (`webphone.es.js`) Para importación moderna.
156
- - **CommonJS** (`webphone.cjs.js`) → Para entornos Node.js.
113
+ ### Slots
114
+ - `back-button`: slot para renderizar un control de navegación en la cabecera cuando `mode === 'webcall'`.
157
115
 
158
- ---
159
116
 
160
- ## 🌎 **Uso en CDN**
117
+ ## Uso via CDN
161
118
 
162
- Para cargar la librería directamente en una página sin instalar NPM, usar un CDN como [jsDelivr](https://www.jsdelivr.com/):
119
+ ### ES Module (recomendado)
163
120
 
164
121
  ```html
165
122
  <script type="module">
166
- import WebPhone from 'https://cdn.jsdelivr.net/npm/@tmsoft/webphone/dist/webphone.es.js'
123
+ import { createApp } from 'vue'
124
+ import WebphonePlugin from 'https://cdn.jsdelivr.net/npm/@tmsoft/webphone/dist/webphone.es.js'
125
+
126
+ const App = {
127
+ template: '<WebPhone extension="1001" password="supersecret" domain="sip.example.com" />'
128
+ }
129
+
130
+ createApp(App).use(WebphonePlugin).mount('#app')
167
131
  </script>
168
132
  ```
169
133
 
170
- Para UMD:
134
+ ### UMD
171
135
 
172
136
  ```html
137
+ <!-- Vue 3 UMD -->
138
+ <script src="https://unpkg.com/vue@3"></script>
139
+ <!-- WebPhone UMD -->
173
140
  <script src="https://cdn.jsdelivr.net/npm/@tmsoft/webphone/dist/webphone.umd.js"></script>
141
+ <script>
142
+ const app = Vue.createApp({
143
+ template: '<WebPhone extension="1001" password="supersecret" domain="sip.example.com" />'
144
+ })
145
+ // El paquete UMD expone 'WebPhone' como global; la función por defecto es el plugin
146
+ app.use(WebPhone.default)
147
+ app.mount('#app')
148
+ </script>
174
149
  ```
175
150
 
176
- ---
151
+ ### Sin frameworks: Web Component (`<web-phone />`)
177
152
 
178
- ## 📤 **Publicación en NPM**
153
+ Para incrustar el softphone en una página HTML sin inicializar Vue ni otros frameworks, use el build UMD específico del Web Component:
179
154
 
180
- Para publicar una nueva versión del paquete en NPM:
181
-
182
- 1️⃣ **Autenticarse en NPM**
183
- Si no se ha iniciado sesión:
155
+ ```html
156
+ <!-- Carga el Web Component listo para usar -->
157
+ <script src="https://cdn.jsdelivr.net/npm/@tmsoft/webphone/dist/webphone-element.umd.js"></script>
184
158
 
185
- ```sh
186
- npm login
159
+ <!-- Úselo directamente en el DOM -->
160
+ <web-phone extension="1001" password="supersecret" domain="sip.example.com" mode="webcall" to="099999999" image="https://example.com/logo.png"></web-phone>
187
161
  ```
188
162
 
189
- 2️⃣ **Actualizar la versión en `package.json`**
190
- Ejemplo: Incrementar la versión **`1.0.1` `1.0.2`** en `package.json`:
191
-
192
- ```json
193
- {
194
- "name": "@tmsoft/webphone",
195
- "version": "1.0.2"
196
- }
197
- ```
163
+ Notas:
164
+ - Los atributos del elemento corresponden a las props del componente (`extension`, `password`, `domain`, `mode`, `image`, `to`).
165
+ - El build del Web Component incluye internamente Vue, PrimeVue y estilos necesarios; no requiere inicialización adicional.
198
166
 
199
- 3️⃣ **Construir el paquete**
200
167
 
201
- ```sh
202
- npm run build
203
- ```
168
+ ## Desarrollo
204
169
 
205
- 4️⃣ **Publicar el paquete en NPM**
170
+ Scripts principales:
206
171
 
207
172
  ```sh
208
- npm run publish:lib
209
- ```
210
-
211
- Para publicar en un registro privado como Verdaccio:
212
-
173
+ npm run dev # entorno de desarrollo
174
+ npm run build # compila ESM/CJS y UMD
175
+ npm run preview # vista previa local de la build
176
+ npm run test:unit # pruebas unitarias (Vitest)
177
+ npm run test:e2e # pruebas E2E (Playwright)
178
+ npm run lint # lint con ESLint
179
+ npm run format # formateo con Prettier
180
+ ```
181
+
182
+ La salida de distribución se genera en `dist/`:
183
+ - `webphone.es.js` (ES Module)
184
+ - `webphone.cjs.js` (CommonJS)
185
+ - `webphone.umd.js` (UMD)
186
+ - `index.d.ts` (tipos TypeScript)
187
+
188
+
189
+ ## Publicación en NPM
190
+
191
+ Pasos sugeridos para publicar una versión:
192
+
193
+ 1. Autentíquese en NPM (una vez por entorno):
194
+ ```sh
195
+ npm login
196
+ ```
197
+ 2. Compile el paquete:
198
+ ```sh
199
+ npm run build
200
+ ```
201
+ 3. Publique con incremento de patch automático:
202
+ ```sh
203
+ npm run publish:lib
204
+ ```
205
+ Este script ejecuta `npm version patch` y `npm publish --access public`.
206
+
207
+ Para publicar en un registro local (por ejemplo, Verdaccio):
213
208
  ```sh
214
209
  npm run publish:local
215
210
  ```
211
+
212
+
213
+ ## Licencia
214
+
215
+ MIT.
package/dist/favicon.ico CHANGED
Binary file
package/dist/index.d.ts CHANGED
@@ -1,274 +1,51 @@
1
- import { App } from 'vue';
2
- import { AuraBaseDesignTokens } from '@primeuix/themes/aura/base';
3
- import { ButtonProps } from 'primevue/button';
4
- import { ButtonSlots } from 'primevue/button';
5
1
  import { ComponentOptionsMixin } from 'vue';
6
2
  import { ComponentProvideOptions } from 'vue';
7
- import { ComputedRef } from 'vue';
8
3
  import { DefineComponent } from 'vue';
9
- import { DefineComponent as DefineComponent_2 } from '@primevue/core';
10
- import { defineCustomElement } from 'vue';
11
- import { DialogProps } from 'primevue/dialog';
12
- import { DialogSlots } from 'primevue/dialog';
13
- import { ExtractPropTypes } from 'vue';
14
- import { FunctionalComponent } from 'vue';
15
- import { InputTextProps } from 'primevue/inputtext';
16
- import { InputTextSlots } from 'primevue/inputtext';
17
- import { Preset } from '@primeuix/themes/types';
18
- import { PropType } from 'vue';
19
4
  import { PublicProps } from 'vue';
20
- import { Ref } from 'vue';
21
- import { SelectChangeEvent } from 'primevue/select';
22
- import { SelectFilterEvent } from 'primevue/select';
23
- import { SelectMethods } from 'primevue/select';
24
- import { SelectProps } from 'primevue/select';
25
- import { SelectSlots } from 'primevue/select';
26
- import { SliderProps } from 'primevue/slider';
27
- import { SliderSlideEndEvent } from 'primevue/slider';
28
- import { SliderSlots } from 'primevue/slider';
29
- import { SVGAttributes } from 'vue';
30
- import { VueElementConstructor } from 'vue';
31
5
 
32
- export declare function configurePrimeVue(app: App): void;
33
-
34
- export declare function createWebphoneElement(): ReturnType<typeof defineCustomElement>;
35
-
36
- export declare function install(app: App, options?: {
37
- configurePrimeVue?: boolean;
38
- }): void;
39
-
40
- export declare const primeVueConfig: {
41
- theme: {
42
- unstyled: boolean;
43
- preset: Preset<AuraBaseDesignTokens>;
44
- options: {
45
- prefix: string;
46
- darkModeSelector: string;
47
- cssLayer: boolean;
48
- };
6
+ declare const __VLS_component: DefineComponent<WebphoneProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<WebphoneProps> & Readonly<{}>, {
7
+ mode: "webcall" | "call" | "video";
8
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
9
+ playerRef: HTMLAudioElement;
10
+ ringerRef: HTMLAudioElement;
11
+ backRingerRef: HTMLAudioElement;
12
+ viewerRef: HTMLVideoElement;
13
+ selfViewerRef: HTMLVideoElement;
14
+ }, HTMLDivElement>;
15
+
16
+ declare function __VLS_template(): {
17
+ attrs: Partial<{}>;
18
+ slots: {
19
+ 'back-button'?(_: {}): any;
49
20
  };
21
+ refs: {
22
+ playerRef: HTMLAudioElement;
23
+ ringerRef: HTMLAudioElement;
24
+ backRingerRef: HTMLAudioElement;
25
+ viewerRef: HTMLVideoElement;
26
+ selfViewerRef: HTMLVideoElement;
27
+ };
28
+ rootEl: HTMLDivElement;
50
29
  };
51
30
 
52
- export declare function registerCustomElement(): VueElementConstructor<unknown>;
31
+ declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
53
32
 
54
- export declare const WebPhone: DefineComponent<ExtractPropTypes< {
55
- extension: {
56
- type: StringConstructor;
57
- required: true;
58
- };
59
- password: {
60
- type: StringConstructor;
61
- required: true;
62
- };
63
- domain: {
64
- type: StringConstructor;
65
- required: true;
66
- };
67
- mode: {
68
- type: StringConstructor;
69
- default: string;
70
- validator: (value: string) => boolean;
71
- };
72
- image: {
73
- type: StringConstructor;
74
- required: false;
75
- };
76
- to: {
77
- type: StringConstructor;
78
- required: false;
79
- };
80
- callback: {
81
- type: PropType<(event: MouseEvent) => void>;
82
- required: false;
83
- };
84
- }>, {
85
- setCallVolume: (value: number | number[]) => void;
86
- validateKeydown: (event: KeyboardEvent) => void;
87
- setNotificationVolume: (value: number | number[]) => void;
88
- dtmfKeys: string[];
89
- canCall: ComputedRef<boolean | "" | undefined>;
90
- handleDTMF: (digit: string) => void;
91
- statusClass: ComputedRef<"text-[#03ac7e]" | "text-blue-400" | "text-yellow-400" | "text-red-500">;
92
- showNumpad: Ref<boolean, boolean>;
93
- toggleNumpad: () => void;
94
- audioVolumeRef: Ref<any, any>;
95
- audioDevicesRef: Ref<any, any>;
96
- toggleAudioVolume: (event: MouseEvent) => void;
97
- toggleAudioDevices: (event: MouseEvent) => void;
98
- deleteLastDigit: () => void;
99
- isWebcall: ComputedRef<boolean>;
100
- isCall: ComputedRef<boolean>;
101
- isVideo: ComputedRef<boolean>;
102
- finalPhoneNumber: ComputedRef<string | undefined>;
103
- showSettings: Ref<boolean, boolean>;
104
- microphonePermission: Ref<"granted" | "denied" | "prompt", "granted" | "denied" | "prompt">;
105
- isRequestingPermission: Ref<boolean, boolean>;
106
- requestMicrophonePermission: () => Promise<boolean>;
107
- playerRef: Ref<HTMLAudioElement | null, HTMLAudioElement | null>;
108
- ringerRef: Ref<HTMLAudioElement | null, HTMLAudioElement | null>;
109
- backRingerRef: Ref<HTMLAudioElement | null, HTMLAudioElement | null>;
110
- viewerRef: Ref<HTMLVideoElement | null, HTMLVideoElement | null>;
111
- selfViewerRef: Ref<HTMLVideoElement | null, HTMLVideoElement | null>;
112
- startSIP: () => void;
113
- stopSIP: () => void;
114
- makeCall: (to: string, hasVideo: boolean) => void;
115
- answerCall: () => void | undefined;
116
- endCall: () => void | undefined;
117
- toggleMute: () => void;
118
- microphones: Ref< {
119
- readonly deviceId: string;
120
- readonly groupId: string;
121
- readonly kind: MediaDeviceKind;
122
- readonly label: string;
123
- toJSON: () => any;
124
- }[], MediaDeviceInfo[] | {
125
- readonly deviceId: string;
126
- readonly groupId: string;
127
- readonly kind: MediaDeviceKind;
128
- readonly label: string;
129
- toJSON: () => any;
130
- }[]>;
131
- speakers: Ref< {
132
- readonly deviceId: string;
133
- readonly groupId: string;
134
- readonly kind: MediaDeviceKind;
135
- readonly label: string;
136
- toJSON: () => any;
137
- }[], MediaDeviceInfo[] | {
138
- readonly deviceId: string;
139
- readonly groupId: string;
140
- readonly kind: MediaDeviceKind;
141
- readonly label: string;
142
- toJSON: () => any;
143
- }[]>;
144
- selectedMicId: Ref<string | null, string | null>;
145
- selectedSpeakerId: Ref<string | null, string | null>;
146
- isMuted: Ref<boolean, boolean>;
147
- activeCall: Ref<boolean, boolean>;
148
- isSIPActive: Ref<boolean, boolean>;
149
- canMute: ComputedRef<boolean>;
150
- canAnswer: ComputedRef<boolean>;
151
- canHangup: ComputedRef<boolean>;
152
- canStartSIP: ComputedRef<boolean>;
153
- canStopSIP: ComputedRef<boolean>;
154
- changeMicrophone: (deviceId: string) => Promise<void>;
155
- changeSpeaker: (deviceId: string) => Promise<void>;
156
- callVolume: Ref<number, number>;
157
- notificationVolume: Ref<number, number>;
158
- setVolume: (type: "call" | "notification", volume: number) => void;
159
- isIncomingCall: Ref<boolean, boolean>;
160
- sendDTMF: (digit: string) => void;
161
- resetStates: () => void;
162
- phoneNumber: Ref<string, string>;
163
- callerId: Ref<string | null, string | null>;
164
- isRinging: Ref<boolean, boolean>;
165
- statusMessage: ComputedRef<string>;
166
- formattedCallDuration: ComputedRef<string>;
167
- callDuration: Ref<number, number>;
168
- isOutgoingCall: Ref<boolean, boolean>;
169
- checkMicrophonePermission: () => Promise<"granted" | "denied" | "prompt">;
170
- }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
171
- extension: {
172
- type: StringConstructor;
173
- required: true;
174
- };
175
- password: {
176
- type: StringConstructor;
177
- required: true;
178
- };
179
- domain: {
180
- type: StringConstructor;
181
- required: true;
182
- };
183
- mode: {
184
- type: StringConstructor;
185
- default: string;
186
- validator: (value: string) => boolean;
187
- };
188
- image: {
189
- type: StringConstructor;
190
- required: false;
191
- };
192
- to: {
193
- type: StringConstructor;
194
- required: false;
195
- };
196
- callback: {
197
- type: PropType<(event: MouseEvent) => void>;
198
- required: false;
33
+ declare type __VLS_WithTemplateSlots<T, S> = T & {
34
+ new (): {
35
+ $slots: S;
36
+ };
199
37
  };
200
- }>> & Readonly<{}>, {
201
- mode: string;
202
- }, {}, {
203
- PrimeButton: DefineComponent_2<ButtonProps, ButtonSlots, (e: string, ...args: any[]) => void>;
204
- PrimeInputText: DefineComponent_2<InputTextProps, InputTextSlots, ((e: "update:modelValue", value: string | undefined) => void) & ((e: "value-change", value: string | undefined) => void)>;
205
- WebphoneSettings: DefineComponent<ExtractPropTypes< {
206
- callVolume: NumberConstructor;
207
- notificationVolume: NumberConstructor;
208
- selectedMicId: StringConstructor;
209
- selectedSpeakerId: StringConstructor;
210
- microphones: PropType<Array<{
211
- label: string;
212
- deviceId: string;
213
- }>>;
214
- speakers: PropType<Array<{
215
- label: string;
216
- deviceId: string;
217
- }>>;
218
- }>, {
219
- showSettings: Ref<boolean, boolean>;
220
- openDialog: () => void;
221
- updateCallVolume: (value: number | number[]) => void;
222
- updateNotificationVolume: (value: number | number[]) => void;
223
- updateSelectedMic: (value: string) => void;
224
- updateSelectedSpeaker: (value: string) => void;
225
- selectedMic: ComputedRef< {
226
- label: string;
227
- deviceId: string;
228
- } | null>;
229
- selectedSpeaker: ComputedRef< {
230
- label: string;
231
- deviceId: string;
232
- } | null>;
233
- version: string;
234
- packageName: string;
235
- }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("update:callVolume" | "update:notificationVolume" | "update:selectedMicId" | "update:selectedSpeakerId")[], "update:callVolume" | "update:notificationVolume" | "update:selectedMicId" | "update:selectedSpeakerId", PublicProps, Readonly<ExtractPropTypes< {
236
- callVolume: NumberConstructor;
237
- notificationVolume: NumberConstructor;
238
- selectedMicId: StringConstructor;
239
- selectedSpeakerId: StringConstructor;
240
- microphones: PropType<Array<{
241
- label: string;
242
- deviceId: string;
243
- }>>;
244
- speakers: PropType<Array<{
245
- label: string;
246
- deviceId: string;
247
- }>>;
248
- }>> & Readonly<{
249
- "onUpdate:callVolume"?: ((...args: any[]) => any) | undefined;
250
- "onUpdate:notificationVolume"?: ((...args: any[]) => any) | undefined;
251
- "onUpdate:selectedMicId"?: ((...args: any[]) => any) | undefined;
252
- "onUpdate:selectedSpeakerId"?: ((...args: any[]) => any) | undefined;
253
- }>, {}, {}, {
254
- PrimeButton: DefineComponent_2<ButtonProps, ButtonSlots, (e: string, ...args: any[]) => void>;
255
- PrimeDialog: DefineComponent_2<DialogProps, DialogSlots, ((e: "dragend", event: Event) => void) & ((e: "dragstart", event: Event) => void) & ((e: "update:visible", value: boolean) => void) & ((e: "hide") => void) & ((e: "after-hide") => void) & ((e: "show") => void) & ((e: "maximize", event: Event) => void) & ((e: "unmaximize", event: Event) => void)>;
256
- PrimeSelect: DefineComponent_2<SelectProps, SelectSlots, ((e: "filter", event: SelectFilterEvent) => void) & ((e: "blur", event: Event) => void) & ((e: "change", event: SelectChangeEvent) => void) & ((e: "focus", event: Event) => void) & ((e: "hide") => void) & ((e: "show") => void) & ((e: "update:modelValue", value: any) => void) & ((e: "value-change", value: any) => void) & ((e: "before-show") => void) & ((e: "before-hide") => void), SelectMethods>;
257
- Slider: DefineComponent_2<SliderProps, SliderSlots, ((e: "change", value: number) => void) & ((e: "update:modelValue", value: number | number[]) => void) & ((e: "value-change", value: number | number[]) => void) & ((e: "slideend", event: SliderSlideEndEvent) => void)>;
258
- SettingsIcon: FunctionalComponent<SVGAttributes, {}, any, {}>;
259
- }, {}, string, ComponentProvideOptions, true, {}, any>;
260
- LogoIcon: FunctionalComponent<SVGAttributes, {}, any, {}>;
261
- ExtensionIcon: FunctionalComponent<SVGAttributes, {}, any, {}>;
262
- NumpadIcon: FunctionalComponent<SVGAttributes, {}, any, {}>;
263
- CallIcon: FunctionalComponent<SVGAttributes, {}, any, {}>;
264
- HangupIcon: FunctionalComponent<SVGAttributes, {}, any, {}>;
265
- MicrophoneIcon: FunctionalComponent<SVGAttributes, {}, any, {}>;
266
- NumpadOffIcon: FunctionalComponent<SVGAttributes, {}, any, {}>;
267
- MicrophoneOffIcon: FunctionalComponent<SVGAttributes, {}, any, {}>;
268
- KeyboardDeleteIcon: FunctionalComponent<SVGAttributes, {}, any, {}>;
269
- NebulaIcon: FunctionalComponent<SVGAttributes, {}, any, {}>;
270
- }, {}, string, ComponentProvideOptions, true, {}, any>;
271
38
 
272
- export declare const WebphoneElement: ReturnType<typeof defineCustomElement>;
39
+ export declare const WebPhone: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
40
+
41
+ declare interface WebphoneProps {
42
+ extension: string;
43
+ password: string;
44
+ domain: string;
45
+ mode: 'webcall' | 'call' | 'video';
46
+ image?: string;
47
+ to?: string;
48
+ callback?: (event: MouseEvent) => void;
49
+ }
273
50
 
274
51
  export { }