🔨 Refactor(custom): change type defination in universal to global

This commit is contained in:
Kuingsmile
2026-01-01 09:10:43 +08:00
parent 8a4e4d02eb
commit 5ea2517460
125 changed files with 200 additions and 440 deletions

View File

@@ -6,7 +6,6 @@ import { app, clipboard, dialog, shell } from 'electron'
import fs from 'fs-extra'
import { gte, lte } from 'semver'
import type { IRemoteNotice, IRemoteNoticeAction, IRemoteNoticeLocalCountStorage } from '#/types/types'
import { showNotification } from '~/utils/common'
import { IRemoteNoticeActionType, IRemoteNoticeTriggerCount } from '~/utils/enum'

View File

@@ -6,13 +6,6 @@ import shortKeyService from 'apis/app/shortKey/shortKeyService'
import GuiApi from 'apis/gui'
import { globalShortcut } from 'electron'
import type {
IKeyCommandType,
IPluginShortKeyConfig,
IShortKeyConfig,
IShortKeyConfigs,
IShortKeyHandler,
} from '#/types/types'
import { TOGGLE_SHORTKEY_MODIFIED_MODE } from '~/events/constant'
import { configPaths } from '~/utils/configPaths'

View File

@@ -1,7 +1,5 @@
import logger from '@core/picgo/logger'
import type { IShortKeyHandler } from '#/types/types'
class ShortKeyService {
private commandList = new Map<string, IShortKeyHandler>()
registerCommand(command: string, handler: IShortKeyHandler) {

View File

@@ -18,7 +18,6 @@ import fs from 'fs-extra'
import { cloneDeep } from 'lodash-es'
import pkg from 'root/package.json'
import type { IBounds, ImgInfo } from '#/types/types'
import { buildPicBedListMenu } from '~/events/remotes/menu'
import { T as $t } from '~/i18n'
import clipboardPoll from '~/utils/clipboardPoll'

View File

@@ -7,7 +7,6 @@ import fs from 'fs-extra'
import { cloneDeep } from 'lodash-es'
import type { IPicGo } from 'piclist'
import type { IFileWithPath, ImgInfo, IStringKeyMap, IUploadOption } from '#/types/types'
import { T as $t } from '~/i18n/index'
import { handleCopyUrl, handleUrlEncodeWithSetting } from '~/utils/common'
import { configPaths } from '~/utils/configPaths'

View File

@@ -11,7 +11,6 @@ import fs from 'fs-extra'
import type { IPicGo } from 'piclist'
import writeFile from 'write-file-atomic'
import type { ImgInfo, IUploadOption } from '#/types/types'
import { GET_RENAME_FILE_NAME, RENAME_FILE_NAME } from '~/events/constant'
import { T as $t } from '~/i18n'
import { getClipboardFilePath, showNotification } from '~/utils/common'

View File

@@ -6,8 +6,6 @@ import { CREATE_APP_MENU } from '@core/bus/constants'
import db from '@core/datastore'
import { app, BrowserWindow, Rectangle } from 'electron'
import type { IWindowListItem } from '#/types/electron'
import type { IBrowserWindowOptions } from '#/types/types'
import { TOGGLE_SHORTKEY_MODIFIED_MODE } from '~/events/constant'
import { T as $t } from '~/i18n'
import { configPaths } from '~/utils/configPaths'

View File

@@ -1,7 +1,6 @@
import windowList from 'apis/app/window/windowList'
import { BrowserWindow } from 'electron'
import type { IWindowListItem, IWindowManager } from '#/types/electron'
import { IWindowList } from '~/utils/enum'
class WindowManager implements IWindowManager {

View File

@@ -10,8 +10,6 @@ import {
} from '@core/bus/constants'
import bus from '@core/bus/index'
import type { IFileWithPath } from '#/types/types'
export const uploadWithClipboardFiles = (): Promise<{
success: boolean
result?: string[]

View File

@@ -4,8 +4,6 @@ import { debounce } from 'lodash-es'
import { PicGo } from 'piclist'
import pkg from 'root/package.json'
import type { IStringKeyMap } from '#/types/types'
const CONFIG_PATH = dbPathChecker()
dbChecker()

View File

@@ -3,8 +3,6 @@ import util from 'node:util'
import dayjs from 'dayjs'
import fs from 'fs-extra'
import type { ILogArgvTypeWithError } from '#/types/types'
const MB = 1024 * 1024
const DEFAULT_LOG_FILE_SIZE_LIMIT = 10 * MB

View File

@@ -1,6 +1,5 @@
import OSS from 'ali-oss'
import type { IAliYunConfig, PartialKeys } from '#/types/types'
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
interface IConfigMap {

View File

@@ -1,4 +1,3 @@
import type { IStringKeyMap } from '#/types/types'
import AlistApi from '~/apis/delete/alist'
import AlistplistApi from '~/apis/delete/alistplist'
import AliyunApi from '~/apis/delete/aliyun'

View File

@@ -1,4 +1,3 @@
import type { IStringKeyMap } from '#/types/types'
import { getRawData } from '~/utils/common'
import { removeFileFromS3InMain } from '~/utils/deleteFunc'
import { deleteFailedLog } from '~/utils/deleteLog'

View File

@@ -1,4 +1,3 @@
import type { IStringKeyMap } from '#/types/types'
import { getRawData } from '~/utils/common'
import { removeFileFromDogeInMain } from '~/utils/deleteFunc'
import { deleteFailedLog } from '~/utils/deleteLog'

View File

@@ -1,6 +1,5 @@
import { Octokit } from '@octokit/rest'
import type { IGitHubConfig, PartialKeys } from '#/types/types'
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
interface IConfigMap {

View File

@@ -1,4 +1,3 @@
import type { IStringKeyMap } from '#/types/types'
import { getRawData } from '~/utils/common'
import { removeFileFromHuaweiInMain } from '~/utils/deleteFunc'
import { deleteFailedLog } from '~/utils/deleteLog'

View File

@@ -1,6 +1,5 @@
import axios, { AxiosResponse } from 'axios'
import type { IImgurConfig } from '#/types/types'
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
interface IConfigMap {

View File

@@ -2,7 +2,6 @@ import https from 'node:https'
import axios, { AxiosResponse } from 'axios'
import type { IStringKeyMap } from '#/types/types'
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
export default class LskyplistApi {

View File

@@ -1,6 +1,5 @@
import axios, { AxiosResponse } from 'axios'
import type { IStringKeyMap } from '#/types/types'
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
export default class PiclistApi {

View File

@@ -1,6 +1,5 @@
import qiniu from 'qiniu'
import type { IQiniuConfig, PartialKeys } from '#/types/types'
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
interface IConfigMap {
fileName: string

View File

@@ -1,4 +1,3 @@
import type { IStringKeyMap } from '#/types/types'
import { getRawData } from '~/utils/common'
import { removeFileFromSFTPInMain } from '~/utils/deleteFunc'
import { deleteFailedLog } from '~/utils/deleteLog'

View File

@@ -1,6 +1,5 @@
import axios, { AxiosResponse } from 'axios'
import type { ISMMSConfig } from '#/types/types'
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
interface IConfigMap {

View File

@@ -1,6 +1,5 @@
import COS from 'cos-nodejs-sdk-v5'
import type { ITcYunConfig, PartialKeys } from '#/types/types'
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
interface IConfigMap {
fileName: string

View File

@@ -1,6 +1,5 @@
import Upyun from 'upyun'
import type { IUpYunConfig, PartialKeys } from '#/types/types'
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
interface IConfigMap {

View File

@@ -1,6 +1,5 @@
import { AuthType, createClient, WebDAVClientOptions } from 'webdav'
import type { IWebdavPlistConfig, PartialKeys } from '#/types/types'
import { formatEndpoint } from '~/utils/common'
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'

View File

@@ -8,16 +8,6 @@ import { BrowserWindow, dialog, ipcMain, IpcMainEvent, MessageBoxOptions, Notifi
import fs from 'fs-extra'
import { cloneDeep } from 'lodash-es'
import type {
IGuiApi,
ImgInfo,
IShowFileExplorerOption,
IShowInputBoxOption,
IShowMessageBoxOption,
IShowMessageBoxResult,
IShowNotificationOption,
IUploadOption,
} from '#/types/types'
import { SHOW_INPUT_BOX } from '~/events/constant'
import { T as $t } from '~/i18n'
import { handleCopyUrl } from '~/utils/common'