Files
voidraft/frontend/bindings/voidraft/internal/models/models.ts
2025-07-02 12:10:46 +08:00

1078 lines
24 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 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 time$0 from "../../../time/models.js";
/**
* AppConfig 应用配置 - 按照前端设置页面分类组织
*/
export class AppConfig {
/**
* 通用设置
*/
"general": GeneralConfig;
/**
* 编辑设置
*/
"editing": EditingConfig;
/**
* 外观设置
*/
"appearance": AppearanceConfig;
/**
* 更新设置
*/
"updates": UpdatesConfig;
/**
* 配置元数据
*/
"metadata": ConfigMetadata;
/** Creates a new AppConfig instance. */
constructor($$source: Partial<AppConfig> = {}) {
if (!("general" in $$source)) {
this["general"] = (new GeneralConfig());
}
if (!("editing" in $$source)) {
this["editing"] = (new EditingConfig());
}
if (!("appearance" in $$source)) {
this["appearance"] = (new AppearanceConfig());
}
if (!("updates" in $$source)) {
this["updates"] = (new UpdatesConfig());
}
if (!("metadata" in $$source)) {
this["metadata"] = (new ConfigMetadata());
}
Object.assign(this, $$source);
}
/**
* Creates a new AppConfig instance from a string or object.
*/
static createFrom($$source: any = {}): AppConfig {
const $$createField0_0 = $$createType0;
const $$createField1_0 = $$createType1;
const $$createField2_0 = $$createType2;
const $$createField3_0 = $$createType3;
const $$createField4_0 = $$createType4;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("general" in $$parsedSource) {
$$parsedSource["general"] = $$createField0_0($$parsedSource["general"]);
}
if ("editing" in $$parsedSource) {
$$parsedSource["editing"] = $$createField1_0($$parsedSource["editing"]);
}
if ("appearance" in $$parsedSource) {
$$parsedSource["appearance"] = $$createField2_0($$parsedSource["appearance"]);
}
if ("updates" in $$parsedSource) {
$$parsedSource["updates"] = $$createField3_0($$parsedSource["updates"]);
}
if ("metadata" in $$parsedSource) {
$$parsedSource["metadata"] = $$createField4_0($$parsedSource["metadata"]);
}
return new AppConfig($$parsedSource as Partial<AppConfig>);
}
}
/**
* AppearanceConfig 外观设置配置
*/
export class AppearanceConfig {
/**
* 界面语言
*/
"language": LanguageType;
/**
* 系统界面主题
*/
"systemTheme": SystemThemeType;
/** Creates a new AppearanceConfig instance. */
constructor($$source: Partial<AppearanceConfig> = {}) {
if (!("language" in $$source)) {
this["language"] = ("" as LanguageType);
}
if (!("systemTheme" in $$source)) {
this["systemTheme"] = ("" as SystemThemeType);
}
Object.assign(this, $$source);
}
/**
* Creates a new AppearanceConfig instance from a string or object.
*/
static createFrom($$source: any = {}): AppearanceConfig {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new AppearanceConfig($$parsedSource as Partial<AppearanceConfig>);
}
}
/**
* ConfigMetadata 配置元数据
*/
export class ConfigMetadata {
/**
* 最后更新时间
*/
"lastUpdated": string;
/**
* 配置版本号
*/
"version": string;
/** Creates a new ConfigMetadata instance. */
constructor($$source: Partial<ConfigMetadata> = {}) {
if (!("lastUpdated" in $$source)) {
this["lastUpdated"] = "";
}
if (!("version" in $$source)) {
this["version"] = "";
}
Object.assign(this, $$source);
}
/**
* Creates a new ConfigMetadata instance from a string or object.
*/
static createFrom($$source: any = {}): ConfigMetadata {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new ConfigMetadata($$parsedSource as Partial<ConfigMetadata>);
}
}
/**
* Document represents a document in the system
*/
export class Document {
"id": number;
"title": string;
"content": string;
"createdAt": time$0.Time;
"updatedAt": time$0.Time;
"is_deleted": boolean;
/** Creates a new Document instance. */
constructor($$source: Partial<Document> = {}) {
if (!("id" in $$source)) {
this["id"] = 0;
}
if (!("title" in $$source)) {
this["title"] = "";
}
if (!("content" in $$source)) {
this["content"] = "";
}
if (!("createdAt" in $$source)) {
this["createdAt"] = null;
}
if (!("updatedAt" in $$source)) {
this["updatedAt"] = null;
}
if (!("is_deleted" in $$source)) {
this["is_deleted"] = false;
}
Object.assign(this, $$source);
}
/**
* Creates a new Document instance from a string or object.
*/
static createFrom($$source: any = {}): Document {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new Document($$parsedSource as Partial<Document>);
}
}
/**
* EditingConfig 编辑设置配置
*/
export class EditingConfig {
/**
* 字体设置
* 字体大小
*/
"fontSize": number;
/**
* 字体族
*/
"fontFamily": string;
/**
* 字体粗细
*/
"fontWeight": string;
/**
* 行高
*/
"lineHeight": number;
/**
* Tab设置
* 是否启用Tab缩进
*/
"enableTabIndent": boolean;
/**
* Tab大小
*/
"tabSize": number;
/**
* Tab类型空格或Tab
*/
"tabType": TabType;
/**
* 保存选项
* 自动保存延迟(毫秒)
*/
"autoSaveDelay": number;
/** Creates a new EditingConfig instance. */
constructor($$source: Partial<EditingConfig> = {}) {
if (!("fontSize" in $$source)) {
this["fontSize"] = 0;
}
if (!("fontFamily" in $$source)) {
this["fontFamily"] = "";
}
if (!("fontWeight" in $$source)) {
this["fontWeight"] = "";
}
if (!("lineHeight" in $$source)) {
this["lineHeight"] = 0;
}
if (!("enableTabIndent" in $$source)) {
this["enableTabIndent"] = false;
}
if (!("tabSize" in $$source)) {
this["tabSize"] = 0;
}
if (!("tabType" in $$source)) {
this["tabType"] = ("" as TabType);
}
if (!("autoSaveDelay" in $$source)) {
this["autoSaveDelay"] = 0;
}
Object.assign(this, $$source);
}
/**
* Creates a new EditingConfig instance from a string or object.
*/
static createFrom($$source: any = {}): EditingConfig {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new EditingConfig($$parsedSource as Partial<EditingConfig>);
}
}
/**
* Extension 单个扩展配置
*/
export class Extension {
/**
* 扩展唯一标识
*/
"id": ExtensionID;
/**
* 是否启用
*/
"enabled": boolean;
/**
* 是否为默认扩展
*/
"isDefault": boolean;
/**
* 扩展配置项
*/
"config": ExtensionConfig;
/** Creates a new Extension instance. */
constructor($$source: Partial<Extension> = {}) {
if (!("id" in $$source)) {
this["id"] = ("" as ExtensionID);
}
if (!("enabled" in $$source)) {
this["enabled"] = false;
}
if (!("isDefault" in $$source)) {
this["isDefault"] = false;
}
if (!("config" in $$source)) {
this["config"] = ({} as ExtensionConfig);
}
Object.assign(this, $$source);
}
/**
* Creates a new Extension instance from a string or object.
*/
static createFrom($$source: any = {}): Extension {
const $$createField3_0 = $$createType5;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("config" in $$parsedSource) {
$$parsedSource["config"] = $$createField3_0($$parsedSource["config"]);
}
return new Extension($$parsedSource as Partial<Extension>);
}
}
/**
* ExtensionConfig 扩展配置项
*/
export type ExtensionConfig = { [_: string]: any };
/**
* ExtensionID 扩展标识符
*/
export enum ExtensionID {
/**
* The Go zero value for the underlying type of the enum.
*/
$zero = "",
/**
* 编辑增强扩展
* 彩虹括号
*/
ExtensionRainbowBrackets = "rainbowBrackets",
/**
* 超链接
*/
ExtensionHyperlink = "hyperlink",
/**
* 颜色选择器
*/
ExtensionColorSelector = "colorSelector",
ExtensionFold = "fold",
ExtensionTextHighlight = "textHighlight",
/**
* 选择框
*/
ExtensionCheckbox = "checkbox",
/**
* UI增强扩展
* 小地图
*/
ExtensionMinimap = "minimap",
/**
* 工具扩展
* 搜索功能
*/
ExtensionSearch = "search",
/**
* 核心扩展
* 编辑器核心功能
*/
ExtensionEditor = "editor",
};
/**
* GeneralConfig 通用设置配置
*/
export class GeneralConfig {
/**
* 窗口是否置顶
*/
"alwaysOnTop": boolean;
/**
* 数据存储路径
*/
"dataPath": string;
/**
* 是否启用系统托盘
*/
"enableSystemTray": boolean;
/**
* 开机启动设置
*/
"startAtLogin": boolean;
/**
* 全局热键设置
* 是否启用全局热键
*/
"enableGlobalHotkey": boolean;
/**
* 全局热键组合
*/
"globalHotkey": HotkeyCombo;
/** Creates a new GeneralConfig instance. */
constructor($$source: Partial<GeneralConfig> = {}) {
if (!("alwaysOnTop" in $$source)) {
this["alwaysOnTop"] = false;
}
if (!("dataPath" in $$source)) {
this["dataPath"] = "";
}
if (!("enableSystemTray" in $$source)) {
this["enableSystemTray"] = false;
}
if (!("startAtLogin" in $$source)) {
this["startAtLogin"] = false;
}
if (!("enableGlobalHotkey" in $$source)) {
this["enableGlobalHotkey"] = false;
}
if (!("globalHotkey" in $$source)) {
this["globalHotkey"] = (new HotkeyCombo());
}
Object.assign(this, $$source);
}
/**
* Creates a new GeneralConfig instance from a string or object.
*/
static createFrom($$source: any = {}): GeneralConfig {
const $$createField5_0 = $$createType7;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("globalHotkey" in $$parsedSource) {
$$parsedSource["globalHotkey"] = $$createField5_0($$parsedSource["globalHotkey"]);
}
return new GeneralConfig($$parsedSource as Partial<GeneralConfig>);
}
}
/**
* HotkeyCombo 热键组合定义
*/
export class HotkeyCombo {
/**
* Ctrl键
*/
"ctrl": boolean;
/**
* Shift键
*/
"shift": boolean;
/**
* Alt键
*/
"alt": boolean;
/**
* Win键
*/
"win": boolean;
/**
* 主键(如 'X', 'F1' 等)
*/
"key": string;
/** Creates a new HotkeyCombo instance. */
constructor($$source: Partial<HotkeyCombo> = {}) {
if (!("ctrl" in $$source)) {
this["ctrl"] = false;
}
if (!("shift" in $$source)) {
this["shift"] = false;
}
if (!("alt" in $$source)) {
this["alt"] = false;
}
if (!("win" in $$source)) {
this["win"] = false;
}
if (!("key" in $$source)) {
this["key"] = "";
}
Object.assign(this, $$source);
}
/**
* Creates a new HotkeyCombo instance from a string or object.
*/
static createFrom($$source: any = {}): HotkeyCombo {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new HotkeyCombo($$parsedSource as Partial<HotkeyCombo>);
}
}
/**
* KeyBinding 单个快捷键绑定
*/
export class KeyBinding {
/**
* 快捷键动作
*/
"command": KeyBindingCommand;
/**
* 所属扩展
*/
"extension": ExtensionID;
/**
* 快捷键组合(如 "Mod-f", "Ctrl-Shift-p"
*/
"key": string;
/**
* 是否启用
*/
"enabled": boolean;
/**
* 是否为默认快捷键
*/
"isDefault": boolean;
/** Creates a new KeyBinding instance. */
constructor($$source: Partial<KeyBinding> = {}) {
if (!("command" in $$source)) {
this["command"] = ("" as KeyBindingCommand);
}
if (!("extension" in $$source)) {
this["extension"] = ("" as ExtensionID);
}
if (!("key" in $$source)) {
this["key"] = "";
}
if (!("enabled" in $$source)) {
this["enabled"] = false;
}
if (!("isDefault" in $$source)) {
this["isDefault"] = false;
}
Object.assign(this, $$source);
}
/**
* Creates a new KeyBinding instance from a string or object.
*/
static createFrom($$source: any = {}): KeyBinding {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new KeyBinding($$parsedSource as Partial<KeyBinding>);
}
}
/**
* KeyBindingCommand 快捷键命令
*/
export enum KeyBindingCommand {
/**
* The Go zero value for the underlying type of the enum.
*/
$zero = "",
/**
* 搜索扩展相关
* 显示搜索
*/
ShowSearchCommand = "showSearch",
/**
* 隐藏搜索
*/
HideSearchCommand = "hideSearch",
/**
* 搜索切换大小写
*/
SearchToggleCaseCommand = "searchToggleCase",
/**
* 搜索切换整词
*/
SearchToggleWordCommand = "searchToggleWord",
/**
* 搜索切换正则
*/
SearchToggleRegexCommand = "searchToggleRegex",
/**
* 显示替换
*/
SearchShowReplaceCommand = "searchShowReplace",
/**
* 替换全部
*/
SearchReplaceAllCommand = "searchReplaceAll",
/**
* 代码块扩展相关
* 块内选择全部
*/
BlockSelectAllCommand = "blockSelectAll",
/**
* 在当前块后添加新块
*/
BlockAddAfterCurrentCommand = "blockAddAfterCurrent",
/**
* 在最后添加新块
*/
BlockAddAfterLastCommand = "blockAddAfterLast",
/**
* 在当前块前添加新块
*/
BlockAddBeforeCurrentCommand = "blockAddBeforeCurrent",
/**
* 跳转到上一个块
*/
BlockGotoPreviousCommand = "blockGotoPrevious",
/**
* 跳转到下一个块
*/
BlockGotoNextCommand = "blockGotoNext",
/**
* 选择上一个块
*/
BlockSelectPreviousCommand = "blockSelectPrevious",
/**
* 选择下一个块
*/
BlockSelectNextCommand = "blockSelectNext",
/**
* 删除当前块
*/
BlockDeleteCommand = "blockDelete",
/**
* 向上移动当前块
*/
BlockMoveUpCommand = "blockMoveUp",
/**
* 向下移动当前块
*/
BlockMoveDownCommand = "blockMoveDown",
/**
* 删除行
*/
BlockDeleteLineCommand = "blockDeleteLine",
/**
* 向上移动行
*/
BlockMoveLineUpCommand = "blockMoveLineUp",
/**
* 向下移动行
*/
BlockMoveLineDownCommand = "blockMoveLineDown",
/**
* 字符转置
*/
BlockTransposeCharsCommand = "blockTransposeChars",
/**
* 格式化代码块
*/
BlockFormatCommand = "blockFormat",
/**
* 复制
*/
BlockCopyCommand = "blockCopy",
/**
* 剪切
*/
BlockCutCommand = "blockCut",
/**
* 粘贴
*/
BlockPasteCommand = "blockPaste",
/**
* 代码折叠扩展相关
* 折叠代码
*/
FoldCodeCommand = "foldCode",
/**
* 展开代码
*/
UnfoldCodeCommand = "unfoldCode",
/**
* 折叠全部
*/
FoldAllCommand = "foldAll",
/**
* 展开全部
*/
UnfoldAllCommand = "unfoldAll",
/**
* 通用编辑扩展相关
* 光标按语法左移
*/
CursorSyntaxLeftCommand = "cursorSyntaxLeft",
/**
* 光标按语法右移
*/
CursorSyntaxRightCommand = "cursorSyntaxRight",
/**
* 按语法选择左侧
*/
SelectSyntaxLeftCommand = "selectSyntaxLeft",
/**
* 按语法选择右侧
*/
SelectSyntaxRightCommand = "selectSyntaxRight",
/**
* 向上复制行
*/
CopyLineUpCommand = "copyLineUp",
/**
* 向下复制行
*/
CopyLineDownCommand = "copyLineDown",
/**
* 插入空行
*/
InsertBlankLineCommand = "insertBlankLine",
/**
* 选择行
*/
SelectLineCommand = "selectLine",
/**
* 选择父级语法
*/
SelectParentSyntaxCommand = "selectParentSyntax",
/**
* 减少缩进
*/
IndentLessCommand = "indentLess",
/**
* 增加缩进
*/
IndentMoreCommand = "indentMore",
/**
* 缩进选择
*/
IndentSelectionCommand = "indentSelection",
/**
* 光标到匹配括号
*/
CursorMatchingBracketCommand = "cursorMatchingBracket",
/**
* 切换注释
*/
ToggleCommentCommand = "toggleComment",
/**
* 切换块注释
*/
ToggleBlockCommentCommand = "toggleBlockComment",
/**
* 插入新行并缩进
*/
InsertNewlineAndIndentCommand = "insertNewlineAndIndent",
/**
* 向后删除字符
*/
DeleteCharBackwardCommand = "deleteCharBackward",
/**
* 向前删除字符
*/
DeleteCharForwardCommand = "deleteCharForward",
/**
* 向后删除组
*/
DeleteGroupBackwardCommand = "deleteGroupBackward",
/**
* 向前删除组
*/
DeleteGroupForwardCommand = "deleteGroupForward",
/**
* 历史记录扩展相关
* 撤销
*/
HistoryUndoCommand = "historyUndo",
/**
* 重做
*/
HistoryRedoCommand = "historyRedo",
/**
* 撤销选择
*/
HistoryUndoSelectionCommand = "historyUndoSelection",
/**
* 重做选择
*/
HistoryRedoSelectionCommand = "historyRedoSelection",
/**
* 文本高亮扩展相关
* 切换文本高亮
*/
TextHighlightToggleCommand = "textHighlightToggle",
};
/**
* KeyBindingConfig 快捷键配置
*/
export class KeyBindingConfig {
/**
* 快捷键列表
*/
"keyBindings": KeyBinding[];
/**
* 配置元数据
*/
"metadata": KeyBindingMetadata;
/** Creates a new KeyBindingConfig instance. */
constructor($$source: Partial<KeyBindingConfig> = {}) {
if (!("keyBindings" in $$source)) {
this["keyBindings"] = [];
}
if (!("metadata" in $$source)) {
this["metadata"] = (new KeyBindingMetadata());
}
Object.assign(this, $$source);
}
/**
* Creates a new KeyBindingConfig instance from a string or object.
*/
static createFrom($$source: any = {}): KeyBindingConfig {
const $$createField0_0 = $$createType9;
const $$createField1_0 = $$createType10;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("keyBindings" in $$parsedSource) {
$$parsedSource["keyBindings"] = $$createField0_0($$parsedSource["keyBindings"]);
}
if ("metadata" in $$parsedSource) {
$$parsedSource["metadata"] = $$createField1_0($$parsedSource["metadata"]);
}
return new KeyBindingConfig($$parsedSource as Partial<KeyBindingConfig>);
}
}
/**
* KeyBindingMetadata 快捷键配置元数据
*/
export class KeyBindingMetadata {
/**
* 配置版本
*/
"version": string;
/**
* 最后更新时间
*/
"lastUpdated": string;
/** Creates a new KeyBindingMetadata instance. */
constructor($$source: Partial<KeyBindingMetadata> = {}) {
if (!("version" in $$source)) {
this["version"] = "";
}
if (!("lastUpdated" in $$source)) {
this["lastUpdated"] = "";
}
Object.assign(this, $$source);
}
/**
* Creates a new KeyBindingMetadata instance from a string or object.
*/
static createFrom($$source: any = {}): KeyBindingMetadata {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new KeyBindingMetadata($$parsedSource as Partial<KeyBindingMetadata>);
}
}
/**
* LanguageType 语言类型定义
*/
export enum LanguageType {
/**
* The Go zero value for the underlying type of the enum.
*/
$zero = "",
/**
* LangZhCN 中文简体
*/
LangZhCN = "zh-CN",
/**
* LangEnUS 英文-美国
*/
LangEnUS = "en-US",
};
/**
* SystemThemeType 系统主题类型定义
*/
export enum SystemThemeType {
/**
* The Go zero value for the underlying type of the enum.
*/
$zero = "",
/**
* SystemThemeDark 深色系统主题
*/
SystemThemeDark = "dark",
/**
* SystemThemeLight 浅色系统主题
*/
SystemThemeLight = "light",
/**
* SystemThemeAuto 跟随系统主题
*/
SystemThemeAuto = "auto",
};
/**
* TabType 定义了制表符类型
*/
export enum TabType {
/**
* The Go zero value for the underlying type of the enum.
*/
$zero = "",
/**
* TabTypeSpaces 使用空格作为制表符
*/
TabTypeSpaces = "spaces",
/**
* TabTypeTab 使用Tab作为制表符
*/
TabTypeTab = "tab",
};
/**
* UpdatesConfig 更新设置配置
*/
export class UpdatesConfig {
/**
* 当前版本号
*/
"version": string;
/**
* 是否自动更新
*/
"autoUpdate": boolean;
/** Creates a new UpdatesConfig instance. */
constructor($$source: Partial<UpdatesConfig> = {}) {
if (!("version" in $$source)) {
this["version"] = "";
}
if (!("autoUpdate" in $$source)) {
this["autoUpdate"] = false;
}
Object.assign(this, $$source);
}
/**
* Creates a new UpdatesConfig instance from a string or object.
*/
static createFrom($$source: any = {}): UpdatesConfig {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new UpdatesConfig($$parsedSource as Partial<UpdatesConfig>);
}
}
// Private type creation functions
const $$createType0 = GeneralConfig.createFrom;
const $$createType1 = EditingConfig.createFrom;
const $$createType2 = AppearanceConfig.createFrom;
const $$createType3 = UpdatesConfig.createFrom;
const $$createType4 = ConfigMetadata.createFrom;
var $$createType5 = (function $$initCreateType5(...args): any {
if ($$createType5 === $$initCreateType5) {
$$createType5 = $$createType6;
}
return $$createType5(...args);
});
const $$createType6 = $Create.Map($Create.Any, $Create.Any);
const $$createType7 = HotkeyCombo.createFrom;
const $$createType8 = KeyBinding.createFrom;
const $$createType9 = $Create.Array($$createType8);
const $$createType10 = KeyBindingMetadata.createFrom;