From 7781cc805df1dd1afb9e466dc991be863b2017bf Mon Sep 17 00:00:00 2001 From: John Livingston Date: Tue, 11 Jun 2024 12:28:08 +0200 Subject: [PATCH] Fix typing. --- client/common/lib/directives/translation.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/common/lib/directives/translation.ts b/client/common/lib/directives/translation.ts index cbf96064..83ea8623 100644 --- a/client/common/lib/directives/translation.ts +++ b/client/common/lib/directives/translation.ts @@ -2,6 +2,7 @@ // // SPDX-License-Identifier: AGPL-3.0-only +import type { TemplateResult } from 'lit' import { PartInfo, directive } from 'lit/directive.js' import { AsyncDirective } from 'lit/async-directive.js' import { RegisterClientHelpers } from '@peertube/peertube-types/client' @@ -41,7 +42,7 @@ export class TranslationDirective extends AsyncDirective { }) } - public override render = (locId: string, allowHTML: boolean = false): unknown => { + public override render = (locId: string, allowHTML: boolean = false): TemplateResult | string => { this._localizationId = locId // TODO Check current component for context (to infer the prefix) this._allowUnsafeHTML = allowHTML @@ -55,7 +56,7 @@ export class TranslationDirective extends AsyncDirective { return this._internalRender() } - private readonly _internalRender = (): unknown => { + private readonly _internalRender = (): TemplateResult | string => { return this._allowUnsafeHTML ? html`${unsafeHTML(this._translatedValue)}` : this._translatedValue }