✨ Add configuration information file storage
This commit is contained in:
219
frontend/bindings/voidraft/internal/models/models.ts
Normal file
219
frontend/bindings/voidraft/internal/models/models.ts
Normal file
@@ -0,0 +1,219 @@
|
||||
// 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 {
|
||||
/**
|
||||
* 编辑器配置
|
||||
*/
|
||||
"editor": EditorConfig;
|
||||
|
||||
/**
|
||||
* 路径配置
|
||||
*/
|
||||
"paths": PathConfig;
|
||||
|
||||
/**
|
||||
* 配置元数据
|
||||
*/
|
||||
"metadata": ConfigMetadata;
|
||||
|
||||
/** Creates a new AppConfig instance. */
|
||||
constructor($$source: Partial<AppConfig> = {}) {
|
||||
if (!("editor" in $$source)) {
|
||||
this["editor"] = (new EditorConfig());
|
||||
}
|
||||
if (!("paths" in $$source)) {
|
||||
this["paths"] = (new PathConfig());
|
||||
}
|
||||
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;
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
if ("editor" in $$parsedSource) {
|
||||
$$parsedSource["editor"] = $$createField0_0($$parsedSource["editor"]);
|
||||
}
|
||||
if ("paths" in $$parsedSource) {
|
||||
$$parsedSource["paths"] = $$createField1_0($$parsedSource["paths"]);
|
||||
}
|
||||
if ("metadata" in $$parsedSource) {
|
||||
$$parsedSource["metadata"] = $$createField2_0($$parsedSource["metadata"]);
|
||||
}
|
||||
return new AppConfig($$parsedSource as Partial<AppConfig>);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ConfigMetadata 配置元数据
|
||||
*/
|
||||
export class ConfigMetadata {
|
||||
/**
|
||||
* 配置版本
|
||||
*/
|
||||
"version": string;
|
||||
|
||||
/**
|
||||
* 最后更新时间
|
||||
*/
|
||||
"lastUpdated": time$0.Time;
|
||||
|
||||
/** Creates a new ConfigMetadata instance. */
|
||||
constructor($$source: Partial<ConfigMetadata> = {}) {
|
||||
if (!("version" in $$source)) {
|
||||
this["version"] = "";
|
||||
}
|
||||
if (!("lastUpdated" in $$source)) {
|
||||
this["lastUpdated"] = null;
|
||||
}
|
||||
|
||||
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>);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* EditorConfig 定义编辑器配置
|
||||
*/
|
||||
export class EditorConfig {
|
||||
/**
|
||||
* 字体大小
|
||||
*/
|
||||
"fontSize": number;
|
||||
|
||||
/**
|
||||
* 文件保存的编码
|
||||
*/
|
||||
"encoding": string;
|
||||
|
||||
/**
|
||||
* 是否启用Tab缩进
|
||||
*/
|
||||
"enableTabIndent": boolean;
|
||||
|
||||
/**
|
||||
* Tab大小
|
||||
*/
|
||||
"tabSize": number;
|
||||
|
||||
/**
|
||||
* Tab类型(空格或Tab)
|
||||
*/
|
||||
"tabType": TabType;
|
||||
|
||||
/** Creates a new EditorConfig instance. */
|
||||
constructor($$source: Partial<EditorConfig> = {}) {
|
||||
if (!("fontSize" in $$source)) {
|
||||
this["fontSize"] = 0;
|
||||
}
|
||||
if (!("encoding" in $$source)) {
|
||||
this["encoding"] = "";
|
||||
}
|
||||
if (!("enableTabIndent" in $$source)) {
|
||||
this["enableTabIndent"] = false;
|
||||
}
|
||||
if (!("tabSize" in $$source)) {
|
||||
this["tabSize"] = 0;
|
||||
}
|
||||
if (!("tabType" in $$source)) {
|
||||
this["tabType"] = ("" as TabType);
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new EditorConfig instance from a string or object.
|
||||
*/
|
||||
static createFrom($$source: any = {}): EditorConfig {
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
return new EditorConfig($$parsedSource as Partial<EditorConfig>);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* PathConfig 定义配置文件路径相关配置
|
||||
*/
|
||||
export class PathConfig {
|
||||
/**
|
||||
* 根目录
|
||||
*/
|
||||
"rootDir": string;
|
||||
|
||||
/**
|
||||
* 配置文件路径
|
||||
*/
|
||||
"configPath": string;
|
||||
|
||||
/** Creates a new PathConfig instance. */
|
||||
constructor($$source: Partial<PathConfig> = {}) {
|
||||
if (!("rootDir" in $$source)) {
|
||||
this["rootDir"] = "";
|
||||
}
|
||||
if (!("configPath" in $$source)) {
|
||||
this["configPath"] = "";
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new PathConfig instance from a string or object.
|
||||
*/
|
||||
static createFrom($$source: any = {}): PathConfig {
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
return new PathConfig($$parsedSource as Partial<PathConfig>);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TabType 定义了制表符类型
|
||||
*/
|
||||
export enum TabType {
|
||||
/**
|
||||
* The Go zero value for the underlying type of the enum.
|
||||
*/
|
||||
$zero = "",
|
||||
|
||||
/**
|
||||
* TabTypeSpaces 使用空格作为制表符
|
||||
*/
|
||||
TabTypeSpaces = "spaces",
|
||||
|
||||
/**
|
||||
* TabTypeTab 使用Tab作为制表符
|
||||
*/
|
||||
TabTypeTab = "tab",
|
||||
};
|
||||
|
||||
// Private type creation functions
|
||||
const $$createType0 = EditorConfig.createFrom;
|
||||
const $$createType1 = PathConfig.createFrom;
|
||||
const $$createType2 = ConfigMetadata.createFrom;
|
||||
Reference in New Issue
Block a user