From c8776e53a804c1eb268fef1e8d21b13de1a9ce2a Mon Sep 17 00:00:00 2001 From: Vasilii Sorokin Date: Fri, 16 Feb 2024 19:36:09 +0300 Subject: [PATCH] fix localize func typing --- src/compute-state-display.ts | 5 ++--- src/translations/localize.ts | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/compute-state-display.ts b/src/compute-state-display.ts index 622762f..3fc70a1 100644 --- a/src/compute-state-display.ts +++ b/src/compute-state-display.ts @@ -2,9 +2,8 @@ import { HassEntity } from "home-assistant-js-websocket"; import { formatDateTime } from "./datetime/format_date_time"; import { formatDate } from "./datetime/format_date"; import { formatTime } from "./datetime/format_time"; -import { LocalizeFunc } from "./translations/localize"; import { computeStateDomain } from "./compute-state-domain"; -import { FrontendLocaleData } from "./types"; +import { FrontendLocaleData, LocalizeFunc } from "./types"; import { formatNumber, isNumericState } from "./format-number"; export const computeStateDisplay = ( @@ -126,4 +125,4 @@ export const computeStateDisplay = ( // We don't know! Return the raw state. compareState ); -}; \ No newline at end of file +}; diff --git a/src/translations/localize.ts b/src/translations/localize.ts index 83312eb..64d6470 100644 --- a/src/translations/localize.ts +++ b/src/translations/localize.ts @@ -1,9 +1,7 @@ //REF: https://github.com/home-assistant/frontend/blob/dev/src/common/translations/localize.ts import IntlMessageFormat from "intl-messageformat"; -import { Resources } from "../types"; - -export type LocalizeFunc = (key: string, ...args: any[]) => string; +import { LocalizeFunc, Resources } from "../types"; interface FormatType { [format: string]: any;