fix(frontend-shared): fix type error
This commit is contained in:
parent
3dc0b766d4
commit
d91f3b269f
|
@ -3,6 +3,8 @@
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import type { Locale } from '../../../locales/index.js';
|
||||||
|
|
||||||
const address = new URL(document.querySelector<HTMLMetaElement>('meta[property="instance_url"]')?.content || location.href);
|
const address = new URL(document.querySelector<HTMLMetaElement>('meta[property="instance_url"]')?.content || location.href);
|
||||||
const siteName = document.querySelector<HTMLMetaElement>('meta[property="og:site_name"]')?.content;
|
const siteName = document.querySelector<HTMLMetaElement>('meta[property="og:site_name"]')?.content;
|
||||||
|
|
||||||
|
@ -14,12 +16,12 @@ export const wsOrigin = location.origin;
|
||||||
export const lang = localStorage.getItem('lang') ?? 'en-US';
|
export const lang = localStorage.getItem('lang') ?? 'en-US';
|
||||||
export const langs = _LANGS_;
|
export const langs = _LANGS_;
|
||||||
const preParseLocale = localStorage.getItem('locale');
|
const preParseLocale = localStorage.getItem('locale');
|
||||||
export let locale = preParseLocale ? JSON.parse(preParseLocale) : null;
|
export let locale: Locale = preParseLocale ? JSON.parse(preParseLocale) : null;
|
||||||
export const version = _VERSION_;
|
export const version = _VERSION_;
|
||||||
export const instanceName = siteName === 'Misskey' || siteName == null ? host : siteName;
|
export const instanceName = siteName === 'Misskey' || siteName == null ? host : siteName;
|
||||||
export const ui = localStorage.getItem('ui');
|
export const ui = localStorage.getItem('ui');
|
||||||
export const debug = localStorage.getItem('debug') === 'true';
|
export const debug = localStorage.getItem('debug') === 'true';
|
||||||
|
|
||||||
export function updateLocale(newLocale): void {
|
export function updateLocale(newLocale: Locale): void {
|
||||||
locale = newLocale;
|
locale = newLocale;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,11 @@
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"noImplicitReturns": true,
|
"noImplicitReturns": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
|
"baseUrl": ".",
|
||||||
|
"paths": {
|
||||||
|
"@/*": ["./*"],
|
||||||
|
"@@/*": ["./*"]
|
||||||
|
},
|
||||||
"typeRoots": [
|
"typeRoots": [
|
||||||
"./@types",
|
"./@types",
|
||||||
"./node_modules/@types"
|
"./node_modules/@types"
|
||||||
|
@ -26,6 +31,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
|
"@types/**/*.ts",
|
||||||
"js/**/*"
|
"js/**/*"
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
|
|
Loading…
Reference in New Issue