| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- // @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<Device>} [$$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<Device>} */($$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",
- };
|