@acrobits/ipc-sdk 0.1.0 → 0.1.1

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/lib/index.d.ts CHANGED
@@ -1,26 +1,124 @@
1
- import type { BaseContactItem } from '@acrobits/ipc-protocol';
2
- import type { CloudUsernameContactItem } from '@acrobits/ipc-protocol';
3
- import { ContactItem } from '@acrobits/ipc-protocol';
4
- import type { ContactLabel } from '@acrobits/ipc-protocol';
5
- import { DetailedContactItem } from '@acrobits/ipc-protocol';
6
- import { HostType } from '@acrobits/ipc-protocol';
7
- import { ILogger } from '@acrobits/log-helper';
8
- import { IpcProtocolVersion } from '@acrobits/ipc-protocol';
9
- import type { SipUriContactItem } from '@acrobits/ipc-protocol';
1
+ /**
2
+ * Defines the base properties of a contact item.
3
+ *
4
+ * @public
5
+ */
6
+ export declare interface BaseContactItem {
7
+ /**
8
+ * Type of contact item.
9
+ */
10
+ type: ContactType;
11
+ /**
12
+ * Cloud ID associated with the contact.
13
+ */
14
+ cloudId: string;
15
+ }
10
16
 
11
- export { BaseContactItem }
17
+ /**
18
+ * Defines the properties of a CloudUsername based contact item.
19
+ *
20
+ * @public
21
+ */
22
+ export declare interface CloudUsernameContactItem extends BaseContactItem {
23
+ type: 'cloudUsername';
24
+ /**
25
+ * Cloud username associated with the contact.
26
+ */
27
+ cloudUsername: string;
28
+ }
12
29
 
13
- export { CloudUsernameContactItem }
30
+ /**
31
+ * Represents either a CloudUsername or Sip URI based contact item.
32
+ *
33
+ * @public
34
+ */
35
+ export declare type ContactItem = CloudUsernameContactItem | UriContactItem;
14
36
 
15
- export { ContactItem }
37
+ /**
38
+ * Label of contact being described.
39
+ *
40
+ * @public
41
+ */
42
+ export declare type ContactLabel = 'home' | 'work' | 'mobile' | 'other';
16
43
 
17
- export { ContactLabel }
44
+ /**
45
+ * Defines a basic Contact Item type.
46
+ *
47
+ * @public
48
+ */
49
+ export declare type ContactType = 'cloudUsername' | 'uri';
18
50
 
19
- export { DetailedContactItem }
51
+ /**
52
+ * Defines a URI for a contact item.
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * const uri1 = 'sip:my-sip-uri';
57
+ * const uri2 = 'tel:+1234567890';
58
+ * ```
59
+ *
60
+ * @public
61
+ */
62
+ export declare type ContactURI = `sip:${string}` | `tel:${string}` | `sips:${string}` | `tels:${string}`;
20
63
 
21
- export { HostType }
64
+ /**
65
+ * Defines a {@link DetailedContactItem} object with additional fields like profile picture,
66
+ * SIP URIs and contact type etc.
67
+ *
68
+ * @public
69
+ */
70
+ export declare interface DetailedContactItem {
71
+ /**
72
+ * Label of {@link ContactLabel} number associated with this contact.
73
+ */
74
+ contactLabel: ContactLabel;
75
+ /**
76
+ * Type of contact item.
77
+ */
78
+ type: ContactType;
79
+ /**
80
+ * Cloud ID associated with the contact.
81
+ */
82
+ cloudId: string;
83
+ /**
84
+ * Cloud username associated with the contact.
85
+ */
86
+ cloudUsername: string;
87
+ /**
88
+ * URI or number associated with the contact with prefix (e.g. sip: or tel:)
89
+ */
90
+ uri?: ContactURI;
91
+ /**
92
+ * Name of the contact entry.
93
+ */
94
+ displayName?: string;
95
+ /**
96
+ * An optional URL for the contact's profile picture.
97
+ */
98
+ profilePictureUrl?: string;
99
+ }
22
100
 
23
- export { ILogger }
101
+ /**
102
+ * Type of the Host app. Valid values are only `webrtc`, `desktop`, `ios`, `android`, `ios_jitsi`
103
+ * and `electron`.
104
+ *
105
+ * @public
106
+ */
107
+ export declare type HostType = 'webrtc' | 'desktop' | 'ios' | 'android' | 'ios_jitsi' | 'electron';
108
+
109
+ /**
110
+ * A Console-like logger interface that is used by the library to log output. `window.console` is
111
+ * a valid implementation of this interface.
112
+ *
113
+ * @public
114
+ */
115
+ export declare interface ILogger {
116
+ debug(...args: any[]): void;
117
+ info(...args: any[]): void;
118
+ log(...args: any[]): void;
119
+ warn(...args: any[]): void;
120
+ error(...args: any[]): void;
121
+ }
24
122
 
25
123
  /**
26
124
  * Defines the context the web app is running under.
@@ -60,7 +158,6 @@ export declare const enum IPCEvents {
60
158
  * @public
61
159
  */
62
160
  export declare class IPCManager {
63
- #private;
64
161
  /**
65
162
  * The type of the `Host` app the `Client` is embedded in.
66
163
  */
@@ -177,11 +274,15 @@ export declare class IPCManager {
177
274
  * @returns An unsubscribe callback to remove the listener.
178
275
  */
179
276
  onHostInForeground(callback: () => void): UnsubscribeCallback;
277
+ private evaluateContext;
180
278
  }
181
279
 
182
- export { IpcProtocolVersion }
183
-
184
- export { SipUriContactItem }
280
+ /**
281
+ * Supported versions of the IPC Protocol.
282
+ *
283
+ * @public
284
+ */
285
+ export declare type IpcProtocolVersion = '0.1' | '0.2' | '0.3' | '0.4' | '0.5' | '0.6' | '0.7' | '0.8' | '0.9' | '0.10' | '2.0';
185
286
 
186
287
  /**
187
288
  * A callback function to unsubscribe the registered listener.
@@ -190,4 +291,17 @@ export { SipUriContactItem }
190
291
  */
191
292
  export declare type UnsubscribeCallback = () => void;
192
293
 
294
+ /**
295
+ * Defines the properties of a SIP URI based contact item.
296
+ *
297
+ * @public
298
+ */
299
+ export declare interface UriContactItem extends BaseContactItem {
300
+ type: 'uri';
301
+ /**
302
+ * URI or number associated with the contact with prefix (e.g. sip: or tel:)
303
+ */
304
+ uri: ContactURI;
305
+ }
306
+
193
307
  export { }