418 lines
11 KiB
TypeScript
418 lines
11 KiB
TypeScript
// 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 http$0 from "../../../net/http/models.js";
|
||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||
// @ts-ignore: Unused imports
|
||
import * as time$0 from "../../../time/models.js";
|
||
|
||
/**
|
||
* CancelFunc 取消订阅函数
|
||
* 调用此函数可以取消对配置的监听
|
||
*/
|
||
export type CancelFunc = any;
|
||
|
||
/**
|
||
* HttpRequest HTTP请求结构
|
||
*/
|
||
export class HttpRequest {
|
||
"method": string;
|
||
"url": string;
|
||
"headers": { [_: string]: string };
|
||
|
||
/**
|
||
* json, formdata, urlencoded, text, params, xml, html, javascript, binary
|
||
*/
|
||
"bodyType"?: string;
|
||
"body"?: any;
|
||
|
||
/** Creates a new HttpRequest instance. */
|
||
constructor($$source: Partial<HttpRequest> = {}) {
|
||
if (!("method" in $$source)) {
|
||
this["method"] = "";
|
||
}
|
||
if (!("url" in $$source)) {
|
||
this["url"] = "";
|
||
}
|
||
if (!("headers" in $$source)) {
|
||
this["headers"] = {};
|
||
}
|
||
|
||
Object.assign(this, $$source);
|
||
}
|
||
|
||
/**
|
||
* Creates a new HttpRequest instance from a string or object.
|
||
*/
|
||
static createFrom($$source: any = {}): HttpRequest {
|
||
const $$createField2_0 = $$createType0;
|
||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||
if ("headers" in $$parsedSource) {
|
||
$$parsedSource["headers"] = $$createField2_0($$parsedSource["headers"]);
|
||
}
|
||
return new HttpRequest($$parsedSource as Partial<HttpRequest>);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* HttpResponse HTTP响应结构
|
||
*/
|
||
export class HttpResponse {
|
||
/**
|
||
* 使用resp.Status()返回完整状态如"200 OK"
|
||
*/
|
||
"status": string;
|
||
|
||
/**
|
||
* 响应时间(毫秒)
|
||
*/
|
||
"time": number;
|
||
|
||
/**
|
||
* 请求大小
|
||
*/
|
||
"requestSize": string;
|
||
"body": any;
|
||
"headers": http$0.Header;
|
||
"timestamp": time$0.Time;
|
||
"error"?: any;
|
||
|
||
/** Creates a new HttpResponse instance. */
|
||
constructor($$source: Partial<HttpResponse> = {}) {
|
||
if (!("status" in $$source)) {
|
||
this["status"] = "";
|
||
}
|
||
if (!("time" in $$source)) {
|
||
this["time"] = 0;
|
||
}
|
||
if (!("requestSize" in $$source)) {
|
||
this["requestSize"] = "";
|
||
}
|
||
if (!("body" in $$source)) {
|
||
this["body"] = null;
|
||
}
|
||
if (!("headers" in $$source)) {
|
||
this["headers"] = ({} as http$0.Header);
|
||
}
|
||
if (!("timestamp" in $$source)) {
|
||
this["timestamp"] = null;
|
||
}
|
||
|
||
Object.assign(this, $$source);
|
||
}
|
||
|
||
/**
|
||
* Creates a new HttpResponse instance from a string or object.
|
||
*/
|
||
static createFrom($$source: any = {}): HttpResponse {
|
||
const $$createField4_0 = $$createType1;
|
||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||
if ("headers" in $$parsedSource) {
|
||
$$parsedSource["headers"] = $$createField4_0($$parsedSource["headers"]);
|
||
}
|
||
return new HttpResponse($$parsedSource as Partial<HttpResponse>);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* MemoryStats 内存统计信息
|
||
*/
|
||
export class MemoryStats {
|
||
/**
|
||
* 当前堆内存使用量(字节)
|
||
*/
|
||
"heapInUse": number;
|
||
|
||
/**
|
||
* 堆内存分配总量(字节)
|
||
*/
|
||
"heapAlloc": number;
|
||
|
||
/**
|
||
* 系统内存使用量(字节)
|
||
*/
|
||
"sys": number;
|
||
|
||
/**
|
||
* GC 次数
|
||
*/
|
||
"numGC": number;
|
||
|
||
/**
|
||
* GC 暂停时间(纳秒)
|
||
*/
|
||
"pauseTotalNs": number;
|
||
|
||
/**
|
||
* Goroutine 数量
|
||
*/
|
||
"numGoroutine": number;
|
||
|
||
/** Creates a new MemoryStats instance. */
|
||
constructor($$source: Partial<MemoryStats> = {}) {
|
||
if (!("heapInUse" in $$source)) {
|
||
this["heapInUse"] = 0;
|
||
}
|
||
if (!("heapAlloc" in $$source)) {
|
||
this["heapAlloc"] = 0;
|
||
}
|
||
if (!("sys" in $$source)) {
|
||
this["sys"] = 0;
|
||
}
|
||
if (!("numGC" in $$source)) {
|
||
this["numGC"] = 0;
|
||
}
|
||
if (!("pauseTotalNs" in $$source)) {
|
||
this["pauseTotalNs"] = 0;
|
||
}
|
||
if (!("numGoroutine" in $$source)) {
|
||
this["numGoroutine"] = 0;
|
||
}
|
||
|
||
Object.assign(this, $$source);
|
||
}
|
||
|
||
/**
|
||
* Creates a new MemoryStats instance from a string or object.
|
||
*/
|
||
static createFrom($$source: any = {}): MemoryStats {
|
||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||
return new MemoryStats($$parsedSource as Partial<MemoryStats>);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* MigrationProgress 迁移进度信息
|
||
*/
|
||
export class MigrationProgress {
|
||
"status": MigrationStatus;
|
||
"progress": number;
|
||
"error"?: string;
|
||
|
||
/** Creates a new MigrationProgress instance. */
|
||
constructor($$source: Partial<MigrationProgress> = {}) {
|
||
if (!("status" in $$source)) {
|
||
this["status"] = ("" as MigrationStatus);
|
||
}
|
||
if (!("progress" in $$source)) {
|
||
this["progress"] = 0;
|
||
}
|
||
|
||
Object.assign(this, $$source);
|
||
}
|
||
|
||
/**
|
||
* Creates a new MigrationProgress instance from a string or object.
|
||
*/
|
||
static createFrom($$source: any = {}): MigrationProgress {
|
||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||
return new MigrationProgress($$parsedSource as Partial<MigrationProgress>);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* MigrationStatus 迁移状态
|
||
*/
|
||
export enum MigrationStatus {
|
||
/**
|
||
* The Go zero value for the underlying type of the enum.
|
||
*/
|
||
$zero = "",
|
||
|
||
MigrationStatusMigrating = "migrating",
|
||
MigrationStatusCompleted = "completed",
|
||
MigrationStatusFailed = "failed",
|
||
};
|
||
|
||
/**
|
||
* OSInfo 操作系统信息
|
||
*/
|
||
export class OSInfo {
|
||
"id": string;
|
||
"name": string;
|
||
"version": string;
|
||
"branding": string;
|
||
|
||
/** Creates a new OSInfo instance. */
|
||
constructor($$source: Partial<OSInfo> = {}) {
|
||
if (!("id" in $$source)) {
|
||
this["id"] = "";
|
||
}
|
||
if (!("name" in $$source)) {
|
||
this["name"] = "";
|
||
}
|
||
if (!("version" in $$source)) {
|
||
this["version"] = "";
|
||
}
|
||
if (!("branding" in $$source)) {
|
||
this["branding"] = "";
|
||
}
|
||
|
||
Object.assign(this, $$source);
|
||
}
|
||
|
||
/**
|
||
* Creates a new OSInfo instance from a string or object.
|
||
*/
|
||
static createFrom($$source: any = {}): OSInfo {
|
||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||
return new OSInfo($$parsedSource as Partial<OSInfo>);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* ObserverCallback 观察者回调函数
|
||
*/
|
||
export type ObserverCallback = any;
|
||
|
||
/**
|
||
* SelfUpdateResult 自我更新结果
|
||
*/
|
||
export class SelfUpdateResult {
|
||
/**
|
||
* 是否有更新
|
||
*/
|
||
"hasUpdate": boolean;
|
||
|
||
/**
|
||
* 当前版本
|
||
*/
|
||
"currentVersion": string;
|
||
|
||
/**
|
||
* 最新版本
|
||
*/
|
||
"latestVersion": string;
|
||
|
||
/**
|
||
* 是否已应用更新
|
||
*/
|
||
"updateApplied": boolean;
|
||
|
||
/**
|
||
* 下载链接
|
||
*/
|
||
"assetURL": string;
|
||
|
||
/**
|
||
* 发布说明
|
||
*/
|
||
"releaseNotes": string;
|
||
|
||
/**
|
||
* 错误信息
|
||
*/
|
||
"error": string;
|
||
|
||
/**
|
||
* 更新源(github/gitea)
|
||
*/
|
||
"source": string;
|
||
|
||
/** Creates a new SelfUpdateResult instance. */
|
||
constructor($$source: Partial<SelfUpdateResult> = {}) {
|
||
if (!("hasUpdate" in $$source)) {
|
||
this["hasUpdate"] = false;
|
||
}
|
||
if (!("currentVersion" in $$source)) {
|
||
this["currentVersion"] = "";
|
||
}
|
||
if (!("latestVersion" in $$source)) {
|
||
this["latestVersion"] = "";
|
||
}
|
||
if (!("updateApplied" in $$source)) {
|
||
this["updateApplied"] = false;
|
||
}
|
||
if (!("assetURL" in $$source)) {
|
||
this["assetURL"] = "";
|
||
}
|
||
if (!("releaseNotes" in $$source)) {
|
||
this["releaseNotes"] = "";
|
||
}
|
||
if (!("error" in $$source)) {
|
||
this["error"] = "";
|
||
}
|
||
if (!("source" in $$source)) {
|
||
this["source"] = "";
|
||
}
|
||
|
||
Object.assign(this, $$source);
|
||
}
|
||
|
||
/**
|
||
* Creates a new SelfUpdateResult instance from a string or object.
|
||
*/
|
||
static createFrom($$source: any = {}): SelfUpdateResult {
|
||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||
return new SelfUpdateResult($$parsedSource as Partial<SelfUpdateResult>);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* SystemInfo 系统信息
|
||
*/
|
||
export class SystemInfo {
|
||
"os": string;
|
||
"arch": string;
|
||
"debug": boolean;
|
||
"osInfo": OSInfo | null;
|
||
"platformInfo": { [_: string]: any };
|
||
|
||
/** Creates a new SystemInfo instance. */
|
||
constructor($$source: Partial<SystemInfo> = {}) {
|
||
if (!("os" in $$source)) {
|
||
this["os"] = "";
|
||
}
|
||
if (!("arch" in $$source)) {
|
||
this["arch"] = "";
|
||
}
|
||
if (!("debug" in $$source)) {
|
||
this["debug"] = false;
|
||
}
|
||
if (!("osInfo" in $$source)) {
|
||
this["osInfo"] = null;
|
||
}
|
||
if (!("platformInfo" in $$source)) {
|
||
this["platformInfo"] = {};
|
||
}
|
||
|
||
Object.assign(this, $$source);
|
||
}
|
||
|
||
/**
|
||
* Creates a new SystemInfo instance from a string or object.
|
||
*/
|
||
static createFrom($$source: any = {}): SystemInfo {
|
||
const $$createField3_0 = $$createType5;
|
||
const $$createField4_0 = $$createType6;
|
||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||
if ("osInfo" in $$parsedSource) {
|
||
$$parsedSource["osInfo"] = $$createField3_0($$parsedSource["osInfo"]);
|
||
}
|
||
if ("platformInfo" in $$parsedSource) {
|
||
$$parsedSource["platformInfo"] = $$createField4_0($$parsedSource["platformInfo"]);
|
||
}
|
||
return new SystemInfo($$parsedSource as Partial<SystemInfo>);
|
||
}
|
||
}
|
||
|
||
// Private type creation functions
|
||
const $$createType0 = $Create.Map($Create.Any, $Create.Any);
|
||
var $$createType1 = (function $$initCreateType1(...args): any {
|
||
if ($$createType1 === $$initCreateType1) {
|
||
$$createType1 = $$createType3;
|
||
}
|
||
return $$createType1(...args);
|
||
});
|
||
const $$createType2 = $Create.Array($Create.Any);
|
||
const $$createType3 = $Create.Map($Create.Any, $$createType2);
|
||
const $$createType4 = OSInfo.createFrom;
|
||
const $$createType5 = $Create.Nullable($$createType4);
|
||
const $$createType6 = $Create.Map($Create.Any, $Create.Any);
|