@wavoip/wavoip-webphone 1.1.12 → 1.1.14

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
@@ -1,7 +1,27 @@
1
1
  import { CallActive } from '@wavoip/wavoip-api';
2
2
  import { CallOffer } from '@wavoip/wavoip-api';
3
3
  import { CallOutgoing } from '@wavoip/wavoip-api';
4
- import { Wavoip } from '@wavoip/wavoip-api';
4
+ import { Device } from '@wavoip/wavoip-api';
5
+
6
+ declare type AppConfig = {
7
+ theme?: "dark" | "light" | "system";
8
+ statusBar?: {
9
+ showNotificationsIcon?: boolean;
10
+ showSettingsIcon?: boolean;
11
+ };
12
+ settingsMenu?: {
13
+ deviceMenu?: {
14
+ show?: boolean;
15
+ showAddDevices?: boolean;
16
+ showEnableDevicesButton?: boolean;
17
+ showRemoveDevicesButton?: boolean;
18
+ };
19
+ };
20
+ widget?: {
21
+ showWidgetButton?: boolean;
22
+ startOpen?: boolean;
23
+ };
24
+ };
5
25
 
6
26
  declare type CallActiveProps = Pick<CallActive, "id" | "type" | "device_token" | "direction" | "status" | "peer" | "muted">;
7
27
 
@@ -9,6 +29,15 @@ declare type CallOfferProps = Pick<CallOffer, "id" | "type" | "device_token" | "
9
29
 
10
30
  declare type CallOutgoingProps = Pick<CallOutgoing, "id" | "type" | "device_token" | "direction" | "status" | "peer" | "muted">;
11
31
 
32
+ declare type DeepPartial<T> = T extends object ? {
33
+ [P in keyof T]?: DeepPartial<T[P]>;
34
+ } : T;
35
+
36
+ declare type DeviceState = Device & {
37
+ enable: boolean;
38
+ persist: boolean;
39
+ };
40
+
12
41
  declare type NotificationsType = {
13
42
  id: Date;
14
43
  type: "INFO" | "CALL_FAILED";
@@ -44,8 +73,8 @@ declare type WebphoneAPI = {
44
73
  setInput?: () => void;
45
74
  };
46
75
  device: {
47
- getDevices: Wavoip["getDevices"];
48
- addDevice: (token: string) => void;
76
+ getDevices: () => DeviceState[];
77
+ addDevice: (token: string, persist: boolean) => void;
49
78
  removeDevice: (token: string) => void;
50
79
  enableDevice: (token: string) => void;
51
80
  disableDevice: (token: string) => void;
@@ -86,8 +115,10 @@ declare type WebphoneAPI = {
86
115
  declare class WebPhoneComponent {
87
116
  private container;
88
117
  private root;
89
- render(): Promise<WebphoneAPI>;
118
+ render(config?: WebphoneConfig): Promise<WebphoneAPI>;
90
119
  destroy(): void;
91
120
  }
92
121
 
122
+ export declare type WebphoneConfig = DeepPartial<AppConfig>;
123
+
93
124
  export { }