From 58952274d280ab50889b79a1fa058d04f22d9251 Mon Sep 17 00:00:00 2001 From: DigiLive Date: Sat, 5 Apr 2025 11:18:24 +0200 Subject: [PATCH] Fix typo in JSDOC --- src/cards/AbstractCard.ts | 4 ++-- src/cards/ControllerCard.ts | 6 +++--- src/localize.ts | 8 ++++---- src/views/AbstractView.ts | 4 ++-- src/views/HomeView.ts | 8 ++++---- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/cards/AbstractCard.ts b/src/cards/AbstractCard.ts index 3337c75..c5524ad 100644 --- a/src/cards/AbstractCard.ts +++ b/src/cards/AbstractCard.ts @@ -1,7 +1,7 @@ import {Helper} from "../Helper"; +import {EntityCardConfig} from "../types/lovelace-mushroom/cards/entity-card-config"; import {cards} from "../types/strategy/cards"; import {generic} from "../types/strategy/generic"; -import {EntityCardConfig} from "../types/lovelace-mushroom/cards/entity-card-config"; /** * Abstract Card Class @@ -46,7 +46,7 @@ abstract class AbstractCard { /** * Get a card. * - * @return {cards.AbstractCardConfig} A card object. + * @returns {cards.AbstractCardConfig} A card object. */ getCard(): cards.AbstractCardConfig { return { diff --git a/src/cards/ControllerCard.ts b/src/cards/ControllerCard.ts index b33878c..e85aad0 100644 --- a/src/cards/ControllerCard.ts +++ b/src/cards/ControllerCard.ts @@ -1,7 +1,7 @@ -import {cards} from "../types/strategy/cards"; -import {LovelaceCardConfig} from "../types/homeassistant/data/lovelace"; import {HassServiceTarget} from "home-assistant-js-websocket"; +import {LovelaceCardConfig} from "../types/homeassistant/data/lovelace"; import {StackCardConfig} from "../types/homeassistant/panels/lovelace/cards/types"; +import {cards} from "../types/strategy/cards"; /** * Controller Card class. @@ -49,7 +49,7 @@ class ControllerCard { /** * Create a Controller card. * - * @return {StackCardConfig} A Controller card. + * @returns {StackCardConfig} A Controller card. */ createCard(): StackCardConfig { const cards: LovelaceCardConfig[] = [ diff --git a/src/localize.ts b/src/localize.ts index f1ada3a..ccf7471 100644 --- a/src/localize.ts +++ b/src/localize.ts @@ -1,8 +1,8 @@ -import {HomeAssistant} from "./types/homeassistant/types"; +import * as de from "./translations/de.json"; import * as en from "./translations/en.json"; import * as es from "./translations/es.json"; import * as nl from "./translations/nl.json"; -import * as de from "./translations/de.json"; +import {HomeAssistant} from "./types/homeassistant/types"; /* Registry of currently supported languages */ const languages: Record = { @@ -21,7 +21,7 @@ const DEFAULT_LANG = "en"; * @param {string} key The keyword to look for in object notation (E.g. generic.home). * @param {string} lang The language to get the string from (E.g. en). * - * @return {string | undefined} The requested string or undefined if the keyword doesn't exist/on error. + * @returns {string | undefined} The requested string or undefined if the keyword doesn't exist/on error. */ function getTranslatedString(key: string, lang: string): string | undefined { try { @@ -46,7 +46,7 @@ function getTranslatedString(key: string, lang: string): string | undefined { * If the keyword is undefined, or on error, the keyword itself is returned. * * @param {HomeAssistant} hass The Home Assistant object. - * @return {(key: string) => string} The function to call for translating strings. + * @returns {(key: string) => string} The function to call for translating strings. */ export default function setupCustomLocalize(hass?: HomeAssistant): (key: string) => string { return function (key: string) { diff --git a/src/views/AbstractView.ts b/src/views/AbstractView.ts index a252f81..28e7d13 100644 --- a/src/views/AbstractView.ts +++ b/src/views/AbstractView.ts @@ -68,7 +68,7 @@ abstract class AbstractView { /** * Create the cards to include in the view. * - * @return {Promise<(StackCardConfig | TitleCardConfig)[]>} An array of card objects. + * @returns {Promise<(StackCardConfig | TitleCardConfig)[]>} An array of card objects. */ async createViewCards(): Promise<(StackCardConfig | TitleCardConfig)[]> { if (this.#domain === "home") { @@ -154,7 +154,7 @@ abstract class AbstractView { * Get a target of entity IDs for the given domain. * * @param {string} domain - The target domain to retrieve entity IDs from. - * @return {HassServiceTarget} - A target for a service call. + * @returns {HassServiceTarget} - A target for a service call. */ targetDomain(domain: string): HassServiceTarget { return { diff --git a/src/views/HomeView.ts b/src/views/HomeView.ts index 2106f71..38bf83c 100644 --- a/src/views/HomeView.ts +++ b/src/views/HomeView.ts @@ -49,7 +49,7 @@ class HomeView extends AbstractView { /** * Create the cards to include in the view. * - * @return {Promise<(StackCardConfig | TemplateCardConfig | ChipsCardConfig)[]>} Promise a View Card array. + * @returns {Promise<(StackCardConfig | TemplateCardConfig | ChipsCardConfig)[]>} Promise a View Card array. * @override */ async createViewCards(): Promise<(StackCardConfig | TemplateCardConfig | ChipsCardConfig)[]> { @@ -123,7 +123,7 @@ class HomeView extends AbstractView { /** * Create the chips to include in the view. * - * @return {Promise} Promise a chip array. + * @returns {Promise} Promise a chip array. */ async #createChips(): Promise { if ((Helper.strategyOptions.home_view.hidden as string[]).includes("chips")) { @@ -185,7 +185,7 @@ class HomeView extends AbstractView { /** * Create the person cards to include in the view. * - * @return {PersonCardConfig[]} A Person Card array. + * @returns {PersonCardConfig[]} A Person Card array. */ #createPersonCards(): PersonCardConfig[] { if ((Helper.strategyOptions.home_view.hidden as string[]).includes("persons")) { @@ -214,7 +214,7 @@ class HomeView extends AbstractView { * * Area cards are grouped into two areas per row. * - * @return {Promise<(TitleCardConfig | StackCardConfig)[]>} Promise an Area Card Section. + * @returns {Promise<(TitleCardConfig | StackCardConfig)[]>} Promise an Area Card Section. */ async #createAreaSection(): Promise<(TitleCardConfig | StackCardConfig)[]> { if ((Helper.strategyOptions.home_view.hidden as string[]).includes("areas")) {