export interface AppBrowserOpts { /** 测试注入平台;缺省 process.platform(候选清单按平台分支)。 */ platform?: NodeJS.Platform; /** 测试注入存在性探测;缺省 existsSync。 */ exists?: (p: string) => boolean; } /** 浏览器候选路径(按优先级):Edge Win10/11 预装且路径稳定,优先;Chrome 兜底。 * env 缺失时退标准硬编码路径(保持候选清单平台确定 → 探测结果只由 exists 决定)。 */ export declare function appBrowserCandidates(platform?: NodeJS.Platform): string[]; /** 探测本机支持 --app 模式的浏览器;找不到返回 null(调用方降级普通标签页)。 */ export declare function findAppBrowserPath(opts?: AppBrowserOpts): string | null; /** 本地文件路径 → file:// URL。RFC 3986 path 允许字符(pchar:未保留+子分隔+`:`+`@`) * 白名单之外的才编码:盘符冒号保留(encodeURIComponent 会错编成 %3A),中文/空格/ * `?`/`#` 等 URL 结构敏感字符编码。 */ export declare function buildFileUrl(filePath: string): string; /** 包根双击件文件名(中文,与 面板入口.html 呼应,资源管理器一眼可辨)。 */ export declare const APP_LAUNCHER_NAME = "\u9762\u677F\u72EC\u7ACB\u7A97\u53E3.bat"; /** * 构建双击件内容。纯 ASCII(URL 已 percent-encode,注释用英文)——cmd 按系统 ANSI * 代码页解析 bat,UTF-8 中文注释会乱码;CRLF 行尾(cmd 对 LF-only bat 的 goto 标签 * 定位有历史坑)。percent-encoding 的 %XX 在 cmd 变量展开中会被吃掉,双写 %% 还原。 * 自包含探测链:Edge/Chrome 标准路径逐个试,全无则降级默认浏览器标签页。 */ export declare function buildAppLauncherBat(entryFileUrl: string): string; export interface AppLauncherOpts { /** 测试注入平台;缺省 process.platform(bat 仅 win32 有意义)。 */ platform?: NodeJS.Platform; } /** * 幂等写包根双击件(仅 win32;其他平台返回 null 不落盘)。 * 不含 token——双击打开的是同目录 面板入口.html(token 由其内嵌且权限已收紧), * bat 本身零敏感信息,无需 0600/icacls;内容每次刷新(root 迁移后 URL 随之更新)。 */ export declare function ensurePackageRootAppLauncher(root: string, opts?: AppLauncherOpts): string | null;