mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-06-07 00:30:14 +08:00
🔨 Refactor(custom): change type defination in universal to global
This commit is contained in:
@@ -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'
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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[]
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import OSS from 'ali-oss'
|
||||
|
||||
import type { IAliYunConfig, PartialKeys } from '#/types/types'
|
||||
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
||||
|
||||
interface IConfigMap {
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Octokit } from '@octokit/rest'
|
||||
|
||||
import type { IGitHubConfig, PartialKeys } from '#/types/types'
|
||||
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
||||
|
||||
interface IConfigMap {
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import axios, { AxiosResponse } from 'axios'
|
||||
|
||||
import type { IImgurConfig } from '#/types/types'
|
||||
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
||||
|
||||
interface IConfigMap {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import axios, { AxiosResponse } from 'axios'
|
||||
|
||||
import type { ISMMSConfig } from '#/types/types'
|
||||
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
||||
|
||||
interface IConfigMap {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Upyun from 'upyun'
|
||||
|
||||
import type { IUpYunConfig, PartialKeys } from '#/types/types'
|
||||
import { deleteFailedLog, deleteLog } from '~/utils/deleteLog'
|
||||
|
||||
interface IConfigMap {
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user