重构:Wails v3 迁移 + 前端目录规范化 + Sidebar滚动优化
- web/ → frontend/ 目录重命名(Wails v3 标准结构) - main.go: Middleware 修复 custom.js 404 + DevTools 延迟启动 - Sidebar: 收藏夹内部独立滚动 + 帮助区块固定底部 - useFavorites.ts: longPressTimer const→let 修复 TypeError - App.vue: Arco Tabs padding-top 覆盖 - build: config.yml / Taskfile.yml 对齐官方模板,devtools build tag - 新增 v3 bindings、vite.config.js、跨平台构建配置 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
//@ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import { Create as $Create } from "@wailsio/runtime";
|
||||
|
||||
Object.freeze($Create.Events);
|
||||
2
frontend/bindings/github.com/wailsapp/wails/v3/internal/eventdata.d.ts
vendored
Normal file
2
frontend/bindings/github.com/wailsapp/wails/v3/internal/eventdata.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
@@ -0,0 +1,6 @@
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
export {
|
||||
WebviewWindow
|
||||
} from "./models.js";
|
||||
@@ -0,0 +1,23 @@
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import { Create as $Create } from "@wailsio/runtime";
|
||||
|
||||
export class WebviewWindow {
|
||||
|
||||
/** Creates a new WebviewWindow instance. */
|
||||
constructor($$source: Partial<WebviewWindow> = {}) {
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new WebviewWindow instance from a string or object.
|
||||
*/
|
||||
static createFrom($$source: any = {}): WebviewWindow {
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
return new WebviewWindow($$parsedSource as Partial<WebviewWindow>);
|
||||
}
|
||||
}
|
||||
430
frontend/bindings/u-desk/app.ts
Normal file
430
frontend/bindings/u-desk/app.ts
Normal file
@@ -0,0 +1,430 @@
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
/**
|
||||
* App 应用结构体
|
||||
* @module
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import * as application$0 from "../github.com/wailsapp/wails/v3/pkg/application/models.js";
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import * as filesystem$0 from "./internal/filesystem/models.js";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import * as $models from "./models.js";
|
||||
|
||||
/**
|
||||
* CheckUpdate 检查更新
|
||||
*/
|
||||
export function CheckUpdate(): $CancellablePromise<{ [_ in string]?: any }> {
|
||||
return $Call.ByID(586574094).then(($result: any) => {
|
||||
return $$createType0($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ClearCache 清理本地缓存(用于菜单项)
|
||||
*/
|
||||
export function ClearCache(): $CancellablePromise<void> {
|
||||
return $Call.ByID(1413834504);
|
||||
}
|
||||
|
||||
/**
|
||||
* CreateDir 创建目录
|
||||
*/
|
||||
export function CreateDir(path: string): $CancellablePromise<filesystem$0.FileOperationResult | null> {
|
||||
return $Call.ByID(632035444, path).then(($result: any) => {
|
||||
return $$createType2($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* CreateFile 创建文件
|
||||
*/
|
||||
export function CreateFile(path: string): $CancellablePromise<filesystem$0.FileOperationResult | null> {
|
||||
return $Call.ByID(3418645411, path).then(($result: any) => {
|
||||
return $$createType2($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* DeletePath 删除文件或目录
|
||||
*/
|
||||
export function DeletePath(path: string): $CancellablePromise<filesystem$0.FileOperationResult | null> {
|
||||
return $Call.ByID(1564637217, path).then(($result: any) => {
|
||||
return $$createType2($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* DeletePermanently 永久删除回收站中的文件
|
||||
*/
|
||||
export function DeletePermanently(recyclePath: string): $CancellablePromise<void> {
|
||||
return $Call.ByID(1697000327, recyclePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* DetectFileTypeByContent 通过文件内容检测文件类型
|
||||
*/
|
||||
export function DetectFileTypeByContent(path: string): $CancellablePromise<{ [_ in string]?: any }> {
|
||||
return $Call.ByID(3067282982, path).then(($result: any) => {
|
||||
return $$createType0($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* DownloadUpdate 下载更新包
|
||||
*/
|
||||
export function DownloadUpdate(downloadURL: string): $CancellablePromise<{ [_ in string]?: any }> {
|
||||
return $Call.ByID(115027584, downloadURL).then(($result: any) => {
|
||||
return $$createType0($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* EmptyRecycleBin 清空回收站
|
||||
*/
|
||||
export function EmptyRecycleBin(): $CancellablePromise<void> {
|
||||
return $Call.ByID(4176312624);
|
||||
}
|
||||
|
||||
/**
|
||||
* ExportPDF 导出PDF文件
|
||||
*/
|
||||
export function ExportPDF(content: string, title: string, fileName: string, fontSize: number, pageWidth: number, pageHeight: number): $CancellablePromise<{ [_ in string]?: any }> {
|
||||
return $Call.ByID(1770450987, content, title, fileName, fontSize, pageWidth, pageHeight).then(($result: any) => {
|
||||
return $$createType0($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ExtractFileFromZip 从 zip 文件中提取单个文件内容
|
||||
*/
|
||||
export function ExtractFileFromZip(zipPath: string, filePath: string): $CancellablePromise<string> {
|
||||
return $Call.ByID(1578144127, zipPath, filePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* ExtractFileFromZipToTemp 从 zip 文件中提取单个文件到临时目录
|
||||
*/
|
||||
export function ExtractFileFromZipToTemp(zipPath: string, filePath: string): $CancellablePromise<string> {
|
||||
return $Call.ByID(1720007904, zipPath, filePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* GetAppConfig 获取应用配置
|
||||
*/
|
||||
export function GetAppConfig(): $CancellablePromise<{ [_ in string]?: any }> {
|
||||
return $Call.ByID(2006534548).then(($result: any) => {
|
||||
return $$createType0($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* GetAuditLogs 获取审计日志
|
||||
*/
|
||||
export function GetAuditLogs(limit: number): $CancellablePromise<{ [_ in string]?: any }[]> {
|
||||
return $Call.ByID(3554903517, limit).then(($result: any) => {
|
||||
return $$createType3($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* GetCPUInfo 获取 CPU 信息
|
||||
*/
|
||||
export function GetCPUInfo(): $CancellablePromise<{ [_ in string]?: any }> {
|
||||
return $Call.ByID(2509681007).then(($result: any) => {
|
||||
return $$createType0($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* GetCommonPaths 获取常用系统路径
|
||||
*/
|
||||
export function GetCommonPaths(): $CancellablePromise<{ [_ in string]?: string }> {
|
||||
return $Call.ByID(3953343786).then(($result: any) => {
|
||||
return $$createType4($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* GetCurrentVersion 获取当前版本号
|
||||
*/
|
||||
export function GetCurrentVersion(): $CancellablePromise<{ [_ in string]?: any }> {
|
||||
return $Call.ByID(1827245900).then(($result: any) => {
|
||||
return $$createType0($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* GetDiskInfo 获取磁盘信息
|
||||
*/
|
||||
export function GetDiskInfo(): $CancellablePromise<{ [_ in string]?: any }[]> {
|
||||
return $Call.ByID(3756377758).then(($result: any) => {
|
||||
return $$createType3($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* GetEnvVars 获取环境变量
|
||||
*/
|
||||
export function GetEnvVars(): $CancellablePromise<{ [_ in string]?: string }> {
|
||||
return $Call.ByID(363814436).then(($result: any) => {
|
||||
return $$createType4($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* GetFileInfo 获取文件信息
|
||||
*/
|
||||
export function GetFileInfo(path: string): $CancellablePromise<{ [_ in string]?: any }> {
|
||||
return $Call.ByID(2071650585, path).then(($result: any) => {
|
||||
return $$createType0($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* GetFileServerURL 获取本地文件服务器的URL
|
||||
*/
|
||||
export function GetFileServerURL(): $CancellablePromise<string> {
|
||||
return $Call.ByID(4117667287);
|
||||
}
|
||||
|
||||
/**
|
||||
* GetMemoryInfo 获取内存信息
|
||||
*/
|
||||
export function GetMemoryInfo(): $CancellablePromise<{ [_ in string]?: any }> {
|
||||
return $Call.ByID(2096905876).then(($result: any) => {
|
||||
return $$createType0($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* GetRecycleBinEntries 获取回收站条目
|
||||
*/
|
||||
export function GetRecycleBinEntries(): $CancellablePromise<{ [_ in string]?: any }[]> {
|
||||
return $Call.ByID(2312855399).then(($result: any) => {
|
||||
return $$createType3($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* GetSystemInfo 获取系统信息
|
||||
*/
|
||||
export function GetSystemInfo(): $CancellablePromise<{ [_ in string]?: any }> {
|
||||
return $Call.ByID(1347250254).then(($result: any) => {
|
||||
return $$createType0($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* GetUpdateConfig 获取更新配置
|
||||
*/
|
||||
export function GetUpdateConfig(): $CancellablePromise<{ [_ in string]?: any }> {
|
||||
return $Call.ByID(680804904).then(($result: any) => {
|
||||
return $$createType0($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* GetZipFileInfo 获取 zip 文件中特定文件的信息
|
||||
*/
|
||||
export function GetZipFileInfo(zipPath: string, filePath: string): $CancellablePromise<{ [_ in string]?: any }> {
|
||||
return $Call.ByID(2031617692, zipPath, filePath).then(($result: any) => {
|
||||
return $$createType0($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* InstallUpdate 安装更新包
|
||||
*/
|
||||
export function InstallUpdate(installerPath: string, autoRestart: boolean): $CancellablePromise<{ [_ in string]?: any }> {
|
||||
return $Call.ByID(2443992793, installerPath, autoRestart).then(($result: any) => {
|
||||
return $$createType0($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* InstallUpdateWithHash 安装更新包(带哈希验证)
|
||||
*/
|
||||
export function InstallUpdateWithHash(installerPath: string, autoRestart: boolean, expectedHash: string, hashType: string): $CancellablePromise<{ [_ in string]?: any }> {
|
||||
return $Call.ByID(3787276601, installerPath, autoRestart, expectedHash, hashType).then(($result: any) => {
|
||||
return $$createType0($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ListDir 列出目录
|
||||
*/
|
||||
export function ListDir(path: string): $CancellablePromise<{ [_ in string]?: any }[]> {
|
||||
return $Call.ByID(2120475736, path).then(($result: any) => {
|
||||
return $$createType3($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ListZipContents 列出 zip 文件内容
|
||||
*/
|
||||
export function ListZipContents(zipPath: string): $CancellablePromise<{ [_ in string]?: any }[]> {
|
||||
return $Call.ByID(3013109042, zipPath).then(($result: any) => {
|
||||
return $$createType3($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* OpenPath 使用系统默认程序打开文件或目录
|
||||
*/
|
||||
export function OpenPath(path: string): $CancellablePromise<void> {
|
||||
return $Call.ByID(1591734570, path);
|
||||
}
|
||||
|
||||
/**
|
||||
* ReadFile 读取文件
|
||||
*/
|
||||
export function ReadFile(path: string): $CancellablePromise<string> {
|
||||
return $Call.ByID(1160596971, path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reload 重新加载窗口(用于菜单项)
|
||||
*/
|
||||
export function Reload(): $CancellablePromise<void> {
|
||||
return $Call.ByID(2733532980);
|
||||
}
|
||||
|
||||
/**
|
||||
* RenamePath 重命名文件或目录
|
||||
*/
|
||||
export function RenamePath(req: $models.RenamePathRequest): $CancellablePromise<filesystem$0.FileOperationResult | null> {
|
||||
return $Call.ByID(1959759948, req).then(($result: any) => {
|
||||
return $$createType2($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ResolveShortcut 解析快捷方式文件,返回目标路径信息
|
||||
*/
|
||||
export function ResolveShortcut(lnkPath: string): $CancellablePromise<{ [_ in string]?: any }> {
|
||||
return $Call.ByID(4051288361, lnkPath).then(($result: any) => {
|
||||
return $$createType0($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* RestoreFromRecycleBin 从回收站恢复文件
|
||||
*/
|
||||
export function RestoreFromRecycleBin(recyclePath: string): $CancellablePromise<void> {
|
||||
return $Call.ByID(3682437655, recyclePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* SaveAppConfig 保存应用配置
|
||||
*/
|
||||
export function SaveAppConfig(req: $models.SaveAppConfigRequest): $CancellablePromise<{ [_ in string]?: any }> {
|
||||
return $Call.ByID(1942219977, req).then(($result: any) => {
|
||||
return $$createType0($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* SaveBase64File 将 base64 内容解码后写入文件(用于图片等二进制数据)
|
||||
*/
|
||||
export function SaveBase64File(req: $models.SaveBase64FileRequest): $CancellablePromise<void> {
|
||||
return $Call.ByID(1355120553, req);
|
||||
}
|
||||
|
||||
/**
|
||||
* SelectPDFSaveDirectory 选择PDF保存目录
|
||||
*/
|
||||
export function SelectPDFSaveDirectory(): $CancellablePromise<string> {
|
||||
return $Call.ByID(1403263131);
|
||||
}
|
||||
|
||||
/**
|
||||
* SetMainWindow 设置主窗口引用(由 main.go 在创建窗口后调用)
|
||||
*/
|
||||
export function SetMainWindow(w: application$0.WebviewWindow | null): $CancellablePromise<void> {
|
||||
return $Call.ByID(843697430, w);
|
||||
}
|
||||
|
||||
/**
|
||||
* SetUpdateConfig 设置更新配置
|
||||
*/
|
||||
export function SetUpdateConfig(autoCheckEnabled: boolean, checkIntervalMinutes: number, checkURL: string): $CancellablePromise<{ [_ in string]?: any }> {
|
||||
return $Call.ByID(4271731092, autoCheckEnabled, checkIntervalMinutes, checkURL).then(($result: any) => {
|
||||
return $$createType0($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* SetWindowTitleBarColor 设置原生标题栏颜色 + 主题模式(0x00BBGGRR 格式)
|
||||
*/
|
||||
export function SetWindowTitleBarColor(color: number, isDark: boolean): $CancellablePromise<void> {
|
||||
return $Call.ByID(1570627619, color, isDark);
|
||||
}
|
||||
|
||||
/**
|
||||
* VerifyUpdateFile 验证更新文件哈希值
|
||||
*/
|
||||
export function VerifyUpdateFile(filePath: string, expectedHash: string, hashType: string): $CancellablePromise<{ [_ in string]?: any }> {
|
||||
return $Call.ByID(2181909867, filePath, expectedHash, hashType).then(($result: any) => {
|
||||
return $$createType0($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* WindowClose 关闭窗口
|
||||
*/
|
||||
export function WindowClose(): $CancellablePromise<void> {
|
||||
return $Call.ByID(1474073651);
|
||||
}
|
||||
|
||||
/**
|
||||
* WindowIsMaximized 检查窗口是否最大化
|
||||
*/
|
||||
export function WindowIsMaximized(): $CancellablePromise<boolean> {
|
||||
return $Call.ByID(854232017);
|
||||
}
|
||||
|
||||
/**
|
||||
* WindowMaximize 最大化/还原窗口
|
||||
*/
|
||||
export function WindowMaximize(): $CancellablePromise<void> {
|
||||
return $Call.ByID(2739663967);
|
||||
}
|
||||
|
||||
/**
|
||||
* WindowMinimize 最小化窗口
|
||||
*/
|
||||
export function WindowMinimize(): $CancellablePromise<void> {
|
||||
return $Call.ByID(1846147565);
|
||||
}
|
||||
|
||||
/**
|
||||
* WindowToggleAlwaysOnTop 切换窗口置顶
|
||||
*/
|
||||
export function WindowToggleAlwaysOnTop(): $CancellablePromise<boolean> {
|
||||
return $Call.ByID(3391208916);
|
||||
}
|
||||
|
||||
/**
|
||||
* WriteFile 写入文件
|
||||
*/
|
||||
export function WriteFile(req: $models.WriteFileRequest): $CancellablePromise<void> {
|
||||
return $Call.ByID(3562730546, req);
|
||||
}
|
||||
|
||||
// Private type creation functions
|
||||
const $$createType0 = $Create.Map($Create.Any, $Create.Any);
|
||||
const $$createType1 = filesystem$0.FileOperationResult.createFrom;
|
||||
const $$createType2 = $Create.Nullable($$createType1);
|
||||
const $$createType3 = $Create.Array($$createType0);
|
||||
const $$createType4 = $Create.Map($Create.Any, $Create.Any);
|
||||
14
frontend/bindings/u-desk/index.ts
Normal file
14
frontend/bindings/u-desk/index.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
import * as App from "./app.js";
|
||||
export {
|
||||
App
|
||||
};
|
||||
|
||||
export {
|
||||
RenamePathRequest,
|
||||
SaveAppConfigRequest,
|
||||
SaveBase64FileRequest,
|
||||
WriteFileRequest
|
||||
} from "./models.js";
|
||||
6
frontend/bindings/u-desk/internal/api/index.ts
Normal file
6
frontend/bindings/u-desk/internal/api/index.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
export {
|
||||
AppTabDefinition
|
||||
} from "./models.js";
|
||||
42
frontend/bindings/u-desk/internal/api/models.ts
Normal file
42
frontend/bindings/u-desk/internal/api/models.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import { Create as $Create } from "@wailsio/runtime";
|
||||
|
||||
/**
|
||||
* AppTabDefinition 应用 Tab 定义(前端格式)
|
||||
*/
|
||||
export class AppTabDefinition {
|
||||
"key": string;
|
||||
"title": string;
|
||||
"visible": boolean;
|
||||
"enabled": boolean;
|
||||
|
||||
/** Creates a new AppTabDefinition instance. */
|
||||
constructor($$source: Partial<AppTabDefinition> = {}) {
|
||||
if (!("key" in $$source)) {
|
||||
this["key"] = "";
|
||||
}
|
||||
if (!("title" in $$source)) {
|
||||
this["title"] = "";
|
||||
}
|
||||
if (!("visible" in $$source)) {
|
||||
this["visible"] = false;
|
||||
}
|
||||
if (!("enabled" in $$source)) {
|
||||
this["enabled"] = false;
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new AppTabDefinition instance from a string or object.
|
||||
*/
|
||||
static createFrom($$source: any = {}): AppTabDefinition {
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
return new AppTabDefinition($$parsedSource as Partial<AppTabDefinition>);
|
||||
}
|
||||
}
|
||||
6
frontend/bindings/u-desk/internal/filesystem/index.ts
Normal file
6
frontend/bindings/u-desk/internal/filesystem/index.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
export {
|
||||
FileOperationResult
|
||||
} from "./models.js";
|
||||
55
frontend/bindings/u-desk/internal/filesystem/models.ts
Normal file
55
frontend/bindings/u-desk/internal/filesystem/models.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import { Create as $Create } from "@wailsio/runtime";
|
||||
|
||||
/**
|
||||
* FileOperationResult 文件操作结果
|
||||
*/
|
||||
export class FileOperationResult {
|
||||
"path": string;
|
||||
"name": string;
|
||||
"size": number;
|
||||
"size_str"?: string;
|
||||
"is_dir": boolean;
|
||||
"mod_time"?: string;
|
||||
"mode"?: string;
|
||||
|
||||
/**
|
||||
* 仅重命名操作时有值
|
||||
*/
|
||||
"old_path"?: string;
|
||||
|
||||
/**
|
||||
* 仅删除操作时有值
|
||||
*/
|
||||
"deleted"?: boolean;
|
||||
|
||||
/** Creates a new FileOperationResult instance. */
|
||||
constructor($$source: Partial<FileOperationResult> = {}) {
|
||||
if (!("path" in $$source)) {
|
||||
this["path"] = "";
|
||||
}
|
||||
if (!("name" in $$source)) {
|
||||
this["name"] = "";
|
||||
}
|
||||
if (!("size" in $$source)) {
|
||||
this["size"] = 0;
|
||||
}
|
||||
if (!("is_dir" in $$source)) {
|
||||
this["is_dir"] = false;
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new FileOperationResult instance from a string or object.
|
||||
*/
|
||||
static createFrom($$source: any = {}): FileOperationResult {
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
return new FileOperationResult($$parsedSource as Partial<FileOperationResult>);
|
||||
}
|
||||
}
|
||||
143
frontend/bindings/u-desk/models.ts
Normal file
143
frontend/bindings/u-desk/models.ts
Normal file
@@ -0,0 +1,143 @@
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import { Create as $Create } from "@wailsio/runtime";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import * as api$0 from "./internal/api/models.js";
|
||||
|
||||
/**
|
||||
* RenamePathRequest 重命名文件或目录请求结构体
|
||||
*/
|
||||
export class RenamePathRequest {
|
||||
"oldPath": string;
|
||||
"newPath": string;
|
||||
|
||||
/** Creates a new RenamePathRequest instance. */
|
||||
constructor($$source: Partial<RenamePathRequest> = {}) {
|
||||
if (!("oldPath" in $$source)) {
|
||||
this["oldPath"] = "";
|
||||
}
|
||||
if (!("newPath" in $$source)) {
|
||||
this["newPath"] = "";
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new RenamePathRequest instance from a string or object.
|
||||
*/
|
||||
static createFrom($$source: any = {}): RenamePathRequest {
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
return new RenamePathRequest($$parsedSource as Partial<RenamePathRequest>);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* SaveAppConfigRequest 保存应用配置请求
|
||||
*/
|
||||
export class SaveAppConfigRequest {
|
||||
"tabs": api$0.AppTabDefinition[];
|
||||
"visibleTabs": string[];
|
||||
"defaultTab": string;
|
||||
|
||||
/** Creates a new SaveAppConfigRequest instance. */
|
||||
constructor($$source: Partial<SaveAppConfigRequest> = {}) {
|
||||
if (!("tabs" in $$source)) {
|
||||
this["tabs"] = [];
|
||||
}
|
||||
if (!("visibleTabs" in $$source)) {
|
||||
this["visibleTabs"] = [];
|
||||
}
|
||||
if (!("defaultTab" in $$source)) {
|
||||
this["defaultTab"] = "";
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new SaveAppConfigRequest instance from a string or object.
|
||||
*/
|
||||
static createFrom($$source: any = {}): SaveAppConfigRequest {
|
||||
const $$createField0_0 = $$createType1;
|
||||
const $$createField1_0 = $$createType2;
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
if ("tabs" in $$parsedSource) {
|
||||
$$parsedSource["tabs"] = $$createField0_0($$parsedSource["tabs"]);
|
||||
}
|
||||
if ("visibleTabs" in $$parsedSource) {
|
||||
$$parsedSource["visibleTabs"] = $$createField1_0($$parsedSource["visibleTabs"]);
|
||||
}
|
||||
return new SaveAppConfigRequest($$parsedSource as Partial<SaveAppConfigRequest>);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* SaveBase64FileRequest 保存 Base64 编码的二进制文件
|
||||
*/
|
||||
export class SaveBase64FileRequest {
|
||||
"path": string;
|
||||
|
||||
/**
|
||||
* base64 编码的文件内容
|
||||
*/
|
||||
"content": string;
|
||||
|
||||
/** Creates a new SaveBase64FileRequest instance. */
|
||||
constructor($$source: Partial<SaveBase64FileRequest> = {}) {
|
||||
if (!("path" in $$source)) {
|
||||
this["path"] = "";
|
||||
}
|
||||
if (!("content" in $$source)) {
|
||||
this["content"] = "";
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new SaveBase64FileRequest instance from a string or object.
|
||||
*/
|
||||
static createFrom($$source: any = {}): SaveBase64FileRequest {
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
return new SaveBase64FileRequest($$parsedSource as Partial<SaveBase64FileRequest>);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* WriteFileRequest 写入文件请求结构体
|
||||
*/
|
||||
export class WriteFileRequest {
|
||||
"path": string;
|
||||
"content": string;
|
||||
|
||||
/** Creates a new WriteFileRequest instance. */
|
||||
constructor($$source: Partial<WriteFileRequest> = {}) {
|
||||
if (!("path" in $$source)) {
|
||||
this["path"] = "";
|
||||
}
|
||||
if (!("content" in $$source)) {
|
||||
this["content"] = "";
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new WriteFileRequest instance from a string or object.
|
||||
*/
|
||||
static createFrom($$source: any = {}): WriteFileRequest {
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
return new WriteFileRequest($$parsedSource as Partial<WriteFileRequest>);
|
||||
}
|
||||
}
|
||||
|
||||
// Private type creation functions
|
||||
const $$createType0 = api$0.AppTabDefinition.createFrom;
|
||||
const $$createType1 = $Create.Array($$createType0);
|
||||
const $$createType2 = $Create.Array($Create.Any);
|
||||
Reference in New Issue
Block a user