Create type definition for '*/const.json' (#4118)

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

3
src/@types/const.json.d.ts vendored Normal file
View file

@ -0,0 +1,3 @@
declare module '*/const.json' {
const copyright: string;
}

View file

@ -14,7 +14,7 @@ import * as glob from 'glob';
import * as yaml from 'js-yaml'; import * as yaml from 'js-yaml';
import config from '../../config'; import config from '../../config';
import { licenseHtml } from '../../misc/license'; import { licenseHtml } from '../../misc/license';
const constants = require('../../const.json'); import { copyright } from '../../const.json';
import endpoints from '../api/endpoints'; import endpoints from '../api/endpoints';
import locales from '../../../locales'; import locales from '../../../locales';
import * as nestedProperty from 'nested-property'; import * as nestedProperty from 'nested-property';
@ -59,7 +59,7 @@ async function genVars(lang: string): Promise<{ [key: string]: any }> {
vars['config'] = config; vars['config'] = config;
vars['copyright'] = constants.copyright; vars['copyright'] = copyright;
vars['license'] = licenseHtml; vars['license'] = licenseHtml;