🔨 Refactor: change vue-js -> vue-ts && add typos

This commit is contained in:
Molunerfinn
2019-12-21 17:28:29 +08:00
parent 29a55ed855
commit b8ec879e23
21 changed files with 333 additions and 300 deletions

View File

@@ -12,13 +12,13 @@ const getPicBeds = (app: App) => {
const picBedTypes = picgo.helper.uploader.getIdList()
const picBedFromDB = db.get('picBed.list') || []
const picBeds = picBedTypes.map((item: string) => {
const visible = picBedFromDB.find((i: PicBedType) => i.type === item) // object or undefined
const visible = picBedFromDB.find((i: IPicBedType) => i.type === item) // object or undefined
return {
type: item,
name: picgo.helper.uploader.get(item).name || item,
visible: visible ? visible.visible : true
}
}) as PicBedType[]
}) as IPicBedType[]
picgo.cmd.program.removeAllListeners()
return picBeds
}

View File

@@ -24,7 +24,7 @@ const shortKeyHandler = (name: string) => {
/**
* 用于更新快捷键绑定
*/
const shortKeyUpdater = (globalShortcut: GlobalShortcut, item: ShortKeyConfig, oldKey: string) => {
const shortKeyUpdater = (globalShortcut: GlobalShortcut, item: IShortKeyConfig, oldKey: string) => {
// 如果提供了旧key则解绑
if (oldKey) {
globalShortcut.unregister(oldKey)
@@ -39,7 +39,7 @@ const shortKeyUpdater = (globalShortcut: GlobalShortcut, item: ShortKeyConfig, o
}
// 初始化阶段的注册
const initShortKeyRegister = (globalShortcut: GlobalShortcut, shortKeys: ShortKeyConfig[]) => {
const initShortKeyRegister = (globalShortcut: GlobalShortcut, shortKeys: IShortKeyConfig[]) => {
let errorList = []
for (let i in shortKeys) {
try {

View File

@@ -36,7 +36,7 @@ const renameURL = process.env.NODE_ENV === 'development'
// }
const createRenameWindow = (win: BrowserWindow) => {
let options: BrowserWindowOptions = {
let options: IBrowserWindowOptions = {
height: 175,
width: 300,
show: true,