| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358 |
- // @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<Config>} [$$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<Config>} */($$parsedSource));
- }
- }
- /**
- * FileEntry 目录扫描结果中的单个文件。
- */
- export class FileEntry {
- /**
- * Creates a new FileEntry instance.
- * @param {Partial<FileEntry>} [$$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<FileEntry>} */($$parsedSource));
- }
- }
- /**
- * History 一次批量重命名的历史记录。
- */
- export class History {
- /**
- * Creates a new History instance.
- * @param {Partial<History>} [$$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<History>} */($$parsedSource));
- }
- }
- /**
- * HistoryItem 单个文件的重命名记录。
- */
- export class HistoryItem {
- /**
- * Creates a new HistoryItem instance.
- * @param {Partial<HistoryItem>} [$$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<HistoryItem>} */($$parsedSource));
- }
- }
- /**
- * Pair 一对「旧文件名 → 新文件名」。
- */
- export class Pair {
- /**
- * Creates a new Pair instance.
- * @param {Partial<Pair>} [$$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<Pair>} */($$parsedSource));
- }
- }
- /**
- * PreviewEntry AI 预览结果行。
- */
- export class PreviewEntry {
- /**
- * Creates a new PreviewEntry instance.
- * @param {Partial<PreviewEntry>} [$$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<PreviewEntry>} */($$parsedSource));
- }
- }
- /**
- * ScanResult 目录扫描结果。
- */
- export class ScanResult {
- /**
- * Creates a new ScanResult instance.
- * @param {Partial<ScanResult>} [$$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<ScanResult>} */($$parsedSource));
- }
- }
- // Private type creation functions
- const $$createType0 = HistoryItem.createFrom;
- const $$createType1 = $Create.Array($$createType0);
- const $$createType2 = FileEntry.createFrom;
- const $$createType3 = $Create.Array($$createType2);
|