Fix localize lite mixin types (#2613)

This commit is contained in:
Paulus Schoutsen 2019-01-28 15:43:08 -08:00 committed by GitHub
parent fd4ede39ba
commit 5a797a6dec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -61,7 +61,7 @@ class HaAuthorize extends litLocalizeLiteMixin(LitElement) {
// So we sanitize the translation with innerText and then inject
// the name with a bold tag.
const loggingInWith = document.createElement("div");
loggingInWith.innerText = this.hass!.localize(
loggingInWith.innerText = this.localize(
"ui.panel.page-authorize.logging_in_with",
"authProviderName",
"NAME"
@ -78,7 +78,7 @@ class HaAuthorize extends litLocalizeLiteMixin(LitElement) {
return html`
${this.renderStyle()}
<p>
${this.hass!.localize(
${this.localize(
"ui.panel.page-authorize.authorizing_client",
"clientId",
this.clientId

View File

@ -6,8 +6,7 @@ import {
} from "lit-element";
import { getActiveTranslation } from "../util/hass-translation";
import { localizeLiteBaseMixin } from "./localize-lite-base-mixin";
import { computeLocalize } from "../common/translations/localize";
import { LocalizeMixin } from "../types";
import { computeLocalize, LocalizeFunc } from "../common/translations/localize";
const empty = () => "";
@ -15,11 +14,12 @@ interface LitLocalizeLiteMixin {
language: string;
resources: {};
translationFragment: string;
localize: LocalizeFunc;
}
export const litLocalizeLiteMixin = <T extends LitElement>(
superClass: Constructor<T>
): Constructor<T & LocalizeMixin & LitLocalizeLiteMixin> =>
): Constructor<T & LitLocalizeLiteMixin> =>
// @ts-ignore
class extends localizeLiteBaseMixin(superClass) {
static get properties(): PropertyDeclarations {