This repository has been archived by the owner on Nov 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathtypes.ts
65 lines (59 loc) · 1.52 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import * as PropTypes from "prop-types";
export interface ExtraHeaders {
register?: string[];
invite?: string[];
}
export const extraHeadersPropType = PropTypes.objectOf(
PropTypes.arrayOf(PropTypes.string),
);
// https://developer.mozilla.org/en-US/docs/Web/API/RTCIceServer
export type IceServers = Array<{
urls: string | string[];
username?: string;
credential?: string;
credentialType?: string;
password?: string;
}>;
export const iceServersPropType = PropTypes.arrayOf(PropTypes.object);
export interface Sip {
status?: string;
errorType?: string;
errorMessage?: string;
host?: string;
port?: number;
user?: string;
password?: string;
autoRegister?: boolean;
autoAnswer: boolean;
sessionTimersExpires: number;
extraHeaders: ExtraHeaders;
iceServers: IceServers;
debug: boolean;
}
export const sipPropType = PropTypes.shape({
status: PropTypes.string,
errorType: PropTypes.string,
errorMessage: PropTypes.string,
host: PropTypes.string,
port: PropTypes.number,
user: PropTypes.string,
password: PropTypes.string,
autoRegister: PropTypes.bool,
autoAnswer: PropTypes.bool,
sessionTimersExpires: PropTypes.number,
extraHeaders: extraHeadersPropType,
iceServers: iceServersPropType,
debug: PropTypes.bool,
});
export interface Call {
id: string;
status: string;
direction: string;
counterpart: string;
}
export const callPropType = PropTypes.shape({
id: PropTypes.string,
status: PropTypes.string,
direction: PropTypes.string,
counterpart: PropTypes.string,
});