Refactor comments and small type fixes in extended.ts

Add JsonObject import and use it for handleSendPacket param typing; replace deprecated hex.substr with hex.slice; convert and consolidate many English docstrings/comments into Chinese for clarity; remove some JSDoc noise and minor formatting tweaks; improve explanatory comments around streaming download, base64 size checks, safe path resolution and async file writes. These are primarily documentation and small type/cleanup changes with no functional behavior changes.
This commit is contained in:
手瓜一十雪 committed 2026-05-24 12:54:21 +08:00
1 parent f53df5e313
commit 245405d294
2 files changed
+59 -122

No files matched your search

+2 -3
View File
@@ -1,4 +1,4 @@
import type { ApiHandler, ApiActionContext } from '../api-handler';
import type { ApiActionContext, ApiHandler } from '../api-handler';
import { okResponse } from '../types';
export function register(h: ApiHandler, ctx: ApiActionContext): void {
@@ -12,8 +12,7 @@ export function register(h: ApiHandler, ctx: ApiActionContext): void {
return okResponse({ online, good: online });
});
// __APP_VERSION__ is injected by Vite from the monorepo root package.json;
// it's undefined under vitest (no define plugin), so fall back to 'dev'.
// 后续考虑移动到一个统一的地方构建,避免版本信息分散在各个模块中。
const appVersion = typeof __APP_VERSION__ !== 'undefined' ? __APP_VERSION__ : 'dev';
h.registerAction('get_version_info', async () => {
return okResponse({