// @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"; /** * Config AI 接入商配置(单行存储)。 */ export class Config { /** * Creates a new Config instance. * @param {Partial} [$$source = {}] - The source object to create the Config. */ constructor($$source = {}) { if (!("provider" in $$source)) { /** * openai | ollama * @member * @type {string} */ this["provider"] = ""; } if (!("baseURL" in $$source)) { /** * @member * @type {string} */ this["baseURL"] = ""; } if (!("apiKey" in $$source)) { /** * @member * @type {string} */ this["apiKey"] = ""; } if (!("model" in $$source)) { /** * @member * @type {string} */ this["model"] = ""; } Object.assign(this, $$source); } /** * Creates a new Config instance from a string or object. * @param {any} [$$source = {}] * @returns {Config} */ static createFrom($$source = {}) { let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; return new Config(/** @type {Partial} */($$parsedSource)); } } /** * FileEntry 目录扫描结果中的单个文件。 */ export class FileEntry { /** * Creates a new FileEntry instance. * @param {Partial} [$$source = {}] - The source object to create the FileEntry. */ constructor($$source = {}) { if (!("name" in $$source)) { /** * 相对路径(递归时 ToSlash) * @member * @type {string} */ this["name"] = ""; } if (!("size" in $$source)) { /** * 字节数 * @member * @type {number} */ this["size"] = 0; } if (!("modTime" in $$source)) { /** * 修改时间 "2006-01-02 15:04" * @member * @type {string} */ this["modTime"] = ""; } Object.assign(this, $$source); } /** * Creates a new FileEntry instance from a string or object. * @param {any} [$$source = {}] * @returns {FileEntry} */ static createFrom($$source = {}) { let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; return new FileEntry(/** @type {Partial} */($$parsedSource)); } } /** * History 一次批量重命名的历史记录。 */ export class History { /** * Creates a new History instance. * @param {Partial} [$$source = {}] - The source object to create the History. */ constructor($$source = {}) { if (!("id" in $$source)) { /** * @member * @type {number} */ this["id"] = 0; } if (!("createdAt" in $$source)) { /** * @member * @type {string} */ this["createdAt"] = ""; } if (!("dir" in $$source)) { /** * @member * @type {string} */ this["dir"] = ""; } if (!("count" in $$source)) { /** * @member * @type {number} */ this["count"] = 0; } if (!("undone" in $$source)) { /** * 该批次是否已撤回 * @member * @type {boolean} */ this["undone"] = false; } if (!("details" in $$source)) { /** * @member * @type {HistoryItem[]} */ this["details"] = []; } Object.assign(this, $$source); } /** * Creates a new History instance from a string or object. * @param {any} [$$source = {}] * @returns {History} */ static createFrom($$source = {}) { const $$createField5_0 = $$createType1; let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; if ("details" in $$parsedSource) { $$parsedSource["details"] = $$createField5_0($$parsedSource["details"]); } return new History(/** @type {Partial} */($$parsedSource)); } } /** * HistoryItem 单个文件的重命名记录。 */ export class HistoryItem { /** * Creates a new HistoryItem instance. * @param {Partial} [$$source = {}] - The source object to create the HistoryItem. */ constructor($$source = {}) { if (!("from" in $$source)) { /** * @member * @type {string} */ this["from"] = ""; } if (!("to" in $$source)) { /** * @member * @type {string} */ this["to"] = ""; } Object.assign(this, $$source); } /** * Creates a new HistoryItem instance from a string or object. * @param {any} [$$source = {}] * @returns {HistoryItem} */ static createFrom($$source = {}) { let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; return new HistoryItem(/** @type {Partial} */($$parsedSource)); } } /** * Pair 一对「旧文件名 → 新文件名」。 */ export class Pair { /** * Creates a new Pair instance. * @param {Partial} [$$source = {}] - The source object to create the Pair. */ constructor($$source = {}) { if (!("from" in $$source)) { /** * @member * @type {string} */ this["from"] = ""; } if (!("to" in $$source)) { /** * @member * @type {string} */ this["to"] = ""; } Object.assign(this, $$source); } /** * Creates a new Pair instance from a string or object. * @param {any} [$$source = {}] * @returns {Pair} */ static createFrom($$source = {}) { let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; return new Pair(/** @type {Partial} */($$parsedSource)); } } /** * PreviewEntry AI 预览结果行。 */ export class PreviewEntry { /** * Creates a new PreviewEntry instance. * @param {Partial} [$$source = {}] - The source object to create the PreviewEntry. */ constructor($$source = {}) { if (!("from" in $$source)) { /** * @member * @type {string} */ this["from"] = ""; } if (!("to" in $$source)) { /** * @member * @type {string} */ this["to"] = ""; } if (!("status" in $$source)) { /** * ok | same | error * @member * @type {string} */ this["status"] = ""; } if (/** @type {any} */(false)) { /** * @member * @type {string | undefined} */ this["reason"] = undefined; } Object.assign(this, $$source); } /** * Creates a new PreviewEntry instance from a string or object. * @param {any} [$$source = {}] * @returns {PreviewEntry} */ static createFrom($$source = {}) { let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; return new PreviewEntry(/** @type {Partial} */($$parsedSource)); } } /** * ScanResult 目录扫描结果。 */ export class ScanResult { /** * Creates a new ScanResult instance. * @param {Partial} [$$source = {}] - The source object to create the ScanResult. */ constructor($$source = {}) { if (!("dir" in $$source)) { /** * 绝对目录路径 * @member * @type {string} */ this["dir"] = ""; } if (!("files" in $$source)) { /** * 文件列表(按名称排序) * @member * @type {FileEntry[]} */ this["files"] = []; } Object.assign(this, $$source); } /** * Creates a new ScanResult instance from a string or object. * @param {any} [$$source = {}] * @returns {ScanResult} */ static createFrom($$source = {}) { const $$createField1_0 = $$createType3; let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; if ("files" in $$parsedSource) { $$parsedSource["files"] = $$createField1_0($$parsedSource["files"]); } return new ScanResult(/** @type {Partial} */($$parsedSource)); } } // Private type creation functions const $$createType0 = HistoryItem.createFrom; const $$createType1 = $Create.Array($$createType0); const $$createType2 = FileEntry.createFrom; const $$createType3 = $Create.Array($$createType2);