refs #850 Replace fonts with typescript

This commit is contained in:
AkiraFukushima 2019-04-16 21:25:10 +09:00
parent 6693efeb3b
commit 011df4a9a1
2 changed files with 3 additions and 3 deletions

View File

@ -1,9 +1,9 @@
import SystemFonts from 'system-font-families'
const fonts = () => {
const fonts = async (): Promise<Array<string>> => {
const systemFonts = new SystemFonts()
return systemFonts.getFonts()
.then(res => {
.then((res: string) => {
return Array.from(new Set(res)).sort()
})
}

View File

@ -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)