mirror of
https://github.com/Moe-Sakura/frontend.git
synced 2026-04-02 08:05:06 +08:00
* 更新 `.gitignore` 文件以包含环境变量文件 `.env` 和相关配置。 * 在 `env.d.ts` 中定义环境变量类型,支持 API 配置、功能开关和主题设置。 * 更新 `index.html`,添加 PWA 相关的 manifest 和 meta 标签,提升应用的安装体验。 * 引入 `lazysizes` 和 `quicklink` 以优化图片加载和链接预加载,提升性能。 * 更新多个组件以使用新的 UI 状态管理,确保一致性和可读性。 * 删除不再使用的 Font Awesome 图标,替换为 lucide-vue-next 图标,提升视觉一致性。 * 更新 `README.md`,添加环境变量配置说明和项目文档链接。
91 lines
2.4 KiB
TypeScript
91 lines
2.4 KiB
TypeScript
/// <reference types="vite/client" />
|
|
|
|
declare module '*.vue' {
|
|
import type { DefineComponent } from 'vue'
|
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type, @typescript-eslint/no-explicit-any
|
|
const component: DefineComponent<{}, {}, any>
|
|
export default component
|
|
}
|
|
|
|
interface Window {
|
|
Pace: {
|
|
restart(): void
|
|
options: {
|
|
ajax?: boolean
|
|
document?: boolean
|
|
eventLag?: boolean
|
|
elements?: boolean
|
|
restartOnPushState?: boolean
|
|
restartOnRequestAfter?: boolean
|
|
}
|
|
}
|
|
}
|
|
|
|
// 环境变量类型定义
|
|
interface ImportMetaEnv {
|
|
// API 配置
|
|
readonly VITE_DEFAULT_API_URL: string
|
|
readonly VITE_VNDB_API_URL: string
|
|
readonly VITE_TRANSLATE_API_URL: string
|
|
readonly VITE_STATUS_API_URL: string
|
|
readonly VITE_RANDOM_IMAGE_API: string
|
|
|
|
// 应用配置
|
|
readonly VITE_APP_NAME: string
|
|
readonly VITE_APP_TITLE: string
|
|
readonly VITE_APP_DESCRIPTION: string
|
|
readonly VITE_APP_URL: string
|
|
|
|
// 功能开关
|
|
readonly VITE_ENABLE_PWA: string
|
|
readonly VITE_ENABLE_SW: string
|
|
readonly VITE_ENABLE_COMMENTS: string
|
|
readonly VITE_ENABLE_VNDB: string
|
|
readonly VITE_ENABLE_TRANSLATE: string
|
|
readonly VITE_ENABLE_HISTORY: string
|
|
readonly VITE_ENABLE_CACHE: string
|
|
readonly VITE_ENABLE_PERFORMANCE: string
|
|
readonly VITE_ENABLE_DEV_LOGS: string
|
|
|
|
// 搜索配置
|
|
readonly VITE_DEFAULT_SEARCH_MODE: string
|
|
readonly VITE_SEARCH_COOLDOWN: string
|
|
readonly VITE_DEFAULT_RESULTS_PER_PAGE: string
|
|
readonly VITE_LOAD_MORE_COUNT: string
|
|
readonly VITE_MAX_HISTORY_ITEMS: string
|
|
|
|
// 缓存配置
|
|
readonly VITE_VNDB_CACHE_DURATION: string
|
|
readonly VITE_SEARCH_CACHE_DURATION: string
|
|
readonly VITE_IMAGE_CACHE_DURATION: string
|
|
readonly VITE_MAX_CACHE_SIZE: string
|
|
|
|
// UI 配置
|
|
readonly VITE_THEME_PRIMARY: string
|
|
readonly VITE_THEME_ACCENT: string
|
|
readonly VITE_TOAST_DURATION: string
|
|
readonly VITE_SCROLL_OFFSET: string
|
|
readonly VITE_SCROLL_TOP_THRESHOLD: string
|
|
|
|
// 第三方服务
|
|
readonly VITE_ARTALK_SERVER: string
|
|
readonly VITE_ARTALK_SITE: string
|
|
readonly VITE_BUSUANZI_ENABLED: string
|
|
|
|
// 性能配置
|
|
readonly VITE_QUICKLINK_DELAY: string
|
|
readonly VITE_QUICKLINK_LIMIT: string
|
|
readonly VITE_STATUS_CHECK_INTERVAL: string
|
|
readonly VITE_STATUS_CHECK_TIMEOUT: string
|
|
|
|
// 开发配置
|
|
readonly VITE_DEV_PORT: string
|
|
readonly VITE_HMR: string
|
|
readonly VITE_SOURCEMAP: string
|
|
}
|
|
|
|
interface ImportMeta {
|
|
readonly env: ImportMetaEnv
|
|
}
|
|
|