// @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"; /** * Device represents a peer device. */ export class Device { /** * Creates a new Device instance. * @param {Partial} [$$source = {}] - The source object to create the Device. */ constructor($$source = {}) { if (!("ip" in $$source)) { /** * @member * @type {string} */ this["ip"] = ""; } if (!("version" in $$source)) { /** * LocalSend protocol version * @member * @type {string} */ this["version"] = ""; } if (!("port" in $$source)) { /** * @member * @type {number} */ this["port"] = 0; } if (!("alias" in $$source)) { /** * @member * @type {string} */ this["alias"] = ""; } if (!("protocol" in $$source)) { /** * @member * @type {ProtocolType} */ this["protocol"] = ProtocolType.$zero; } if (!("fingerprint" in $$source)) { /** * @member * @type {string} */ this["fingerprint"] = ""; } if (!("deviceModel" in $$source)) { /** * nullable * @member * @type {string | null} */ this["deviceModel"] = null; } if (!("deviceType" in $$source)) { /** * @member * @type {DeviceType} */ this["deviceType"] = DeviceType.$zero; } if (!("download" in $$source)) { /** * Whether the device has download server running * @member * @type {boolean} */ this["download"] = false; } if (!("lastSeen" in $$source)) { /** * @member * @type {Date} */ this["lastSeen"] = new Date("0001-01-01T00:00:00.000Z"); } if (!("available" in $$source)) { /** * @member * @type {boolean} */ this["available"] = false; } Object.assign(this, $$source); } /** * Creates a new Device instance from a string or object. * @param {any} [$$source = {}] * @returns {Device} */ static createFrom($$source = {}) { const $$createField9_0 = $Create.DateFromTime; let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; if ("lastSeen" in $$parsedSource) { $$parsedSource["lastSeen"] = $$createField9_0($$parsedSource["lastSeen"]); } return new Device(/** @type {Partial} */($$parsedSource)); } } /** * DeviceType defines the type of the device. * @readonly * @enum {string} */ export const DeviceType = { /** * The Go zero value for the underlying type of the enum. */ $zero: "", DeviceTypeMobile: "mobile", DeviceTypeDesktop: "desktop", DeviceTypeWeb: "web", DeviceTypeHeadless: "headless", DeviceTypeServer: "server", }; /** * ProtocolType defines the protocol type. * @readonly * @enum {string} */ export const ProtocolType = { /** * The Go zero value for the underlying type of the enum. */ $zero: "", ProtocolTypeHTTP: "http", ProtocolTypeHTTPS: "https", };