完成基本功能

This commit is contained in:
zyj
2026-03-09 16:46:15 +08:00
parent d8851e7698
commit f55dd8ca03
57 changed files with 16098 additions and 6 deletions

View File

@@ -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);

View File

@@ -0,0 +1,2 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT

View File

@@ -0,0 +1,18 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export {
App,
BrowserManager,
ClipboardManager,
ContextMenuManager,
DialogManager,
EnvironmentManager,
EventManager,
KeyBindingManager,
MenuManager,
ScreenManager,
SystemTrayManager,
WindowManager
} from "./models.js";

View File

@@ -0,0 +1,452 @@
// @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";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as slog$0 from "../../../../../../log/slog/models.js";
export class App {
/**
* Creates a new App instance.
* @param {Partial<App>} [$$source = {}] - The source object to create the App.
*/
constructor($$source = {}) {
if (!("Window" in $$source)) {
/**
* Manager pattern for organized API
* @member
* @type {WindowManager | null}
*/
this["Window"] = null;
}
if (!("ContextMenu" in $$source)) {
/**
* @member
* @type {ContextMenuManager | null}
*/
this["ContextMenu"] = null;
}
if (!("KeyBinding" in $$source)) {
/**
* @member
* @type {KeyBindingManager | null}
*/
this["KeyBinding"] = null;
}
if (!("Browser" in $$source)) {
/**
* @member
* @type {BrowserManager | null}
*/
this["Browser"] = null;
}
if (!("Env" in $$source)) {
/**
* @member
* @type {EnvironmentManager | null}
*/
this["Env"] = null;
}
if (!("Dialog" in $$source)) {
/**
* @member
* @type {DialogManager | null}
*/
this["Dialog"] = null;
}
if (!("Event" in $$source)) {
/**
* @member
* @type {EventManager | null}
*/
this["Event"] = null;
}
if (!("Menu" in $$source)) {
/**
* @member
* @type {MenuManager | null}
*/
this["Menu"] = null;
}
if (!("Screen" in $$source)) {
/**
* @member
* @type {ScreenManager | null}
*/
this["Screen"] = null;
}
if (!("Clipboard" in $$source)) {
/**
* @member
* @type {ClipboardManager | null}
*/
this["Clipboard"] = null;
}
if (!("SystemTray" in $$source)) {
/**
* @member
* @type {SystemTrayManager | null}
*/
this["SystemTray"] = null;
}
if (!("Logger" in $$source)) {
/**
* @member
* @type {slog$0.Logger | null}
*/
this["Logger"] = null;
}
Object.assign(this, $$source);
}
/**
* Creates a new App instance from a string or object.
* @param {any} [$$source = {}]
* @returns {App}
*/
static createFrom($$source = {}) {
const $$createField0_0 = $$createType1;
const $$createField1_0 = $$createType3;
const $$createField2_0 = $$createType5;
const $$createField3_0 = $$createType7;
const $$createField4_0 = $$createType9;
const $$createField5_0 = $$createType11;
const $$createField6_0 = $$createType13;
const $$createField7_0 = $$createType15;
const $$createField8_0 = $$createType17;
const $$createField9_0 = $$createType19;
const $$createField10_0 = $$createType21;
const $$createField11_0 = $$createType23;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("Window" in $$parsedSource) {
$$parsedSource["Window"] = $$createField0_0($$parsedSource["Window"]);
}
if ("ContextMenu" in $$parsedSource) {
$$parsedSource["ContextMenu"] = $$createField1_0($$parsedSource["ContextMenu"]);
}
if ("KeyBinding" in $$parsedSource) {
$$parsedSource["KeyBinding"] = $$createField2_0($$parsedSource["KeyBinding"]);
}
if ("Browser" in $$parsedSource) {
$$parsedSource["Browser"] = $$createField3_0($$parsedSource["Browser"]);
}
if ("Env" in $$parsedSource) {
$$parsedSource["Env"] = $$createField4_0($$parsedSource["Env"]);
}
if ("Dialog" in $$parsedSource) {
$$parsedSource["Dialog"] = $$createField5_0($$parsedSource["Dialog"]);
}
if ("Event" in $$parsedSource) {
$$parsedSource["Event"] = $$createField6_0($$parsedSource["Event"]);
}
if ("Menu" in $$parsedSource) {
$$parsedSource["Menu"] = $$createField7_0($$parsedSource["Menu"]);
}
if ("Screen" in $$parsedSource) {
$$parsedSource["Screen"] = $$createField8_0($$parsedSource["Screen"]);
}
if ("Clipboard" in $$parsedSource) {
$$parsedSource["Clipboard"] = $$createField9_0($$parsedSource["Clipboard"]);
}
if ("SystemTray" in $$parsedSource) {
$$parsedSource["SystemTray"] = $$createField10_0($$parsedSource["SystemTray"]);
}
if ("Logger" in $$parsedSource) {
$$parsedSource["Logger"] = $$createField11_0($$parsedSource["Logger"]);
}
return new App(/** @type {Partial<App>} */($$parsedSource));
}
}
/**
* BrowserManager manages browser-related operations
*/
export class BrowserManager {
/**
* Creates a new BrowserManager instance.
* @param {Partial<BrowserManager>} [$$source = {}] - The source object to create the BrowserManager.
*/
constructor($$source = {}) {
Object.assign(this, $$source);
}
/**
* Creates a new BrowserManager instance from a string or object.
* @param {any} [$$source = {}]
* @returns {BrowserManager}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new BrowserManager(/** @type {Partial<BrowserManager>} */($$parsedSource));
}
}
/**
* ClipboardManager manages clipboard operations
*/
export class ClipboardManager {
/**
* Creates a new ClipboardManager instance.
* @param {Partial<ClipboardManager>} [$$source = {}] - The source object to create the ClipboardManager.
*/
constructor($$source = {}) {
Object.assign(this, $$source);
}
/**
* Creates a new ClipboardManager instance from a string or object.
* @param {any} [$$source = {}]
* @returns {ClipboardManager}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new ClipboardManager(/** @type {Partial<ClipboardManager>} */($$parsedSource));
}
}
/**
* ContextMenuManager manages all context menu operations
*/
export class ContextMenuManager {
/**
* Creates a new ContextMenuManager instance.
* @param {Partial<ContextMenuManager>} [$$source = {}] - The source object to create the ContextMenuManager.
*/
constructor($$source = {}) {
Object.assign(this, $$source);
}
/**
* Creates a new ContextMenuManager instance from a string or object.
* @param {any} [$$source = {}]
* @returns {ContextMenuManager}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new ContextMenuManager(/** @type {Partial<ContextMenuManager>} */($$parsedSource));
}
}
/**
* DialogManager manages dialog-related operations
*/
export class DialogManager {
/**
* Creates a new DialogManager instance.
* @param {Partial<DialogManager>} [$$source = {}] - The source object to create the DialogManager.
*/
constructor($$source = {}) {
Object.assign(this, $$source);
}
/**
* Creates a new DialogManager instance from a string or object.
* @param {any} [$$source = {}]
* @returns {DialogManager}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new DialogManager(/** @type {Partial<DialogManager>} */($$parsedSource));
}
}
/**
* EnvironmentManager manages environment-related operations
*/
export class EnvironmentManager {
/**
* Creates a new EnvironmentManager instance.
* @param {Partial<EnvironmentManager>} [$$source = {}] - The source object to create the EnvironmentManager.
*/
constructor($$source = {}) {
Object.assign(this, $$source);
}
/**
* Creates a new EnvironmentManager instance from a string or object.
* @param {any} [$$source = {}]
* @returns {EnvironmentManager}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new EnvironmentManager(/** @type {Partial<EnvironmentManager>} */($$parsedSource));
}
}
/**
* EventManager manages event-related operations
*/
export class EventManager {
/**
* Creates a new EventManager instance.
* @param {Partial<EventManager>} [$$source = {}] - The source object to create the EventManager.
*/
constructor($$source = {}) {
Object.assign(this, $$source);
}
/**
* Creates a new EventManager instance from a string or object.
* @param {any} [$$source = {}]
* @returns {EventManager}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new EventManager(/** @type {Partial<EventManager>} */($$parsedSource));
}
}
/**
* KeyBindingManager manages all key binding operations
*/
export class KeyBindingManager {
/**
* Creates a new KeyBindingManager instance.
* @param {Partial<KeyBindingManager>} [$$source = {}] - The source object to create the KeyBindingManager.
*/
constructor($$source = {}) {
Object.assign(this, $$source);
}
/**
* Creates a new KeyBindingManager instance from a string or object.
* @param {any} [$$source = {}]
* @returns {KeyBindingManager}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new KeyBindingManager(/** @type {Partial<KeyBindingManager>} */($$parsedSource));
}
}
/**
* MenuManager manages menu-related operations
*/
export class MenuManager {
/**
* Creates a new MenuManager instance.
* @param {Partial<MenuManager>} [$$source = {}] - The source object to create the MenuManager.
*/
constructor($$source = {}) {
Object.assign(this, $$source);
}
/**
* Creates a new MenuManager instance from a string or object.
* @param {any} [$$source = {}]
* @returns {MenuManager}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new MenuManager(/** @type {Partial<MenuManager>} */($$parsedSource));
}
}
export class ScreenManager {
/**
* Creates a new ScreenManager instance.
* @param {Partial<ScreenManager>} [$$source = {}] - The source object to create the ScreenManager.
*/
constructor($$source = {}) {
Object.assign(this, $$source);
}
/**
* Creates a new ScreenManager instance from a string or object.
* @param {any} [$$source = {}]
* @returns {ScreenManager}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new ScreenManager(/** @type {Partial<ScreenManager>} */($$parsedSource));
}
}
/**
* SystemTrayManager manages system tray-related operations
*/
export class SystemTrayManager {
/**
* Creates a new SystemTrayManager instance.
* @param {Partial<SystemTrayManager>} [$$source = {}] - The source object to create the SystemTrayManager.
*/
constructor($$source = {}) {
Object.assign(this, $$source);
}
/**
* Creates a new SystemTrayManager instance from a string or object.
* @param {any} [$$source = {}]
* @returns {SystemTrayManager}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new SystemTrayManager(/** @type {Partial<SystemTrayManager>} */($$parsedSource));
}
}
/**
* WindowManager manages all window-related operations
*/
export class WindowManager {
/**
* Creates a new WindowManager instance.
* @param {Partial<WindowManager>} [$$source = {}] - The source object to create the WindowManager.
*/
constructor($$source = {}) {
Object.assign(this, $$source);
}
/**
* Creates a new WindowManager instance from a string or object.
* @param {any} [$$source = {}]
* @returns {WindowManager}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new WindowManager(/** @type {Partial<WindowManager>} */($$parsedSource));
}
}
// Private type creation functions
const $$createType0 = WindowManager.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = ContextMenuManager.createFrom;
const $$createType3 = $Create.Nullable($$createType2);
const $$createType4 = KeyBindingManager.createFrom;
const $$createType5 = $Create.Nullable($$createType4);
const $$createType6 = BrowserManager.createFrom;
const $$createType7 = $Create.Nullable($$createType6);
const $$createType8 = EnvironmentManager.createFrom;
const $$createType9 = $Create.Nullable($$createType8);
const $$createType10 = DialogManager.createFrom;
const $$createType11 = $Create.Nullable($$createType10);
const $$createType12 = EventManager.createFrom;
const $$createType13 = $Create.Nullable($$createType12);
const $$createType14 = MenuManager.createFrom;
const $$createType15 = $Create.Nullable($$createType14);
const $$createType16 = ScreenManager.createFrom;
const $$createType17 = $Create.Nullable($$createType16);
const $$createType18 = ClipboardManager.createFrom;
const $$createType19 = $Create.Nullable($$createType18);
const $$createType20 = SystemTrayManager.createFrom;
const $$createType21 = $Create.Nullable($$createType20);
const $$createType22 = slog$0.Logger.createFrom;
const $$createType23 = $Create.Nullable($$createType22);

