summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2017-12-04 20:41:27 +0100
committerAndrej Mihajlov <and@mullvad.net>2017-12-05 11:27:00 +0100
commitbf11fc59de756cc94ff1aae83383a87817b796dd (patch)
tree8581e42069a6e89834857c8c72e08ef2a90d275b
parent2baf7435553be6999a6bf146de921822a99e5a09 (diff)
downloadmullvadvpn-bf11fc59de756cc94ff1aae83383a87817b796dd.tar.xz
mullvadvpn-bf11fc59de756cc94ff1aae83383a87817b796dd.zip
Refine RelaySettings
-rw-r--r--app/lib/ipc-facade.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/app/lib/ipc-facade.js b/app/lib/ipc-facade.js
index e92541dfcf..a4cf9bdc9f 100644
--- a/app/lib/ipc-facade.js
+++ b/app/lib/ipc-facade.js
@@ -6,7 +6,7 @@ import { validate } from 'validated/object';
import type { Coordinate2d } from '../types';
-export type AccountData = {expiry: string};
+export type AccountData = { expiry: string };
export type AccountToken = string;
export type Ip = string;
export type Location = {
@@ -49,7 +49,8 @@ type RelaySettingsNormal<TTunnelOptions> = {
},
};
-type RelaySettingsCustom = {
+// types describing the structure of RelaySettings
+export type RelaySettingsCustom = {
host: string,
tunnel: {
openvpn: {
@@ -58,20 +59,19 @@ type RelaySettingsCustom = {
}
}
};
-
-type RelaySettings = {
+export type RelaySettings = {|
normal: RelaySettingsNormal<TunnelOptions<OpenVpnParameters>>
-} | {
+|} | {|
custom_tunnel_endpoint: RelaySettingsCustom
-};
+|};
-export type RelaySettingsUpdate = {
- normal: $Shape<
- RelaySettingsNormal< TunnelOptions<$Shape<OpenVpnParameters> > >
- >
-} | {
+// types describing the partial update of RelaySettings
+export type RelaySettingsNormalUpdate = $Shape< RelaySettingsNormal< TunnelOptions<$Shape<OpenVpnParameters> > > >;
+export type RelaySettingsUpdate = {|
+ normal: RelaySettingsNormalUpdate
+|} | {|
custom_tunnel_endpoint: RelaySettingsCustom
-};
+|};
const Constraint = (v) => oneOf(string, object({
only: v,