1
0

refactor: 拆分 TRAY_ITEMS 配置

This commit is contained in:
2025-06-11 09:37:04 +08:00
parent cb3e2cc0ce
commit 271b9ad348
2 changed files with 23 additions and 20 deletions

19
src/main/tray-items.js Normal file
View File

@@ -0,0 +1,19 @@
/**
* @typedef MenuItem
* @type {Electron.MenuItem | Electron.MenuItemConstructorOptions}
*/
/**
* @typedef TrayItem
* @property {string} iconPath
* @property {MenuItem[]} menus
* @property {string} title
* @property {string} tooltip
*/
/**
* @desc 托盘项列表
* @type {TrayItem[]}
*/
export const TRAY_ITEMS = [
];

View File

@@ -2,25 +2,9 @@ import {
Tray, Menu, nativeImage,
} from 'electron';
/**
* @typedef MenuItem
* @type {Electron.MenuItem | Electron.MenuItemConstructorOptions}
*/
/**
* @typedef TrayItem
* @property {string} iconPath
* @property {MenuItem[]} menus
* @property {string} title
* @property {string} tooltip
*/
/**
* @desc 托盘项列表
* @type {TrayItem[]}
*/
const TRAY_ITEMS = [
];
import {
TRAY_ITEMS,
} from './tray-items';
/** 初始化托盘项 */
export function initTrayItems() {