View File

@@ -0,0 +1,387 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
/**
* AppService 应用服务,暴露给前端调用
* @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 "../../../../wailsapp/wails/v3/pkg/application/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";
/**
* AddPlatform 添加新平台
* @param {string} name
* @param {string} baseURL
* @returns {$CancellablePromise<void>}
*/
export function AddPlatform(name, baseURL) {
return $Call.ByID(526003212, name, baseURL);
}
/**
* AddProject 添加项目到指定平台/用户下
* @param {string} platform
* @param {string} username
* @param {string} name
* @param {string} path
* @returns {$CancellablePromise<void>}
*/
export function AddProject(platform, username, name, path) {
return $Call.ByID(2299402672, platform, username, name, path);
}
/**
* AddUser 添加用户到指定平台
* @param {string} platform
* @param {string} username
* @param {string} token
* @returns {$CancellablePromise<void>}
*/
export function AddUser(platform, username, token) {
return $Call.ByID(2264426704, platform, username, token);
}
/**
* CommitChanges 提交已暂存的更改
* @param {string} path
* @param {string} message
* @returns {$CancellablePromise<void>}
*/
export function CommitChanges(path, message) {
return $Call.ByID(921984546, path, message);
}
/**
* DiscardFiles 丢弃工作区指定文件的更改
* @param {string} path
* @param {string[]} files
* @returns {$CancellablePromise<void>}
*/
export function DiscardFiles(path, files) {
return $Call.ByID(382904301, path, files);
}
/**
* FetchProject 拉取远程信息
* @param {string} path
* @returns {$CancellablePromise<string>}
*/
export function FetchProject(path) {
return $Call.ByID(3541106829, path);
}
/**
* GetBranches 获取所有本地分支
* @param {string} path
* @returns {$CancellablePromise<$models.BranchInfo[]>}
*/
export function GetBranches(path) {
return $Call.ByID(1686190192, path).then(/** @type {($result: any) => any} */(($result) => {
return $$createType1($result);
}));
}
/**
* GetCommitDiff 获取指定提交的 diff
* @param {string} path
* @param {string} hash
* @returns {$CancellablePromise<string>}
*/
export function GetCommitDiff(path, hash) {
return $Call.ByID(3678609798, path, hash);
}
/**
* GetCommitFileDiff 获取指定提交中某个文件的 diff
* @param {string} path
* @param {string} hash
* @param {string} filePath
* @returns {$CancellablePromise<string>}
*/
export function GetCommitFileDiff(path, hash, filePath) {
return $Call.ByID(880053428, path, hash, filePath);
}
/**
* GetCommitFiles 获取指定提交中变更的文件列表
* @param {string} path
* @param {string} hash
* @returns {$CancellablePromise<$models.CommitFileInfo[]>}
*/
export function GetCommitFiles(path, hash) {
return $Call.ByID(2420707876, path, hash).then(/** @type {($result: any) => any} */(($result) => {
return $$createType3($result);
}));
}
/**
* GetCommitLog 获取提交历史
* @param {string} path
* @param {number} count
* @returns {$CancellablePromise<$models.CommitLog[]>}
*/
export function GetCommitLog(path, count) {
return $Call.ByID(1281870789, path, count).then(/** @type {($result: any) => any} */(($result) => {
return $$createType5($result);
}));
}
/**
* GetFileContent 获取文件内容
* @param {string} projectPath
* @param {string} filePath
* @returns {$CancellablePromise<string>}
*/
export function GetFileContent(projectPath, filePath) {
return $Call.ByID(3085630035, projectPath, filePath);
}
/**
* GetFileDiff 获取文件 diff
* @param {string} projectPath
* @param {string} filePath
* @returns {$CancellablePromise<string>}
*/
export function GetFileDiff(projectPath, filePath) {
return $Call.ByID(1694304929, projectPath, filePath);
}
/**
* GetFileDiffStaged 获取已暂存文件的 diff
* @param {string} projectPath
* @param {string} filePath
* @returns {$CancellablePromise<string>}
*/
export function GetFileDiffStaged(projectPath, filePath) {
return $Call.ByID(2773256455, projectPath, filePath);
}
/**
* GetPlatformInfo 获取平台信息
* @param {string} name
* @returns {$CancellablePromise<$models.PlatformInfo | null>}
*/
export function GetPlatformInfo(name) {
return $Call.ByID(2668095547, name).then(/** @type {($result: any) => any} */(($result) => {
return $$createType7($result);
}));
}
/**
* GetProjectChangedFiles 获取项目变更文件列表(可能较慢)
* @param {string} path
* @returns {$CancellablePromise<$models.FileInfo[]>}
*/
export function GetProjectChangedFiles(path) {
return $Call.ByID(2302591462, path).then(/** @type {($result: any) => any} */(($result) => {
return $$createType9($result);
}));
}
/**
* GetProjectStatus 获取项目 git 状态
* @param {string} path
* @returns {$CancellablePromise<$models.ProjectStatus | null>}
*/
export function GetProjectStatus(path) {
return $Call.ByID(3451089027, path).then(/** @type {($result: any) => any} */(($result) => {
return $$createType11($result);
}));
}
/**
* GetProjectTree 获取项目树,供前端侧边栏渲染
* @returns {$CancellablePromise<$models.TreeNode[]>}
*/
export function GetProjectTree() {
return $Call.ByID(651189689).then(/** @type {($result: any) => any} */(($result) => {
return $$createType13($result);
}));
}
/**
* GetUserInfo 获取用户信息
* @param {string} platform
* @param {string} username
* @returns {$CancellablePromise<$models.UserInfo | null>}
*/
export function GetUserInfo(platform, username) {
return $Call.ByID(2674655707, platform, username).then(/** @type {($result: any) => any} */(($result) => {
return $$createType15($result);
}));
}
/**
* PullProject 拉取项目(当前分支)
* @param {string} path
* @returns {$CancellablePromise<string>}
*/
export function PullProject(path) {
return $Call.ByID(4145813996, path);
}
/**
* PushProject 推送项目(当前分支)
* @param {string} path
* @returns {$CancellablePromise<string>}
*/
export function PushProject(path) {
return $Call.ByID(3887901113, path);
}
/**
* RemovePlatform 删除平台
* @param {string} name
* @returns {$CancellablePromise<void>}
*/
export function RemovePlatform(name) {
return $Call.ByID(2222448051, name);
}
/**
* RemoveProject 从指定平台/用户下删除项目
* @param {string} platform
* @param {string} username
* @param {string} name
* @returns {$CancellablePromise<void>}
*/
export function RemoveProject(platform, username, name) {
return $Call.ByID(2748109581, platform, username, name);
}
/**
* RemoveUser 从平台删除用户
* @param {string} platform
* @param {string} username
* @returns {$CancellablePromise<void>}
*/
export function RemoveUser(platform, username) {
return $Call.ByID(1409517275, platform, username);
}
/**
* ResetProject 版本回滚git reset
* mode: "hard"(丢弃所有更改), "soft"(保留更改到暂存区), "mixed"(保留更改到工作区)
* @param {string} path
* @param {string} hash
* @param {string} mode
* @returns {$CancellablePromise<void>}
*/
export function ResetProject(path, hash, mode) {
return $Call.ByID(2061148684, path, hash, mode);
}
/**
* SelectDirectory 打开系统文件夹选择器,返回选中的路径
* @returns {$CancellablePromise<string>}
*/
export function SelectDirectory() {
return $Call.ByID(2318416763);
}
/**
* @param {application$0.App | null} app
* @returns {$CancellablePromise<void>}
*/
export function SetApplication(app) {
return $Call.ByID(383695022, app);
}
/**
* StageAll 暂存所有变更文件
* @param {string} path
* @returns {$CancellablePromise<void>}
*/
export function StageAll(path) {
return $Call.ByID(2344562461, path);
}
/**
* StageFiles 暂存指定文件
* @param {string} path
* @param {string[]} files
* @returns {$CancellablePromise<void>}
*/
export function StageFiles(path, files) {
return $Call.ByID(4064506881, path, files);
}
/**
* SwitchBranch 切换分支
* @param {string} path
* @param {string} branch
* @returns {$CancellablePromise<void>}
*/
export function SwitchBranch(path, branch) {
return $Call.ByID(4262224900, path, branch);
}
/**
* UnstageAll 取消暂存所有文件
* @param {string} path
* @returns {$CancellablePromise<void>}
*/
export function UnstageAll(path) {
return $Call.ByID(2417621882, path);
}
/**
* UnstageFiles 取消暂存指定文件
* @param {string} path
* @param {string[]} files
* @returns {$CancellablePromise<void>}
*/
export function UnstageFiles(path, files) {
return $Call.ByID(3546473046, path, files);
}
/**
* UpdatePlatform 修改平台信息base_url
* @param {string} name
* @param {string} baseURL
* @returns {$CancellablePromise<void>}
*/
export function UpdatePlatform(name, baseURL) {
return $Call.ByID(3258014550, name, baseURL);
}
/**
* UpdateUser 修改用户信息用户名、token
* @param {string} platform
* @param {string} oldUsername
* @param {string} newUsername
* @param {string} token
* @returns {$CancellablePromise<void>}
*/
export function UpdateUser(platform, oldUsername, newUsername, token) {
return $Call.ByID(1631729342, platform, oldUsername, newUsername, token);
}
// Private type creation functions
const $$createType0 = $models.BranchInfo.createFrom;
const $$createType1 = $Create.Array($$createType0);
const $$createType2 = $models.CommitFileInfo.createFrom;
const $$createType3 = $Create.Array($$createType2);
const $$createType4 = $models.CommitLog.createFrom;
const $$createType5 = $Create.Array($$createType4);
const $$createType6 = $models.PlatformInfo.createFrom;
const $$createType7 = $Create.Nullable($$createType6);
const $$createType8 = $models.FileInfo.createFrom;
const $$createType9 = $Create.Array($$createType8);
const $$createType10 = $models.ProjectStatus.createFrom;
const $$createType11 = $Create.Nullable($$createType10);
const $$createType12 = $models.TreeNode.createFrom;
const $$createType13 = $Create.Array($$createType12);
const $$createType14 = $models.UserInfo.createFrom;
const $$createType15 = $Create.Nullable($$createType14);

