From 97db2968871f2e70397f4c7324c0318315a663c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Mon, 4 Feb 2019 01:46:59 +0900 Subject: [PATCH] Create type definition for ./locales (#4117) --- locales/index.d.ts | 5 +++++ src/server/web/docs.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 locales/index.d.ts diff --git a/locales/index.d.ts b/locales/index.d.ts new file mode 100644 index 000000000..4a9672c63 --- /dev/null +++ b/locales/index.d.ts @@ -0,0 +1,5 @@ +type Locale = { [key: string]: string }; + +declare const locales: { [lang: string]: Locale }; + +export default locales; diff --git a/src/server/web/docs.ts b/src/server/web/docs.ts index f823c308c..1455abae7 100644 --- a/src/server/web/docs.ts +++ b/src/server/web/docs.ts @@ -16,7 +16,7 @@ import config from '../../config'; import { licenseHtml } from '../../misc/license'; const constants = require('../../const.json'); import endpoints from '../api/endpoints'; -const locales = require('../../../locales'); +import locales from '../../../locales'; import * as nestedProperty from 'nested-property'; function getLang(lang: string): string {