🎨 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

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