View File

@@ -0,0 +1,19 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import * as AppService from "./appservice.js";
export {
AppService
};
export {
BranchInfo,
CommitFileInfo,
CommitLog,
FileInfo,
PlatformInfo,
ProjectStatus,
TreeNode,
UserInfo
} from "./models.js";

View File

@@ -0,0 +1,396 @@
// @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";
/**
* BranchInfo 分支信息
*/
export class BranchInfo {
/**
* Creates a new BranchInfo instance.
* @param {Partial<BranchInfo>} [$$source = {}] - The source object to create the BranchInfo.
*/
constructor($$source = {}) {
if (!("name" in $$source)) {
/**
* @member
* @type {string}
*/
this["name"] = "";
}
if (!("current" in $$source)) {
/**
* @member
* @type {boolean}
*/
this["current"] = false;
}
Object.assign(this, $$source);
}
/**
* Creates a new BranchInfo instance from a string or object.
* @param {any} [$$source = {}]
* @returns {BranchInfo}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new BranchInfo(/** @type {Partial<BranchInfo>} */($$parsedSource));
}
}
/**
* CommitFileInfo 提交中的文件变更信息
*/
export class CommitFileInfo {
/**
* Creates a new CommitFileInfo instance.
* @param {Partial<CommitFileInfo>} [$$source = {}] - The source object to create the CommitFileInfo.
*/
constructor($$source = {}) {
if (!("status" in $$source)) {
/**
* @member
* @type {string}
*/
this["status"] = "";
}
if (!("filePath" in $$source)) {
/**
* @member
* @type {string}
*/
this["filePath"] = "";
}
Object.assign(this, $$source);
}
/**
* Creates a new CommitFileInfo instance from a string or object.
* @param {any} [$$source = {}]
* @returns {CommitFileInfo}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new CommitFileInfo(/** @type {Partial<CommitFileInfo>} */($$parsedSource));
}
}
/**
* CommitLog 提交记录
*/
export class CommitLog {
/**
* Creates a new CommitLog instance.
* @param {Partial<CommitLog>} [$$source = {}] - The source object to create the CommitLog.
*/
constructor($$source = {}) {
if (!("hash" in $$source)) {
/**
* @member
* @type {string}
*/
this["hash"] = "";
}
if (!("shortHash" in $$source)) {
/**
* @member
* @type {string}
*/
this["shortHash"] = "";
}
if (!("author" in $$source)) {
/**
* @member
* @type {string}
*/
this["author"] = "";
}
if (!("email" in $$source)) {
/**
* @member
* @type {string}
*/
this["email"] = "";
}
if (!("timestamp" in $$source)) {
/**
* @member
* @type {number}
*/
this["timestamp"] = 0;
}
if (!("message" in $$source)) {
/**
* @member
* @type {string}
*/
this["message"] = "";
}
Object.assign(this, $$source);
}
/**
* Creates a new CommitLog instance from a string or object.
* @param {any} [$$source = {}]
* @returns {CommitLog}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new CommitLog(/** @type {Partial<CommitLog>} */($$parsedSource));
}
}
/**
* FileInfo 文件信息
*/
export class FileInfo {
/**
* Creates a new FileInfo instance.
* @param {Partial<FileInfo>} [$$source = {}] - The source object to create the FileInfo.
*/
constructor($$source = {}) {
if (!("status" in $$source)) {
/**
* @member
* @type {string}
*/
this["status"] = "";
}
if (!("statusText" in $$source)) {
/**
* @member
* @type {string}
*/
this["statusText"] = "";
}
if (!("filePath" in $$source)) {
/**
* @member
* @type {string}
*/
this["filePath"] = "";
}
if (!("staged" in $$source)) {
/**
* @member
* @type {boolean}
*/
this["staged"] = false;
}
Object.assign(this, $$source);
}
/**
* Creates a new FileInfo instance from a string or object.
* @param {any} [$$source = {}]
* @returns {FileInfo}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new FileInfo(/** @type {Partial<FileInfo>} */($$parsedSource));
}
}
/**
* PlatformInfo 平台信息
*/
export class PlatformInfo {
/**
* Creates a new PlatformInfo instance.
* @param {Partial<PlatformInfo>} [$$source = {}] - The source object to create the PlatformInfo.
*/
constructor($$source = {}) {
if (!("name" in $$source)) {
/**
* @member
* @type {string}
*/
this["name"] = "";
}
if (!("baseUrl" in $$source)) {
/**
* @member
* @type {string}
*/
this["baseUrl"] = "";
}
Object.assign(this, $$source);
}
/**
* Creates a new PlatformInfo instance from a string or object.
* @param {any} [$$source = {}]
* @returns {PlatformInfo}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new PlatformInfo(/** @type {Partial<PlatformInfo>} */($$parsedSource));
}
}
/**
* ProjectStatus 项目状态信息
*/
export class ProjectStatus {
/**
* Creates a new ProjectStatus instance.
* @param {Partial<ProjectStatus>} [$$source = {}] - The source object to create the ProjectStatus.
*/
constructor($$source = {}) {
if (!("branch" in $$source)) {
/**
* @member
* @type {string}
*/
this["branch"] = "";
}
if (!("remoteUrl" in $$source)) {
/**
* @member
* @type {string}
*/
this["remoteUrl"] = "";
}
if (!("changedFiles" in $$source)) {
/**
* @member
* @type {FileInfo[]}
*/
this["changedFiles"] = [];
}
Object.assign(this, $$source);
}
/**
* Creates a new ProjectStatus instance from a string or object.
* @param {any} [$$source = {}]
* @returns {ProjectStatus}
*/
static createFrom($$source = {}) {
const $$createField2_0 = $$createType1;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("changedFiles" in $$parsedSource) {
$$parsedSource["changedFiles"] = $$createField2_0($$parsedSource["changedFiles"]);
}
return new ProjectStatus(/** @type {Partial<ProjectStatus>} */($$parsedSource));
}
}
/**
* TreeNode 前端侧边栏树节点
*/
export class TreeNode {
/**
* Creates a new TreeNode instance.
* @param {Partial<TreeNode>} [$$source = {}] - The source object to create the TreeNode.
*/
constructor($$source = {}) {
if (!("key" in $$source)) {
/**
* @member
* @type {string}
*/
this["key"] = "";
}
if (!("label" in $$source)) {
/**
* @member
* @type {string}
*/
this["label"] = "";
}
if (!("type" in $$source)) {
/**
* platform, user, project
* @member
* @type {string}
*/
this["type"] = "";
}
if (/** @type {any} */(false)) {
/**
* @member
* @type {string | undefined}
*/
this["path"] = undefined;
}
if (/** @type {any} */(false)) {
/**
* @member
* @type {TreeNode[] | undefined}
*/
this["children"] = undefined;
}
Object.assign(this, $$source);
}
/**
* Creates a new TreeNode instance from a string or object.
* @param {any} [$$source = {}]
* @returns {TreeNode}
*/
static createFrom($$source = {}) {
const $$createField4_0 = $$createType3;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("children" in $$parsedSource) {
$$parsedSource["children"] = $$createField4_0($$parsedSource["children"]);
}
return new TreeNode(/** @type {Partial<TreeNode>} */($$parsedSource));
}
}
/**
* UserInfo 用户信息
*/
export class UserInfo {
/**
* Creates a new UserInfo instance.
* @param {Partial<UserInfo>} [$$source = {}] - The source object to create the UserInfo.
*/
constructor($$source = {}) {
if (!("username" in $$source)) {
/**
* @member
* @type {string}
*/
this["username"] = "";
}
if (!("token" in $$source)) {
/**
* @member
* @type {string}
*/
this["token"] = "";
}
Object.assign(this, $$source);
}
/**
* Creates a new UserInfo instance from a string or object.
* @param {any} [$$source = {}]
* @returns {UserInfo}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new UserInfo(/** @type {Partial<UserInfo>} */($$parsedSource));
}
}
// Private type creation functions
const $$createType0 = FileInfo.createFrom;
const $$createType1 = $Create.Array($$createType0);
const $$createType2 = TreeNode.createFrom;
const $$createType3 = $Create.Array($$createType2);

View File

@@ -0,0 +1,7 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export {
Logger
} from "./models.js";

View File

@@ -0,0 +1,36 @@
// @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";
/**
* A Logger records structured information about each call to its
* Log, Debug, Info, Warn, and Error methods.
* For each call, it creates a [Record] and passes it to a [Handler].
*
* To create a new Logger, call [New] or a Logger method
* that begins "With".
*/
export class Logger {
/**
* Creates a new Logger instance.
* @param {Partial<Logger>} [$$source = {}] - The source object to create the Logger.
*/
constructor($$source = {}) {
Object.assign(this, $$source);
}
/**
* Creates a new Logger instance from a string or object.
* @param {any} [$$source = {}]
* @returns {Logger}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new Logger(/** @type {Partial<Logger>} */($$parsedSource));
}
}