summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@codeispoetry.ru>2017-03-10 14:09:26 +0000
committerAndrej Mihajlov <and@codeispoetry.ru>2017-03-10 14:09:26 +0000
commit767148f976f942bb68d4bc6c4d09b076aa6e39e0 (patch)
treeded2073ba040fdf4cfa32c24757408c5de540517
parentfcb95d50305c99368e2a19627ca1306a93888912 (diff)
downloadmullvadvpn-767148f976f942bb68d4bc6c4d09b076aa6e39e0.tar.xz
mullvadvpn-767148f976f942bb68d4bc6c4d09b076aa6e39e0.zip
Update documentation
-rw-r--r--.esdoc.json8
-rw-r--r--app/components/Layout.js21
-rw-r--r--app/enums.js17
-rw-r--r--app/lib/enum.js7
4 files changed, 53 insertions, 0 deletions
diff --git a/.esdoc.json b/.esdoc.json
index 921a7884dd..69b8c8ba76 100644
--- a/.esdoc.json
+++ b/.esdoc.json
@@ -1,6 +1,14 @@
{
+ "title": "Mullvad VPN",
+ "lint": true,
+ "coverage": true,
+ "includeSource": true,
"source": "./app",
"destination": "./docs",
+ "test": {
+ "type": "mocha",
+ "source": "./test"
+ },
"experimentalProposal": {
"classProperties": true,
"objectRestSpread": true,
diff --git a/app/components/Layout.js b/app/components/Layout.js
index c4e66aed85..51215fe489 100644
--- a/app/components/Layout.js
+++ b/app/components/Layout.js
@@ -1,6 +1,13 @@
import React, { PropTypes, Component } from 'react';
import HeaderBar from './HeaderBar';
+/**
+ * Layout header
+ *
+ * @export
+ * @class Header
+ * @extends {Component}
+ */
export class Header extends Component {
static Style = HeaderBar.Style
@@ -14,6 +21,13 @@ export class Header extends Component {
}
}
+/**
+ * Content container
+ *
+ * @export
+ * @class Container
+ * @extends {Component}
+ */
export class Container extends Component {
static propTypes = {
children: PropTypes.element.isRequired
@@ -28,6 +42,13 @@ export class Container extends Component {
}
}
+/**
+ * Layout container
+ *
+ * @export
+ * @class Layout
+ * @extends {Component}
+ */
export class Layout extends Component {
static propTypes = {
children: PropTypes.oneOfType([
diff --git a/app/enums.js b/app/enums.js
index 87181f9525..b6ed213c57 100644
--- a/app/enums.js
+++ b/app/enums.js
@@ -1,4 +1,21 @@
import Enum from './lib/enum';
+/**
+ * Login state enum used for React components
+ * @type {enum}
+ * @property {string} none Initial state (not logged in)
+ * @property {string} connecting Attempting to log in
+ * @property {string} failed Failed to log in
+ * @property {string} ok Logged in
+ */
export const LoginState = Enum('none', 'connecting', 'failed', 'ok');
+
+/**
+ * Connection state enum used for React components
+ * @type {enum}
+ * @property {string} disconnected Initial state (disconnected)
+ * @property {string} connecting Connecting
+ * @property {string} connected Connected
+ * @property {string} failed Failed to connect
+ */
export const ConnectionState = Enum('disconnected', 'connecting', 'connected', 'failed');
diff --git a/app/lib/enum.js b/app/lib/enum.js
index 0655fc4288..1815a551f7 100644
--- a/app/lib/enum.js
+++ b/app/lib/enum.js
@@ -1,5 +1,12 @@
/**
* Creates enum object with keys provided as arguments
+ *
+ * @constructor
+ * @type Enum
+ * @property {bool} isValid({string}) whether key is valid
+ * @param {...string} ... Enum keys
+ * @export
+ * @returns Enum
*/
export default function Enum() {
let object = Object.create({});