🎨 Updated

This commit is contained in:
2025-06-05 02:11:36 +08:00
parent d9745ac7d1
commit 3e20f47b8e
17 changed files with 354 additions and 1053 deletions

View File

@@ -299,16 +299,6 @@ export class EditingConfig {
*/
"autoSaveDelay": number;
/**
* 变更字符阈值
*/
"changeThreshold": number;
/**
* 最小保存间隔(毫秒)
*/
"minSaveInterval": number;
/** Creates a new EditingConfig instance. */
constructor($$source: Partial<EditingConfig> = {}) {
if (!("fontSize" in $$source)) {
@@ -335,12 +325,6 @@ export class EditingConfig {
if (!("autoSaveDelay" in $$source)) {
this["autoSaveDelay"] = 0;
}
if (!("changeThreshold" in $$source)) {
this["changeThreshold"] = 0;
}
if (!("minSaveInterval" in $$source)) {
this["minSaveInterval"] = 0;
}
Object.assign(this, $$source);
}

View File

@@ -0,0 +1,19 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
/**
* DialogService 对话框服务,处理文件选择等对话框操作
* @module
*/
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
/**
* SelectDirectory 打开目录选择对话框
*/
export function SelectDirectory(): Promise<string> & { cancel(): void } {
let $resultPromise = $Call.ByID(2249533621) as any;
return $resultPromise;
}

View File

@@ -14,10 +14,6 @@ import {Call as $Call, Create as $Create} from "@wailsio/runtime";
// @ts-ignore: Unused imports
import * as models$0 from "../models/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";
/**
* ForceSave 强制保存当前文档
*/
@@ -46,30 +42,6 @@ export function GetActiveDocumentContent(): Promise<string> & { cancel(): void }
return $resultPromise;
}
/**
* GetDiffInfo 获取两个文本之间的详细差异信息
*/
export function GetDiffInfo(oldText: string, newText: string): Promise<$models.DiffResult> & { cancel(): void } {
let $resultPromise = $Call.ByID(2490726526, oldText, newText) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
/**
* GetSaveSettings 获取文档保存设置
*/
export function GetSaveSettings(): Promise<models$0.EditingConfig | null> & { cancel(): void } {
let $resultPromise = $Call.ByID(4257471801) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType4($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
/**
* Initialize 初始化文档服务
*/
@@ -79,15 +51,7 @@ export function Initialize(): Promise<void> & { cancel(): void } {
}
/**
* LoadDefaultDocument 加载默认文档
*/
export function LoadDefaultDocument(): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(2343023569) as any;
return $resultPromise;
}
/**
* SaveDocumentSync 同步保存文档内容 (用于页面关闭前同步保存)
* SaveDocumentSync 同步保存文档内容
*/
export function SaveDocumentSync(content: string): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(3770207288, content) as any;
@@ -95,29 +59,13 @@ export function SaveDocumentSync(content: string): Promise<void> & { cancel(): v
}
/**
* ServiceShutdown 实现应用程序关闭时的服务关闭逻辑
* ServiceShutdown 服务关闭
*/
export function ServiceShutdown(): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(638578044) as any;
return $resultPromise;
}
/**
* SetSaveCallback 设置保存回调函数
*/
export function SetSaveCallback(callback: any): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(675315211, callback) as any;
return $resultPromise;
}
/**
* Shutdown 关闭文档服务,确保所有数据保存
*/
export function Shutdown(): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(3444504909) as any;
return $resultPromise;
}
/**
* UpdateActiveDocumentContent 更新当前活动文档内容
*/
@@ -126,17 +74,6 @@ export function UpdateActiveDocumentContent(content: string): Promise<void> & {
return $resultPromise;
}
/**
* UpdateSaveSettings 更新文档保存设置
*/
export function UpdateSaveSettings(docConfig: models$0.EditingConfig): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(1245479534, docConfig) as any;
return $resultPromise;
}
// Private type creation functions
const $$createType0 = models$0.Document.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $models.DiffResult.createFrom;
const $$createType3 = models$0.EditingConfig.createFrom;
const $$createType4 = $Create.Nullable($$createType3);

View File

@@ -2,11 +2,13 @@
// This file is automatically generated. DO NOT EDIT
import * as ConfigService from "./configservice.js";
import * as DialogService from "./dialogservice.js";
import * as DocumentService from "./documentservice.js";
import * as HotkeyService from "./hotkeyservice.js";
import * as SystemService from "./systemservice.js";
export {
ConfigService,
DialogService,
DocumentService,
HotkeyService,
SystemService

View File

@@ -5,137 +5,6 @@
// @ts-ignore: Unused imports
import {Create as $Create} from "@wailsio/runtime";
/**
* DiffResult 包含差异比较的结果信息
*/
export class DiffResult {
/**
* 编辑操作列表
*/
"Edits": Edit[];
/**
* 插入的字符数
*/
"InsertCount": number;
/**
* 删除的字符数
*/
"DeleteCount": number;
/**
* 变更的行数
*/
"ChangedLines": number;
/**
* 总变更字符数(插入+删除)
*/
"TotalChanges": number;
/**
* 变更的token数如单词、标识符等
*/
"ChangedTokens": number;
/** Creates a new DiffResult instance. */
constructor($$source: Partial<DiffResult> = {}) {
if (!("Edits" in $$source)) {
this["Edits"] = [];
}
if (!("InsertCount" in $$source)) {
this["InsertCount"] = 0;
}
if (!("DeleteCount" in $$source)) {
this["DeleteCount"] = 0;
}
if (!("ChangedLines" in $$source)) {
this["ChangedLines"] = 0;
}
if (!("TotalChanges" in $$source)) {
this["TotalChanges"] = 0;
}
if (!("ChangedTokens" in $$source)) {
this["ChangedTokens"] = 0;
}
Object.assign(this, $$source);
}
/**
* Creates a new DiffResult instance from a string or object.
*/
static createFrom($$source: any = {}): DiffResult {
const $$createField0_0 = $$createType1;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("Edits" in $$parsedSource) {
$$parsedSource["Edits"] = $$createField0_0($$parsedSource["Edits"]);
}
return new DiffResult($$parsedSource as Partial<DiffResult>);
}
}
/**
* Edit 表示单个编辑操作
*/
export class Edit {
/**
* 操作类型
*/
"Type": EditType;
/**
* 操作内容
*/
"Content": string;
/** Creates a new Edit instance. */
constructor($$source: Partial<Edit> = {}) {
if (!("Type" in $$source)) {
this["Type"] = (0 as EditType);
}
if (!("Content" in $$source)) {
this["Content"] = "";
}
Object.assign(this, $$source);
}
/**
* Creates a new Edit instance from a string or object.
*/
static createFrom($$source: any = {}): Edit {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new Edit($$parsedSource as Partial<Edit>);
}
}
/**
* Edit 表示编辑操作类型
*/
export enum EditType {
/**
* The Go zero value for the underlying type of the enum.
*/
$zero = 0,
/**
* EditInsert 插入操作
*/
EditInsert = 0,
/**
* EditDelete 删除操作
*/
EditDelete = 1,
/**
* EditEqual 相等部分
*/
EditEqual = 2,
};
/**
* MemoryStats 内存统计信息
*/
@@ -202,7 +71,3 @@ export class MemoryStats {
return new MemoryStats($$parsedSource as Partial<MemoryStats>);
}
}
// Private type creation functions
const $$createType0 = Edit.createFrom;
const $$createType1 = $Create.Array($$createType0);