Create type definition for ./locales (#4117)

This commit is contained in:
Acid Chicken (硫酸鶏) 2019-02-04 01:46:59 +09:00 committed by GitHub
parent c4f7491322
commit 5891135ac1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

5
locales/index.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
type Locale = { [key: string]: string };
declare const locales: { [lang: string]: Locale };
export default locales;

View File

@ -16,7 +16,7 @@ import config from '../../config';
import { licenseHtml } from '../../misc/license'; import { licenseHtml } from '../../misc/license';
const constants = require('../../const.json'); const constants = require('../../const.json');
import endpoints from '../api/endpoints'; import endpoints from '../api/endpoints';
const locales = require('../../../locales'); import locales from '../../../locales';
import * as nestedProperty from 'nested-property'; import * as nestedProperty from 'nested-property';
function getLang(lang: string): string { function getLang(lang: string): string {