/** * vokex 框架 - Vite 插件 * * 在 Vite 构建完成后,自动将前端资源嵌入到预编译壳中 * * 用法: * ```ts * // vite.config.ts * import { vokexPlugin } from "vokex/vite-plugin"; * * export default defineConfig({ * plugins: [ * vue(), * vokexPlugin({ * name: "我的应用", * window: { width: 1200, height: 800 }, * }) * ] * }); * ``` */ import type { Plugin } from "vite"; /** Vite 插件配置 */ export interface VokexPluginOptions { /** 应用名称 */ name: string; /** 应用标识符,用于存储用户数据目录 (e.g. com.example.myapp) */ identifier: string; /** 应用图标路径 */ icon: string; /** 窗口配置 */ window: { title: string; width: number; height: number; minWidth?: number; minHeight?: number; resizable?: boolean; fullscreen?: boolean; maximized?: boolean; transparent?: boolean; decorations?: boolean; alwaysOnTop?: boolean; center?: boolean; /** 应用图标路径 */ icon?: string; }; /** 应用版本号 */ version: string; /** 输出路径(完整路径,默认为 release/应用名.exe) */ outputDir?: string; /** 自定义壳二进制路径(默认使用内置预编译壳) */ shellPath?: string; /** 是否在开发模式下跳过构建 */ skipInDev?: boolean; /** 是否显示详细日志 */ verbose?: boolean; /** 是否开启调试 */ devtools?: boolean; /** 是否开启window.open拦截 * 默认拦截不处理 * value 0 默认 1 新窗口打开 2 默认浏览器打开 * width、heiught value为1时 配置窗口大小 默认 800 * 600 */ new_window?: { value: 0 | 1 | 2; width?: number; heiught?: number; }; /** 安全配置 */ security?: { /** 允许远端页面调用的危险 API 列表(支持通配符如 computer.*) */ allowed_remote_apis?: string[]; /** 是否允许加载远端页面 */ allow_remote_pages?: boolean; }; } export declare function vokexPlugin(options: VokexPluginOptions): Plugin; export default vokexPlugin; //# sourceMappingURL=index.d.ts.map