📦 Chore: types change

This commit is contained in:
PiEgg
2022-01-08 15:44:09 +08:00
parent f3ec0cb4be
commit 43d2a8e5c8
22 changed files with 41 additions and 56 deletions

View File

@@ -1,9 +1,6 @@
import {
BrowserWindow
} from 'electron'
import {
IWindowList
} from 'apis/app/window/constants'
// https://stackoverflow.com/questions/45420448/how-to-import-external-type-into-global-d-ts-file
declare type BrowserWindow = import('electron').BrowserWindow
declare type IWindowList = import('./enum').IWindowList
declare interface IWindowListItem {
isValid: boolean
@@ -20,10 +17,3 @@ declare interface IWindowManager {
deleteById: (id: number) => void
getAvailableWindow: () => BrowserWindow
}
// https://stackoverflow.com/questions/35074713/extending-typescript-global-object-in-node-js/44387594#44387594
declare global {
var PICGO_GUI_VERSION: string
var PICGO_CORE_VERSION: string
var notificationList: IAppNotification[]
}

View File

@@ -20,3 +20,10 @@ export enum IPasteStyle {
UBB = 'UBB',
CUSTOM = 'Custom'
}
export enum IWindowList {
SETTING_WINDOW = 'SETTING_WINDOW',
TRAY_WINDOW = 'TRAY_WINDOW',
MINI_WINDOW = 'MINI_WINDOW',
RENAME_WINDOW = 'RENAME_WINDOW'
}

5
src/universal/types/global.d.ts vendored Normal file
View File

@@ -0,0 +1,5 @@
// https://stackoverflow.com/questions/35074713/extending-typescript-global-object-in-node-js/44387594#44387594
declare var PICGO_GUI_VERSION: string
declare var PICGO_CORE_VERSION: string
declare var notificationList: IAppNotification[]

View File

@@ -1,2 +0,0 @@
import PicGoCore from 'picgo'
export default PicGoCore

View File

@@ -122,7 +122,7 @@ interface IBounds {
}
// PicGo Types
type ICtx = import('picgo')
type ICtx = import('picgo').PicGo
interface IPicGoPlugin {
name: string
fullName: string