🔨 Refactor(custom): refactored all imports

This commit is contained in:
Kuingsmile
2024-06-09 11:53:07 +08:00
parent 8a565c1333
commit e87e3999b4
138 changed files with 947 additions and 1333 deletions

View File

@@ -1,10 +1,13 @@
/* eslint-disable camelcase */
import { ipcRenderer } from 'electron'
import {
TALKING_DATA_APPID, TALKING_DATA_EVENT
} from '~/universal/events/constants'
} from '#/events/constants'
import { handleTalkingDataEvent } from '@/utils/common'
import pkg from 'root/package.json'
import { ipcRenderer } from 'electron'
import { handleTalkingDataEvent } from './common'
const { version } = pkg
export const initTalkingData = () => {

View File

@@ -3,7 +3,7 @@ import {
SHOW_INPUT_BOX,
SHOW_INPUT_BOX_RESPONSE,
FORCE_UPDATE
} from '~/universal/events/constants'
} from '#/events/constants'
type IEvent ={
[SHOW_INPUT_BOX_RESPONSE]: string

View File

@@ -1,7 +1,8 @@
import { isReactive, isRef, toRaw, unref } from 'vue'
import { ipcRenderer } from 'electron'
import { OPEN_URL } from '~/universal/events/constants'
import { ILogType } from '~/universal/types/enum'
import { isReactive, isRef, toRaw, unref } from 'vue'
import { OPEN_URL } from '#/events/constants'
import { ILogType } from '#/types/enum'
const isDevelopment = process.env.NODE_ENV !== 'production'
export const handleTalkingDataEvent = (data: ITalkingDataOptions) => {

View File

@@ -1,17 +1,10 @@
// Electron 相关
import { ipcRenderer, IpcRendererEvent } from 'electron'
// 事件常量
import { PICGO_SAVE_CONFIG, PICGO_GET_CONFIG, RPC_ACTIONS } from '#/events/constants'
// UUID
import { v4 as uuid } from 'uuid'
// 枚举类型声明
import { IRPCActionType } from '~/universal/types/enum'
import { getRawData } from '@/utils/common'
// 公共工具函数
import { getRawData } from './common'
import { PICGO_SAVE_CONFIG, PICGO_GET_CONFIG, RPC_ACTIONS } from '#/events/constants'
import { IRPCActionType } from '#/types/enum'
export function saveConfig (config: IObj | string, value?: any) {
const configObject = typeof config === 'string' ? { [config]: value } : getRawData(config)

View File

@@ -1,13 +1,9 @@
// Picgo Store 相关类型
import { ipcRenderer, IpcRendererEvent } from 'electron'
import { v4 as uuid } from 'uuid'
import { IObject, IResult, IGetResult, IFilter } from '@picgo/store/dist/types'
// Electron 相关
import { ipcRenderer, IpcRendererEvent } from 'electron'
import { getRawData } from '@/utils/common'
// UUID
import { v4 as uuid } from 'uuid'
// 数据库操作常量
import {
PICGO_GET_DB,
PICGO_INSERT_DB,
@@ -16,13 +12,8 @@ import {
PICGO_GET_BY_ID_DB,
PICGO_REMOVE_BY_ID_DB
} from '#/events/constants'
// 数据库类型声明
import { IGalleryDB } from '#/types/extra-vue'
// 公共工具函数
import { getRawData } from './common'
export class GalleryDB implements IGalleryDB {
async get<T> (filter?: IFilter): Promise<IGetResult<T>> {
const res = await this.#msgHandler<IGetResult<T>>(PICGO_GET_DB, filter)

View File

@@ -1,7 +1,9 @@
import { ComponentOptions } from 'vue'
import { FORCE_UPDATE, GET_PICBEDS } from '~/universal/events/constants'
import bus from '~/renderer/utils/bus'
import { ipcRenderer } from 'electron'
import { ComponentOptions } from 'vue'
import bus from '@/utils/bus'
import { FORCE_UPDATE, GET_PICBEDS } from '#/events/constants'
export const mainMixin: ComponentOptions = {
inject: ['forceUpdateTime'],