This commit is contained in:
2026-03-25 22:59:31 +08:00
commit d391deb23b
81 changed files with 13012 additions and 0 deletions

30
src/my-type/ide-icons.ts Normal file
View File

@@ -0,0 +1,30 @@
// @ts-ignore 直接导入 svg 图像作为 vue 组件
import VSCodeIcon from '@renderer/assets/vscode.svg?component'
// @ts-ignore 直接导入 svg 图像作为 vue 组件
import CLionIcon from '@renderer/assets/CLion_icon.svg?component'
// @ts-ignore 直接导入 svg 图像作为 vue 组件
import IDEAIcon from '@renderer/assets/IntelliJ_IDEA_icon.svg?component'
// @ts-ignore 直接导入 svg 图像作为 vue 组件
import PhpStormIcon from '@renderer/assets/PhpStorm_icon.svg?component'
// @ts-ignore 直接导入 svg 图像作为 vue 组件
import PyCharmIcon from '@renderer/assets/PyCharm_icon.svg?component'
// @ts-ignore 直接导入 svg 图像作为 vue 组件
import WebStormIcon from '@renderer/assets/WebStorm_icon.svg?component'
import { FunctionalComponent } from 'vue'
function _(
icon: FunctionalComponent,
description: string
): { icon: FunctionalComponent; description: string } {
return { icon, description }
}
export const ideIcons = {
vscode: _(VSCodeIcon, '全能的代码编辑器'),
clion: _(CLionIcon, '强大的 C 和 C++ IDE'),
idea: _(IDEAIcon, '强大的 Java IDE'),
phpstorm: _(PhpStormIcon, '强大的 PHP IDE'),
pycharm: _(PyCharmIcon, '强大的 Python IDE'),
webstorm: _(WebStormIcon, '强大的 Web IDE')
}

View File

@@ -0,0 +1,20 @@
import type { JetBrainsProductCode } from '@my-type/jetbrains-state-tools'
export interface JetBrainsDataProductReleaseDto {
date: string
type: 'release'
// e.g. 2025.3.3
version: string
// e.g. 2025.3
majorVersion: string
// e.g. 253.31033.139
build: string
// HTML 文本
whatsnew: string
}
export interface JetBrainsDataProductDto {
intellijProductCode: JetBrainsProductCode
// 认为 releases[0] 即为最新版吧
releases: JetBrainsDataProductReleaseDto[]
}

View File

@@ -0,0 +1,27 @@
export type JetBrainsProductCode = 'PY' | 'IU' | 'WS' | 'CL' | 'PS'
export interface JetBrainsStateToolDto {
channelId: string
toolId: string
productCode: JetBrainsProductCode
tag: string
displayName: string
displayVersion: string
buildNumber: string
installLocation: string
launchCommand: string
}
export interface JetBrainsStateDto {
version: 1
appVersion: string
tools: JetBrainsStateToolDto[]
}
export enum JetBrainsIDEDisplayNameEnum {
pycharm = 'PyCharm',
idea = 'IntelliJ IDEA',
clion = 'CLion',
phpstorm = 'PhpStorm',
webstorm = 'WebStorm'
}

View File

@@ -0,0 +1,3 @@
export function isNodeError(error: unknown): error is NodeJS.ErrnoException {
return error instanceof Error && 'code' in error
}

39
src/my-type/settings.d.ts vendored Normal file
View File

@@ -0,0 +1,39 @@
import type { JetBrainsProductCode } from '@my-type/jetbrains-state-tools'
export type screenPosition = 'left top' | 'left bottom' | 'right top' | 'right bottom'
export type keyboardShortcut = 'alt+c' | 'alt+space'
export type ideSearchPolicy = 'where.exe' | 'JBTState.json' | 'global.search'
export interface settingsDto {
isStayInTray: boolean
isAutoLaunchAtStartUp: boolean
isCodeLaunchpadEnabled: boolean
isCodeLaunchpadInTray: boolean
isCodeLaunchpadShortcutEnabled: boolean
codeLaunchpadShortcut: keyboardShortcut
codeLaunchpadPosition: screenPosition
codeLaunchpadWidth: number
codeLaunchpadHeight: number
codeLaunchpadIDESearchPolicy: ideSearchPolicy[]
}
export interface checkIDEResultDto {
// 仅针对 JetBrains 系列 IDEs 的产品代码,对于其他 IDE 统一为空字符串
code: JetBrainsProductCode | ''
display: string
command: string
paths: string[]
}
export type checkIDEsResultDto = Record<string, checkIDEResultDto | null>
export interface checkIDEVersionDto {
// 仅针对 JetBrains 系列 IDEs 的产品代码,对于其他 IDE 统一为空字符串
code: JetBrainsProductCode | ''
display: string
install: string
latest: string
}
export type checkIDEsVersionDto = Record<string, checkIDEVersionDto | null>