Skip to content

Commit

Permalink
[web] Import types
Browse files Browse the repository at this point in the history
  • Loading branch information
joseivanlopez committed Mar 1, 2024
1 parent e3aabaa commit cdfd4c0
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions web/src/components/storage/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ import xbytes from "xbytes";

import { N_ } from "~/i18n";

/**
* @typedef {import ("~/client/storage").Volume} Volume
* @typedef {import ("~/clients/storage").StorageDevice} StorageDevice
*/

/**
* @typedef {Object} SizeObject
*
Expand Down Expand Up @@ -125,7 +130,7 @@ const parseToBytes = (size) => {
/**
* Generates the label for the given device
*
* @param {import(~/clients/storage).StorageDevice} device
* @param {StorageDevice} device
* @returns {string}
*/
const deviceLabel = (device) => {
Expand All @@ -139,7 +144,7 @@ const deviceLabel = (device) => {
* Checks if volume uses given fs. This method works same as in backend
* case insensitive.
*
* @param {import(~/clients/storage).Volume} volume
* @param {Volume} volume
* @param {string} fs - Filesystem name to check.
* @returns {boolean} true when volume uses given fs
*/
Expand All @@ -152,7 +157,7 @@ const hasFS = (volume, fs) => {
/**
* Checks whether the given volume has snapshots.
*
* @param {import(~/clients/storage).Volume} volume
* @param {Volume} volume
* @returns {boolean}
*/
const hasSnapshots = (volume) => {
Expand All @@ -162,7 +167,7 @@ const hasSnapshots = (volume) => {
/**
* Checks whether the given volume defines a transactional root.
*
* @param {import(~/clients/storage).Volume} volume
* @param {Volume} volume
* @returns {boolean}
*/
const isTransactionalRoot = (volume) => {
Expand All @@ -172,7 +177,7 @@ const isTransactionalRoot = (volume) => {
/**
* Checks whether the given volumes defines a transactional system.
*
* @param {import(~/clients/storage).Volume[]} volumes
* @param {Volume[]} volumes
* @returns {boolean}
*/
const isTransactionalSystem = (volumes) => {
Expand Down

0 comments on commit cdfd4c0

Please sign in to comment.