1
0

models.js 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. // @ts-check
  2. // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
  3. // This file is automatically generated. DO NOT EDIT
  4. // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  5. // @ts-ignore: Unused imports
  6. import { Create as $Create } from "@wailsio/runtime";
  7. /**
  8. * Config AI 接入商配置(单行存储)。
  9. */
  10. export class Config {
  11. /**
  12. * Creates a new Config instance.
  13. * @param {Partial<Config>} [$$source = {}] - The source object to create the Config.
  14. */
  15. constructor($$source = {}) {
  16. if (!("provider" in $$source)) {
  17. /**
  18. * openai | ollama
  19. * @member
  20. * @type {string}
  21. */
  22. this["provider"] = "";
  23. }
  24. if (!("baseURL" in $$source)) {
  25. /**
  26. * @member
  27. * @type {string}
  28. */
  29. this["baseURL"] = "";
  30. }
  31. if (!("apiKey" in $$source)) {
  32. /**
  33. * @member
  34. * @type {string}
  35. */
  36. this["apiKey"] = "";
  37. }
  38. if (!("model" in $$source)) {
  39. /**
  40. * @member
  41. * @type {string}
  42. */
  43. this["model"] = "";
  44. }
  45. Object.assign(this, $$source);
  46. }
  47. /**
  48. * Creates a new Config instance from a string or object.
  49. * @param {any} [$$source = {}]
  50. * @returns {Config}
  51. */
  52. static createFrom($$source = {}) {
  53. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  54. return new Config(/** @type {Partial<Config>} */($$parsedSource));
  55. }
  56. }
  57. /**
  58. * FileEntry 目录扫描结果中的单个文件。
  59. */
  60. export class FileEntry {
  61. /**
  62. * Creates a new FileEntry instance.
  63. * @param {Partial<FileEntry>} [$$source = {}] - The source object to create the FileEntry.
  64. */
  65. constructor($$source = {}) {
  66. if (!("name" in $$source)) {
  67. /**
  68. * 相对路径(递归时 ToSlash)
  69. * @member
  70. * @type {string}
  71. */
  72. this["name"] = "";
  73. }
  74. if (!("size" in $$source)) {
  75. /**
  76. * 字节数
  77. * @member
  78. * @type {number}
  79. */
  80. this["size"] = 0;
  81. }
  82. if (!("modTime" in $$source)) {
  83. /**
  84. * 修改时间 "2006-01-02 15:04"
  85. * @member
  86. * @type {string}
  87. */
  88. this["modTime"] = "";
  89. }
  90. Object.assign(this, $$source);
  91. }
  92. /**
  93. * Creates a new FileEntry instance from a string or object.
  94. * @param {any} [$$source = {}]
  95. * @returns {FileEntry}
  96. */
  97. static createFrom($$source = {}) {
  98. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  99. return new FileEntry(/** @type {Partial<FileEntry>} */($$parsedSource));
  100. }
  101. }
  102. /**
  103. * History 一次批量重命名的历史记录。
  104. */
  105. export class History {
  106. /**
  107. * Creates a new History instance.
  108. * @param {Partial<History>} [$$source = {}] - The source object to create the History.
  109. */
  110. constructor($$source = {}) {
  111. if (!("id" in $$source)) {
  112. /**
  113. * @member
  114. * @type {number}
  115. */
  116. this["id"] = 0;
  117. }
  118. if (!("createdAt" in $$source)) {
  119. /**
  120. * @member
  121. * @type {string}
  122. */
  123. this["createdAt"] = "";
  124. }
  125. if (!("dir" in $$source)) {
  126. /**
  127. * @member
  128. * @type {string}
  129. */
  130. this["dir"] = "";
  131. }
  132. if (!("count" in $$source)) {
  133. /**
  134. * @member
  135. * @type {number}
  136. */
  137. this["count"] = 0;
  138. }
  139. if (!("undone" in $$source)) {
  140. /**
  141. * 该批次是否已撤回
  142. * @member
  143. * @type {boolean}
  144. */
  145. this["undone"] = false;
  146. }
  147. if (!("details" in $$source)) {
  148. /**
  149. * @member
  150. * @type {HistoryItem[]}
  151. */
  152. this["details"] = [];
  153. }
  154. Object.assign(this, $$source);
  155. }
  156. /**
  157. * Creates a new History instance from a string or object.
  158. * @param {any} [$$source = {}]
  159. * @returns {History}
  160. */
  161. static createFrom($$source = {}) {
  162. const $$createField5_0 = $$createType1;
  163. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  164. if ("details" in $$parsedSource) {
  165. $$parsedSource["details"] = $$createField5_0($$parsedSource["details"]);
  166. }
  167. return new History(/** @type {Partial<History>} */($$parsedSource));
  168. }
  169. }
  170. /**
  171. * HistoryItem 单个文件的重命名记录。
  172. */
  173. export class HistoryItem {
  174. /**
  175. * Creates a new HistoryItem instance.
  176. * @param {Partial<HistoryItem>} [$$source = {}] - The source object to create the HistoryItem.
  177. */
  178. constructor($$source = {}) {
  179. if (!("from" in $$source)) {
  180. /**
  181. * @member
  182. * @type {string}
  183. */
  184. this["from"] = "";
  185. }
  186. if (!("to" in $$source)) {
  187. /**
  188. * @member
  189. * @type {string}
  190. */
  191. this["to"] = "";
  192. }
  193. Object.assign(this, $$source);
  194. }
  195. /**
  196. * Creates a new HistoryItem instance from a string or object.
  197. * @param {any} [$$source = {}]
  198. * @returns {HistoryItem}
  199. */
  200. static createFrom($$source = {}) {
  201. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  202. return new HistoryItem(/** @type {Partial<HistoryItem>} */($$parsedSource));
  203. }
  204. }
  205. /**
  206. * Pair 一对「旧文件名 → 新文件名」。
  207. */
  208. export class Pair {
  209. /**
  210. * Creates a new Pair instance.
  211. * @param {Partial<Pair>} [$$source = {}] - The source object to create the Pair.
  212. */
  213. constructor($$source = {}) {
  214. if (!("from" in $$source)) {
  215. /**
  216. * @member
  217. * @type {string}
  218. */
  219. this["from"] = "";
  220. }
  221. if (!("to" in $$source)) {
  222. /**
  223. * @member
  224. * @type {string}
  225. */
  226. this["to"] = "";
  227. }
  228. Object.assign(this, $$source);
  229. }
  230. /**
  231. * Creates a new Pair instance from a string or object.
  232. * @param {any} [$$source = {}]
  233. * @returns {Pair}
  234. */
  235. static createFrom($$source = {}) {
  236. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  237. return new Pair(/** @type {Partial<Pair>} */($$parsedSource));
  238. }
  239. }
  240. /**
  241. * PreviewEntry AI 预览结果行。
  242. */
  243. export class PreviewEntry {
  244. /**
  245. * Creates a new PreviewEntry instance.
  246. * @param {Partial<PreviewEntry>} [$$source = {}] - The source object to create the PreviewEntry.
  247. */
  248. constructor($$source = {}) {
  249. if (!("from" in $$source)) {
  250. /**
  251. * @member
  252. * @type {string}
  253. */
  254. this["from"] = "";
  255. }
  256. if (!("to" in $$source)) {
  257. /**
  258. * @member
  259. * @type {string}
  260. */
  261. this["to"] = "";
  262. }
  263. if (!("status" in $$source)) {
  264. /**
  265. * ok | same | error
  266. * @member
  267. * @type {string}
  268. */
  269. this["status"] = "";
  270. }
  271. if (/** @type {any} */(false)) {
  272. /**
  273. * @member
  274. * @type {string | undefined}
  275. */
  276. this["reason"] = undefined;
  277. }
  278. Object.assign(this, $$source);
  279. }
  280. /**
  281. * Creates a new PreviewEntry instance from a string or object.
  282. * @param {any} [$$source = {}]
  283. * @returns {PreviewEntry}
  284. */
  285. static createFrom($$source = {}) {
  286. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  287. return new PreviewEntry(/** @type {Partial<PreviewEntry>} */($$parsedSource));
  288. }
  289. }
  290. /**
  291. * ScanResult 目录扫描结果。
  292. */
  293. export class ScanResult {
  294. /**
  295. * Creates a new ScanResult instance.
  296. * @param {Partial<ScanResult>} [$$source = {}] - The source object to create the ScanResult.
  297. */
  298. constructor($$source = {}) {
  299. if (!("dir" in $$source)) {
  300. /**
  301. * 绝对目录路径
  302. * @member
  303. * @type {string}
  304. */
  305. this["dir"] = "";
  306. }
  307. if (!("files" in $$source)) {
  308. /**
  309. * 文件列表(按名称排序)
  310. * @member
  311. * @type {FileEntry[]}
  312. */
  313. this["files"] = [];
  314. }
  315. Object.assign(this, $$source);
  316. }
  317. /**
  318. * Creates a new ScanResult instance from a string or object.
  319. * @param {any} [$$source = {}]
  320. * @returns {ScanResult}
  321. */
  322. static createFrom($$source = {}) {
  323. const $$createField1_0 = $$createType3;
  324. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  325. if ("files" in $$parsedSource) {
  326. $$parsedSource["files"] = $$createField1_0($$parsedSource["files"]);
  327. }
  328. return new ScanResult(/** @type {Partial<ScanResult>} */($$parsedSource));
  329. }
  330. }
  331. // Private type creation functions
  332. const $$createType0 = HistoryItem.createFrom;
  333. const $$createType1 = $Create.Array($$createType0);
  334. const $$createType2 = FileEntry.createFrom;
  335. const $$createType3 = $Create.Array($$createType2);