From fe13c17fcba8f3507e58adfaac181f77a63518ab 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: Sun, 3 Feb 2019 23:41:05 +0900 Subject: [PATCH] Create type definition for 'langmap' (#4059) * Create type definition for 'langmap' * Follow lint --- src/@types/langmap.d.ts | 10 ++++++++++ src/server/api/endpoints/i/update.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 src/@types/langmap.d.ts diff --git a/src/@types/langmap.d.ts b/src/@types/langmap.d.ts new file mode 100644 index 0000000000..a0f99028ab --- /dev/null +++ b/src/@types/langmap.d.ts @@ -0,0 +1,10 @@ +declare module 'langmap' { + type Lang = { + nativeName: string; + englishName: string; + }; + + const langmap: { [lang: string]: Lang }; + + export = langmap; +} diff --git a/src/server/api/endpoints/i/update.ts b/src/server/api/endpoints/i/update.ts index 4b02e393bf..d087687a51 100644 --- a/src/server/api/endpoints/i/update.ts +++ b/src/server/api/endpoints/i/update.ts @@ -9,7 +9,7 @@ import getDriveFileUrl from '../../../../misc/get-drive-file-url'; import { parse, parsePlain } from '../../../../mfm/parse'; import extractEmojis from '../../../../misc/extract-emojis'; import extractHashtags from '../../../../misc/extract-hashtags'; -const langmap = require('langmap'); +import * as langmap from 'langmap'; export const meta = { desc: {