Browse Source

refactor(config): 导出 IDefaultConfig 接口以重用类型定义

将 IDefaultConfig 接口从 config/index.ts 中导出,以便在 src/main/modules/setting/index.ts 中重用类型定义,减少代码重复并提高类型安全性。
feat/icon
npmrun 3 weeks ago
parent
commit
28eea56a3d
  1. 2
      config/index.ts
  2. 3
      src/main/modules/setting/index.ts
  3. 1177
      src/renderer/auto-imports.d.ts

2
config/index.ts

@ -6,7 +6,7 @@ type LanguageType = "zh" | "en"
type LogoType = "logo" | "bg"
// 配置接口定义
interface IDefaultConfig {
export interface IDefaultConfig {
language: LanguageType
"common.theme": ThemeType
"desktop:wallpaper": string

3
src/main/modules/setting/index.ts

@ -4,12 +4,13 @@ import path from "path"
import { cloneDeep } from "lodash"
import { injectable } from "inversify"
import Config from "config"
import type { IDefaultConfig } from "config"
import _debug from "debug"
import BaseClass from "main/base/base"
const debug = _debug("app:setting")
type IConfig = typeof Config.default_config
type IConfig = IDefaultConfig
type IOnFunc = (n: IConfig, c: IConfig, keys?: (keyof IConfig)[]) => void
type IT = (keyof IConfig)[] | keyof IConfig | "_"

1177
src/renderer/auto-imports.d.ts

File diff suppressed because it is too large
Loading…
Cancel
Save