From 011df4a9a1ae5af2fe4526d8cf577a46a0a5963a Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Tue, 16 Apr 2019 21:25:10 +0900
Subject: [PATCH] refs #850 Replace fonts with typescript
---
src/main/{fonts.js => fonts.ts} | 4 ++--
src/main/index.ts | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
rename src/main/{fonts.js => fonts.ts} (70%)
diff --git a/src/main/fonts.js b/src/main/fonts.ts
similarity index 70%
rename from src/main/fonts.js
rename to src/main/fonts.ts
index 03c977c6..345ca90b 100644
--- a/src/main/fonts.js
+++ b/src/main/fonts.ts
@@ -1,9 +1,9 @@
import SystemFonts from 'system-font-families'
-const fonts = () => {
+const fonts = async (): Promise> => {
const systemFonts = new SystemFonts()
return systemFonts.getFonts()
- .then(res => {
+ .then((res: string) => {
return Array.from(new Set(res)).sort()
})
}
diff --git a/src/main/index.ts b/src/main/index.ts
index 82e1f13a..66922c15 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -801,7 +801,7 @@ ipcMain.on('remove-hashtag', (event, tag) => {
})
// Fonts
-ipcMain.on('list-fonts', (event, _) => {
+ipcMain.on('list-fonts', (event: Event, _) => {
Fonts()
.then(list => {
event.sender.send('response-list-fonts', list)