1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

docs: fix documentation for TypeScript

This commit is contained in:
Dmitry Lyzo 2022-02-19 12:43:11 +03:00
parent 7ed78e0daa
commit 85e9aff281
2 changed files with 14 additions and 6 deletions

View file

@ -481,12 +481,20 @@ import ServerConnections from '../ServerConnections';
return null; return null;
} }
/**
* @typedef {Object} CardImageUrl
* @property {string} imgUrl - Image URL.
* @property {string} blurhash - Image blurhash.
* @property {boolean} forceName - Force name.
* @property {boolean} coverImage - Use cover style.
*/
/** Get the URL of the card's image. /** Get the URL of the card's image.
* @param {Object} item - Item for which to generate a card. * @param {Object} item - Item for which to generate a card.
* @param {Object} apiClient - API client object. * @param {Object} apiClient - API client object.
* @param {Object} options - Options of the card. * @param {Object} options - Options of the card.
* @param {string} shape - Shape of the desired image. * @param {string} shape - Shape of the desired image.
* @returns {Object} Object representing the URL of the card's image. * @returns {CardImageUrl} Object representing the URL of the card's image.
*/ */
function getCardImageUrl(item, apiClient, options, shape) { function getCardImageUrl(item, apiClient, options, shape) {
item = item.ProgramInfo || item; item = item.ProgramInfo || item;
@ -639,7 +647,7 @@ import ServerConnections from '../ServerConnections';
/** /**
* Generates an index used to select the default color of a card based on a string. * Generates an index used to select the default color of a card based on a string.
* @param {string} str - String to use for generating the index. * @param {?string} [str] - String to use for generating the index.
* @returns {number} Index of the color. * @returns {number} Index of the color.
*/ */
function getDefaultColorIndex(str) { function getDefaultColorIndex(str) {
@ -726,8 +734,8 @@ import ServerConnections from '../ServerConnections';
/** /**
* Returns the air time text for the item based on the given times. * Returns the air time text for the item based on the given times.
* @param {object} item - Item used to generate the air time text. * @param {object} item - Item used to generate the air time text.
* @param {string} showAirDateTime - ISO8601 date for the start of the show. * @param {boolean} showAirDateTime - ISO8601 date for the start of the show.
* @param {string} showAirEndTime - ISO8601 date for the end of the show. * @param {boolean} showAirEndTime - ISO8601 date for the end of the show.
* @returns {string} The air time text for the item based on the given dates. * @returns {string} The air time text for the item based on the given dates.
*/ */
function getAirTimeText(item, showAirDateTime, showAirEndTime) { function getAirTimeText(item, showAirDateTime, showAirEndTime) {
@ -1129,7 +1137,7 @@ import ServerConnections from '../ServerConnections';
/** /**
* Returns the default background class for a card based on a string. * Returns the default background class for a card based on a string.
* @param {string} str - Text used to generate the background class. * @param {?string} [str] - Text used to generate the background class.
* @returns {string} CSS classes for default card backgrounds. * @returns {string} CSS classes for default card backgrounds.
*/ */
export function getDefaultBackgroundClass(str) { export function getDefaultBackgroundClass(str) {

View file

@ -9,7 +9,7 @@
* Returns parent of element with specified attribute value. * Returns parent of element with specified attribute value.
* @param {HTMLElement} elem - Element whose parent need to find. * @param {HTMLElement} elem - Element whose parent need to find.
* @param {string} name - Attribute name. * @param {string} name - Attribute name.
* @param {mixed} value - Attribute value. * @param {mixed} [value] - Attribute value.
* @returns {HTMLElement} Parent with specified attribute value. * @returns {HTMLElement} Parent with specified attribute value.
*/ */
export function parentWithAttribute(elem, name, value) { export function parentWithAttribute(elem, name, value) {