s/@return/@returns

This commit is contained in:
Linus Groh
2020-01-26 00:38:36 +00:00
parent 85e51643bf
commit 0bd84f4de5
4 changed files with 15 additions and 15 deletions
+7 -7
View File
@@ -18,7 +18,7 @@ import { getApiUrl } from "@/util";
*
* @param {String} path API resource path
* @param {QueryParams} [params] Query parameters
* @return {Promise} Promise returned by the fetch function
* @returns {Promise} Promise returned by the fetch function
*/
const fetchApi = (path, params = {}) => {
const url = getApiUrl(path);
@@ -30,7 +30,7 @@ const fetchApi = (path, params = {}) => {
/**
* Get the recorder's version.
*
* @return {String} Version
* @returns {String} Version
*/
export const getVersion = async () => {
const response = await fetchApi("/api/0/version");
@@ -42,7 +42,7 @@ export const getVersion = async () => {
/**
* Get all users.
*
* @return {Array.<User>} Array of usernames
* @returns {Array.<User>} Array of usernames
*/
export const getUsers = async () => {
const response = await fetchApi("/api/0/list");
@@ -55,7 +55,7 @@ export const getUsers = async () => {
* Get all devices for the provided users.
*
* @param {Array.<User>} users Array of usernames
* @return {Object.<User, Array.<Device>>} Object mapping each username to an array of device names
* @returns {Object.<User, Array.<Device>>} Object mapping each username to an array of device names
*/
export const getDevices = async users => {
const devices = {};
@@ -75,7 +75,7 @@ export const getDevices = async users => {
*
* @param {User} [user] Get last locations of all devices from this user
* @param {Device} [device] Get last location of specific device
* @return {Array.<LastLocation>} Array of last location objects
* @returns {Array.<LastLocation>} Array of last location objects
*/
export const getLastLocations = async (user, device) => {
const params = {};
@@ -97,7 +97,7 @@ export const getLastLocations = async (user, device) => {
* @param {Device} device Device name
* @param {String} start Start date and time in UTC
* @param {String} end End date and time in UTC
* @return {LocationHistory} Array of location history objects
* @returns {LocationHistory} Array of location history objects
*/
export const getUserDeviceLocationHistory = async (
user,
@@ -122,7 +122,7 @@ export const getUserDeviceLocationHistory = async (
* @param {Object.<User, Array.<Device>>} devices Devices of which the history should be fetched
* @param {String} start Start date and time in UTC
* @param {String} end End date and time in UTC
* @return {Object.<User, Object.<Device, LocationHistory>>} Array of location history objects
* @returns {Object.<User, Object.<Device, LocationHistory>>} Array of location history objects
*/
export const getLocationHistory = async (devices, start, end) => {
const locationHistory = {};
+2 -2
View File
@@ -128,7 +128,7 @@ export default {
/**
* Return the face image as a data URI string which can be used for an image's src attribute.
*
* @return {String} base64-encoded face image data URI
* @returns {String} base64-encoded face image data URI
*/
faceImageDataURI() {
return `data:image/png;base64,${this.face}`;
@@ -136,7 +136,7 @@ export default {
/**
* Return the device name for displaying with <user identifier>/<device identifier> as fallback.
*
* @return {String} device name for displaying
* @returns {String} device name for displaying
*/
deviceName() {
return this.name ? this.name : `${this.user}/${this.device}`;
+2 -2
View File
@@ -13,7 +13,7 @@ import { distanceBetweenCoordinates } from "@/util";
*
* @param {State} state
* @param {MultiLocationHistory} state.locationHistory Location history of selected users and devices
* @return {Array.<L.LatLng>} All coordinates
* @returns {Array.<L.LatLng>} All coordinates
*/
const locationHistoryLatLngs = state => {
const latLngs = [];
@@ -34,7 +34,7 @@ const locationHistoryLatLngs = state => {
*
* @param {State} state
* @param {MultiLocationHistory} state.locationHistory Location history of selected users and devices
* @return {Array.<Array.<L.LatLng>>} Groups of coherent coordinates
* @returns {Array.<Array.<L.LatLng>>} Groups of coherent coordinates
*/
const locationHistoryLatLngGroups = state => {
const groups = [];
+4 -4
View File
@@ -10,7 +10,7 @@ import { DATE_TIME_FORMAT, EARTH_RADIUS_IN_KM } from "@/constants";
* base URL configuration into account.
*
* @param {String} path Path to the API resource
* @return {URL} Final API URL
* @returns {URL} Final API URL
*/
export const getApiUrl = path => {
const normalizedBaseUrl = config.api.baseUrl.endsWith("/")
@@ -24,7 +24,7 @@ export const getApiUrl = path => {
* Check if the given string is an ISO 8601 YYYY-MM-DDTHH:MM:SS datetime.
*
* @param {String} s Input value to be tested
* @return {Boolean} Whether the input matches the expected format
* @returns {Boolean} Whether the input matches the expected format
*/
export const isIsoDateTime = s => moment(s, DATE_TIME_FORMAT, true).isValid();
@@ -32,7 +32,7 @@ export const isIsoDateTime = s => moment(s, DATE_TIME_FORMAT, true).isValid();
* Convert degrees to radians.
*
* @param {Number} degrees Angle in degrees
* @return {Number} Angle in radians
* @returns {Number} Angle in radians
*/
export const degreesToRadians = degrees => (degrees * Math.PI) / 180;
@@ -44,7 +44,7 @@ export const degreesToRadians = degrees => (degrees * Math.PI) / 180;
*
* @param {Coordinate} c1 First coordinate
* @param {Coordinate} c2 Second coordinate
* @return {Number} Distance in meters
* @returns {Number} Distance in meters
*/
export const distanceBetweenCoordinates = (c1, c2) => {
const r = EARTH_RADIUS_IN_KM * 1000;