diff --git a/package-lock.json b/package-lock.json index a1aff0e..f58eb17 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@quasar/extras": "^1.16.4", "axios": "^1.2.1", - "google-protobuf": "^3.21.2", + "google-protobuf": "^3.21.4", "jl-graphic": "git+http://120.46.212.6:3000/joylink/graphic-pixi.git#v0.1.15", "js-base64": "^3.7.5", "pinia": "^2.0.11", @@ -20,6 +20,7 @@ }, "devDependencies": { "@quasar/app-vite": "^1.9.0", + "@types/google-protobuf": "^3.15.6", "@types/node": "^12.20.21", "@typescript-eslint/eslint-plugin": "^7.16.0", "@typescript-eslint/parser": "^7.16.0", @@ -1247,6 +1248,12 @@ "integrity": "sha512-xFU8ZXTw4gd358lb2jw25nxY9QAgqn2+bKKjKOYfNCzN4DKCFetK7sPtrlpg66Ywe3vWY9FNxprZawAh9wfJ3g==", "dev": true }, + "node_modules/@types/google-protobuf": { + "version": "3.15.12", + "resolved": "https://registry.npmmirror.com/@types/google-protobuf/-/google-protobuf-3.15.12.tgz", + "integrity": "sha512-40um9QqwHjRS92qnOaDpL7RmDK15NuZYo9HihiJRbYkMQZlWnuH8AdvbMy8/o6lgLmKbDUKa+OALCltHdbOTpQ==", + "dev": true + }, "node_modules/@types/har-format": { "version": "1.2.15", "resolved": "https://registry.npmmirror.com/@types/har-format/-/har-format-1.2.15.tgz", diff --git a/package.json b/package.json index f283802..fd92261 100644 --- a/package.json +++ b/package.json @@ -15,29 +15,30 @@ }, "dependencies": { "@quasar/extras": "^1.16.4", + "axios": "^1.2.1", + "google-protobuf": "^3.21.4", + "jl-graphic": "git+http://120.46.212.6:3000/joylink/graphic-pixi.git#v0.1.15", + "js-base64": "^3.7.5", + "pinia": "^2.0.11", "quasar": "^2.16.0", "vue": "^3.4.18", - "vue-router": "^4.0.12", - "axios": "^1.2.1", - "pinia": "^2.0.11", - "js-base64": "^3.7.5", - "google-protobuf": "^3.21.2", - "jl-graphic": "git+http://120.46.212.6:3000/joylink/graphic-pixi.git#v0.1.15" + "vue-router": "^4.0.12" }, "devDependencies": { + "@quasar/app-vite": "^1.9.0", + "@types/node": "^12.20.21", "@typescript-eslint/eslint-plugin": "^7.16.0", "@typescript-eslint/parser": "^7.16.0", - "vite-plugin-checker": "^0.7.2", - "vue-tsc": "2.0.29", - "eslint": "^8.57.0", - "eslint-plugin-vue": "^9.0.0", - "eslint-config-prettier": "^8.1.0", - "prettier": "^2.5.1", - "@types/node": "^12.20.21", - "@quasar/app-vite": "^1.9.0", + "@types/google-protobuf": "^3.15.6", "autoprefixer": "^10.4.2", + "dotenv": "^16.4.5", + "eslint": "^8.57.0", + "eslint-config-prettier": "^8.1.0", + "eslint-plugin-vue": "^9.0.0", + "prettier": "^2.5.1", "typescript": "~5.5.4", - "dotenv": "^16.4.5" + "vite-plugin-checker": "^0.7.2", + "vue-tsc": "2.0.29" }, "engines": { "node": "^20 || ^18 || ^16", diff --git a/rtss-proto-msg b/rtss-proto-msg index d5735a5..9218ddc 160000 --- a/rtss-proto-msg +++ b/rtss-proto-msg @@ -1 +1 @@ -Subproject commit d5735a58f40f7e013e4a4789e47b46e6f3f99adc +Subproject commit 9218ddcf90a543ca84c7240480a12dd08ceb2b1d diff --git a/src/protos/iscs_graphic_data.ts b/src/protos/iscs_graphic_data.ts index fb25bbf..cd6045a 100644 --- a/src/protos/iscs_graphic_data.ts +++ b/src/protos/iscs_graphic_data.ts @@ -3,1284 +3,1534 @@ * compiler version: 5.27.4 * source: iscs_graphic_data.proto * git: https://github.com/thesayyn/protoc-gen-ts */ -import * as pb_1 from "google-protobuf"; +import * as pb_1 from 'google-protobuf'; export namespace iscsGraphicData { - export class IscsGraphicStorage extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + export class IscsGraphicStorage extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { canvas?: Canvas; UniqueIdPrefix?: UniqueIdOfStationLayout; arrows?: Arrow[]; iscsTexts?: IscsText[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 4], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("canvas" in data && data.canvas != undefined) { - this.canvas = data.canvas; - } - if ("UniqueIdPrefix" in data && data.UniqueIdPrefix != undefined) { - this.UniqueIdPrefix = data.UniqueIdPrefix; - } - if ("arrows" in data && data.arrows != undefined) { - this.arrows = data.arrows; - } - if ("iscsTexts" in data && data.iscsTexts != undefined) { - this.iscsTexts = data.iscsTexts; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [3, 4], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('canvas' in data && data.canvas != undefined) { + this.canvas = data.canvas; } - get canvas() { - return pb_1.Message.getWrapperField(this, Canvas, 1) as Canvas; + if ('UniqueIdPrefix' in data && data.UniqueIdPrefix != undefined) { + this.UniqueIdPrefix = data.UniqueIdPrefix; } - set canvas(value: Canvas) { - pb_1.Message.setWrapperField(this, 1, value); + if ('arrows' in data && data.arrows != undefined) { + this.arrows = data.arrows; } - get has_canvas() { - return pb_1.Message.getField(this, 1) != null; - } - get UniqueIdPrefix() { - return pb_1.Message.getWrapperField(this, UniqueIdOfStationLayout, 2) as UniqueIdOfStationLayout; - } - set UniqueIdPrefix(value: UniqueIdOfStationLayout) { - pb_1.Message.setWrapperField(this, 2, value); - } - get has_UniqueIdPrefix() { - return pb_1.Message.getField(this, 2) != null; - } - get arrows() { - return pb_1.Message.getRepeatedWrapperField(this, Arrow, 3) as Arrow[]; - } - set arrows(value: Arrow[]) { - pb_1.Message.setRepeatedWrapperField(this, 3, value); - } - get iscsTexts() { - return pb_1.Message.getRepeatedWrapperField(this, IscsText, 4) as IscsText[]; - } - set iscsTexts(value: IscsText[]) { - pb_1.Message.setRepeatedWrapperField(this, 4, value); - } - static fromObject(data: { - canvas?: ReturnType; - UniqueIdPrefix?: ReturnType; - arrows?: ReturnType[]; - iscsTexts?: ReturnType[]; - }): IscsGraphicStorage { - const message = new IscsGraphicStorage({}); - if (data.canvas != null) { - message.canvas = Canvas.fromObject(data.canvas); - } - if (data.UniqueIdPrefix != null) { - message.UniqueIdPrefix = UniqueIdOfStationLayout.fromObject(data.UniqueIdPrefix); - } - if (data.arrows != null) { - message.arrows = data.arrows.map(item => Arrow.fromObject(item)); - } - if (data.iscsTexts != null) { - message.iscsTexts = data.iscsTexts.map(item => IscsText.fromObject(item)); - } - return message; - } - toObject() { - const data: { - canvas?: ReturnType; - UniqueIdPrefix?: ReturnType; - arrows?: ReturnType[]; - iscsTexts?: ReturnType[]; - } = {}; - if (this.canvas != null) { - data.canvas = this.canvas.toObject(); - } - if (this.UniqueIdPrefix != null) { - data.UniqueIdPrefix = this.UniqueIdPrefix.toObject(); - } - if (this.arrows != null) { - data.arrows = this.arrows.map((item: Arrow) => item.toObject()); - } - if (this.iscsTexts != null) { - data.iscsTexts = this.iscsTexts.map((item: IscsText) => item.toObject()); - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.has_canvas) - writer.writeMessage(1, this.canvas, () => this.canvas.serialize(writer)); - if (this.has_UniqueIdPrefix) - writer.writeMessage(2, this.UniqueIdPrefix, () => this.UniqueIdPrefix.serialize(writer)); - if (this.arrows.length) - writer.writeRepeatedMessage(3, this.arrows, (item: Arrow) => item.serialize(writer)); - if (this.iscsTexts.length) - writer.writeRepeatedMessage(4, this.iscsTexts, (item: IscsText) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): IscsGraphicStorage { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new IscsGraphicStorage(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.canvas, () => message.canvas = Canvas.deserialize(reader)); - break; - case 2: - reader.readMessage(message.UniqueIdPrefix, () => message.UniqueIdPrefix = UniqueIdOfStationLayout.deserialize(reader)); - break; - case 3: - reader.readMessage(message.arrows, () => pb_1.Message.addToRepeatedWrapperField(message, 3, Arrow.deserialize(reader), Arrow)); - break; - case 4: - reader.readMessage(message.iscsTexts, () => pb_1.Message.addToRepeatedWrapperField(message, 4, IscsText.deserialize(reader), IscsText)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): IscsGraphicStorage { - return IscsGraphicStorage.deserialize(bytes); + if ('iscsTexts' in data && data.iscsTexts != undefined) { + this.iscsTexts = data.iscsTexts; } + } } - export class Canvas extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get canvas() { + return pb_1.Message.getWrapperField(this, Canvas, 1) as Canvas; + } + set canvas(value: Canvas) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_canvas() { + return pb_1.Message.getField(this, 1) != null; + } + get UniqueIdPrefix() { + return pb_1.Message.getWrapperField( + this, + UniqueIdOfStationLayout, + 2 + ) as UniqueIdOfStationLayout; + } + set UniqueIdPrefix(value: UniqueIdOfStationLayout) { + pb_1.Message.setWrapperField(this, 2, value); + } + get has_UniqueIdPrefix() { + return pb_1.Message.getField(this, 2) != null; + } + get arrows() { + return pb_1.Message.getRepeatedWrapperField(this, Arrow, 3) as Arrow[]; + } + set arrows(value: Arrow[]) { + pb_1.Message.setRepeatedWrapperField(this, 3, value); + } + get iscsTexts() { + return pb_1.Message.getRepeatedWrapperField( + this, + IscsText, + 4 + ) as IscsText[]; + } + set iscsTexts(value: IscsText[]) { + pb_1.Message.setRepeatedWrapperField(this, 4, value); + } + static fromObject(data: { + canvas?: ReturnType; + UniqueIdPrefix?: ReturnType< + typeof UniqueIdOfStationLayout.prototype.toObject + >; + arrows?: ReturnType[]; + iscsTexts?: ReturnType[]; + }): IscsGraphicStorage { + const message = new IscsGraphicStorage({}); + if (data.canvas != null) { + message.canvas = Canvas.fromObject(data.canvas); + } + if (data.UniqueIdPrefix != null) { + message.UniqueIdPrefix = UniqueIdOfStationLayout.fromObject( + data.UniqueIdPrefix + ); + } + if (data.arrows != null) { + message.arrows = data.arrows.map((item) => Arrow.fromObject(item)); + } + if (data.iscsTexts != null) { + message.iscsTexts = data.iscsTexts.map((item) => + IscsText.fromObject(item) + ); + } + return message; + } + toObject() { + const data: { + canvas?: ReturnType; + UniqueIdPrefix?: ReturnType< + typeof UniqueIdOfStationLayout.prototype.toObject + >; + arrows?: ReturnType[]; + iscsTexts?: ReturnType[]; + } = {}; + if (this.canvas != null) { + data.canvas = this.canvas.toObject(); + } + if (this.UniqueIdPrefix != null) { + data.UniqueIdPrefix = this.UniqueIdPrefix.toObject(); + } + if (this.arrows != null) { + data.arrows = this.arrows.map((item: Arrow) => item.toObject()); + } + if (this.iscsTexts != null) { + data.iscsTexts = this.iscsTexts.map((item: IscsText) => + item.toObject() + ); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_canvas) + writer.writeMessage(1, this.canvas, () => + this.canvas.serialize(writer) + ); + if (this.has_UniqueIdPrefix) + writer.writeMessage(2, this.UniqueIdPrefix, () => + this.UniqueIdPrefix.serialize(writer) + ); + if (this.arrows.length) + writer.writeRepeatedMessage(3, this.arrows, (item: Arrow) => + item.serialize(writer) + ); + if (this.iscsTexts.length) + writer.writeRepeatedMessage(4, this.iscsTexts, (item: IscsText) => + item.serialize(writer) + ); + if (!w) return writer.getResultBuffer(); + } + static deserialize( + bytes: Uint8Array | pb_1.BinaryReader + ): IscsGraphicStorage { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new IscsGraphicStorage(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage( + message.canvas, + () => (message.canvas = Canvas.deserialize(reader)) + ); + break; + case 2: + reader.readMessage( + message.UniqueIdPrefix, + () => + (message.UniqueIdPrefix = + UniqueIdOfStationLayout.deserialize(reader)) + ); + break; + case 3: + reader.readMessage(message.arrows, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 3, + Arrow.deserialize(reader), + Arrow + ) + ); + break; + case 4: + reader.readMessage(message.iscsTexts, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 4, + IscsText.deserialize(reader), + IscsText + ) + ); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): IscsGraphicStorage { + return IscsGraphicStorage.deserialize(bytes); + } + } + export class Canvas extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { width?: number; height?: number; backgroundColor?: string; viewportTransform?: Transform; gridBackground?: Grid; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("width" in data && data.width != undefined) { - this.width = data.width; - } - if ("height" in data && data.height != undefined) { - this.height = data.height; - } - if ("backgroundColor" in data && data.backgroundColor != undefined) { - this.backgroundColor = data.backgroundColor; - } - if ("viewportTransform" in data && data.viewportTransform != undefined) { - this.viewportTransform = data.viewportTransform; - } - if ("gridBackground" in data && data.gridBackground != undefined) { - this.gridBackground = data.gridBackground; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('width' in data && data.width != undefined) { + this.width = data.width; } - get width() { - return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; + if ('height' in data && data.height != undefined) { + this.height = data.height; } - set width(value: number) { - pb_1.Message.setField(this, 1, value); + if ('backgroundColor' in data && data.backgroundColor != undefined) { + this.backgroundColor = data.backgroundColor; } - get height() { - return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; + if ( + 'viewportTransform' in data && + data.viewportTransform != undefined + ) { + this.viewportTransform = data.viewportTransform; } - set height(value: number) { - pb_1.Message.setField(this, 2, value); - } - get backgroundColor() { - return pb_1.Message.getFieldWithDefault(this, 3, "") as string; - } - set backgroundColor(value: string) { - pb_1.Message.setField(this, 3, value); - } - get viewportTransform() { - return pb_1.Message.getWrapperField(this, Transform, 4) as Transform; - } - set viewportTransform(value: Transform) { - pb_1.Message.setWrapperField(this, 4, value); - } - get has_viewportTransform() { - return pb_1.Message.getField(this, 4) != null; - } - get gridBackground() { - return pb_1.Message.getWrapperField(this, Grid, 5) as Grid; - } - set gridBackground(value: Grid) { - pb_1.Message.setWrapperField(this, 5, value); - } - get has_gridBackground() { - return pb_1.Message.getField(this, 5) != null; - } - static fromObject(data: { - width?: number; - height?: number; - backgroundColor?: string; - viewportTransform?: ReturnType; - gridBackground?: ReturnType; - }): Canvas { - const message = new Canvas({}); - if (data.width != null) { - message.width = data.width; - } - if (data.height != null) { - message.height = data.height; - } - if (data.backgroundColor != null) { - message.backgroundColor = data.backgroundColor; - } - if (data.viewportTransform != null) { - message.viewportTransform = Transform.fromObject(data.viewportTransform); - } - if (data.gridBackground != null) { - message.gridBackground = Grid.fromObject(data.gridBackground); - } - return message; - } - toObject() { - const data: { - width?: number; - height?: number; - backgroundColor?: string; - viewportTransform?: ReturnType; - gridBackground?: ReturnType; - } = {}; - if (this.width != null) { - data.width = this.width; - } - if (this.height != null) { - data.height = this.height; - } - if (this.backgroundColor != null) { - data.backgroundColor = this.backgroundColor; - } - if (this.viewportTransform != null) { - data.viewportTransform = this.viewportTransform.toObject(); - } - if (this.gridBackground != null) { - data.gridBackground = this.gridBackground.toObject(); - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.width != 0) - writer.writeInt32(1, this.width); - if (this.height != 0) - writer.writeInt32(2, this.height); - if (this.backgroundColor.length) - writer.writeString(3, this.backgroundColor); - if (this.has_viewportTransform) - writer.writeMessage(4, this.viewportTransform, () => this.viewportTransform.serialize(writer)); - if (this.has_gridBackground) - writer.writeMessage(5, this.gridBackground, () => this.gridBackground.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Canvas { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Canvas(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.width = reader.readInt32(); - break; - case 2: - message.height = reader.readInt32(); - break; - case 3: - message.backgroundColor = reader.readString(); - break; - case 4: - reader.readMessage(message.viewportTransform, () => message.viewportTransform = Transform.deserialize(reader)); - break; - case 5: - reader.readMessage(message.gridBackground, () => message.gridBackground = Grid.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Canvas { - return Canvas.deserialize(bytes); + if ('gridBackground' in data && data.gridBackground != undefined) { + this.gridBackground = data.gridBackground; } + } } - export class Grid extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get width() { + return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; + } + set width(value: number) { + pb_1.Message.setField(this, 1, value); + } + get height() { + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; + } + set height(value: number) { + pb_1.Message.setField(this, 2, value); + } + get backgroundColor() { + return pb_1.Message.getFieldWithDefault(this, 3, '') as string; + } + set backgroundColor(value: string) { + pb_1.Message.setField(this, 3, value); + } + get viewportTransform() { + return pb_1.Message.getWrapperField(this, Transform, 4) as Transform; + } + set viewportTransform(value: Transform) { + pb_1.Message.setWrapperField(this, 4, value); + } + get has_viewportTransform() { + return pb_1.Message.getField(this, 4) != null; + } + get gridBackground() { + return pb_1.Message.getWrapperField(this, Grid, 5) as Grid; + } + set gridBackground(value: Grid) { + pb_1.Message.setWrapperField(this, 5, value); + } + get has_gridBackground() { + return pb_1.Message.getField(this, 5) != null; + } + static fromObject(data: { + width?: number; + height?: number; + backgroundColor?: string; + viewportTransform?: ReturnType; + gridBackground?: ReturnType; + }): Canvas { + const message = new Canvas({}); + if (data.width != null) { + message.width = data.width; + } + if (data.height != null) { + message.height = data.height; + } + if (data.backgroundColor != null) { + message.backgroundColor = data.backgroundColor; + } + if (data.viewportTransform != null) { + message.viewportTransform = Transform.fromObject( + data.viewportTransform + ); + } + if (data.gridBackground != null) { + message.gridBackground = Grid.fromObject(data.gridBackground); + } + return message; + } + toObject() { + const data: { + width?: number; + height?: number; + backgroundColor?: string; + viewportTransform?: ReturnType; + gridBackground?: ReturnType; + } = {}; + if (this.width != null) { + data.width = this.width; + } + if (this.height != null) { + data.height = this.height; + } + if (this.backgroundColor != null) { + data.backgroundColor = this.backgroundColor; + } + if (this.viewportTransform != null) { + data.viewportTransform = this.viewportTransform.toObject(); + } + if (this.gridBackground != null) { + data.gridBackground = this.gridBackground.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.width != 0) writer.writeInt32(1, this.width); + if (this.height != 0) writer.writeInt32(2, this.height); + if (this.backgroundColor.length) + writer.writeString(3, this.backgroundColor); + if (this.has_viewportTransform) + writer.writeMessage(4, this.viewportTransform, () => + this.viewportTransform.serialize(writer) + ); + if (this.has_gridBackground) + writer.writeMessage(5, this.gridBackground, () => + this.gridBackground.serialize(writer) + ); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Canvas { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new Canvas(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + message.width = reader.readInt32(); + break; + case 2: + message.height = reader.readInt32(); + break; + case 3: + message.backgroundColor = reader.readString(); + break; + case 4: + reader.readMessage( + message.viewportTransform, + () => (message.viewportTransform = Transform.deserialize(reader)) + ); + break; + case 5: + reader.readMessage( + message.gridBackground, + () => (message.gridBackground = Grid.deserialize(reader)) + ); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Canvas { + return Canvas.deserialize(bytes); + } + } + export class Grid extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { hasGrid?: boolean; lineColor?: string; space?: number; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("hasGrid" in data && data.hasGrid != undefined) { - this.hasGrid = data.hasGrid; - } - if ("lineColor" in data && data.lineColor != undefined) { - this.lineColor = data.lineColor; - } - if ("space" in data && data.space != undefined) { - this.space = data.space; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('hasGrid' in data && data.hasGrid != undefined) { + this.hasGrid = data.hasGrid; } - get hasGrid() { - return pb_1.Message.getFieldWithDefault(this, 1, false) as boolean; + if ('lineColor' in data && data.lineColor != undefined) { + this.lineColor = data.lineColor; } - set hasGrid(value: boolean) { - pb_1.Message.setField(this, 1, value); - } - get lineColor() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set lineColor(value: string) { - pb_1.Message.setField(this, 2, value); - } - get space() { - return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; - } - set space(value: number) { - pb_1.Message.setField(this, 3, value); - } - static fromObject(data: { - hasGrid?: boolean; - lineColor?: string; - space?: number; - }): Grid { - const message = new Grid({}); - if (data.hasGrid != null) { - message.hasGrid = data.hasGrid; - } - if (data.lineColor != null) { - message.lineColor = data.lineColor; - } - if (data.space != null) { - message.space = data.space; - } - return message; - } - toObject() { - const data: { - hasGrid?: boolean; - lineColor?: string; - space?: number; - } = {}; - if (this.hasGrid != null) { - data.hasGrid = this.hasGrid; - } - if (this.lineColor != null) { - data.lineColor = this.lineColor; - } - if (this.space != null) { - data.space = this.space; - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.hasGrid != false) - writer.writeBool(1, this.hasGrid); - if (this.lineColor.length) - writer.writeString(2, this.lineColor); - if (this.space != 0) - writer.writeInt32(3, this.space); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Grid { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Grid(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.hasGrid = reader.readBool(); - break; - case 2: - message.lineColor = reader.readString(); - break; - case 3: - message.space = reader.readInt32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Grid { - return Grid.deserialize(bytes); + if ('space' in data && data.space != undefined) { + this.space = data.space; } + } } - export class Point extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get hasGrid() { + return pb_1.Message.getFieldWithDefault(this, 1, false) as boolean; + } + set hasGrid(value: boolean) { + pb_1.Message.setField(this, 1, value); + } + get lineColor() { + return pb_1.Message.getFieldWithDefault(this, 2, '') as string; + } + set lineColor(value: string) { + pb_1.Message.setField(this, 2, value); + } + get space() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; + } + set space(value: number) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + hasGrid?: boolean; + lineColor?: string; + space?: number; + }): Grid { + const message = new Grid({}); + if (data.hasGrid != null) { + message.hasGrid = data.hasGrid; + } + if (data.lineColor != null) { + message.lineColor = data.lineColor; + } + if (data.space != null) { + message.space = data.space; + } + return message; + } + toObject() { + const data: { + hasGrid?: boolean; + lineColor?: string; + space?: number; + } = {}; + if (this.hasGrid != null) { + data.hasGrid = this.hasGrid; + } + if (this.lineColor != null) { + data.lineColor = this.lineColor; + } + if (this.space != null) { + data.space = this.space; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.hasGrid != false) writer.writeBool(1, this.hasGrid); + if (this.lineColor.length) writer.writeString(2, this.lineColor); + if (this.space != 0) writer.writeInt32(3, this.space); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Grid { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new Grid(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + message.hasGrid = reader.readBool(); + break; + case 2: + message.lineColor = reader.readString(); + break; + case 3: + message.space = reader.readInt32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Grid { + return Grid.deserialize(bytes); + } + } + export class Point extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { x?: number; y?: number; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("x" in data && data.x != undefined) { - this.x = data.x; - } - if ("y" in data && data.y != undefined) { - this.y = data.y; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('x' in data && data.x != undefined) { + this.x = data.x; } - get x() { - return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; - } - set x(value: number) { - pb_1.Message.setField(this, 1, value); - } - get y() { - return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; - } - set y(value: number) { - pb_1.Message.setField(this, 2, value); - } - static fromObject(data: { - x?: number; - y?: number; - }): Point { - const message = new Point({}); - if (data.x != null) { - message.x = data.x; - } - if (data.y != null) { - message.y = data.y; - } - return message; - } - toObject() { - const data: { - x?: number; - y?: number; - } = {}; - if (this.x != null) { - data.x = this.x; - } - if (this.y != null) { - data.y = this.y; - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.x != 0) - writer.writeFloat(1, this.x); - if (this.y != 0) - writer.writeFloat(2, this.y); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Point { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Point(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.x = reader.readFloat(); - break; - case 2: - message.y = reader.readFloat(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Point { - return Point.deserialize(bytes); + if ('y' in data && data.y != undefined) { + this.y = data.y; } + } } - export class Transform extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get x() { + return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; + } + set x(value: number) { + pb_1.Message.setField(this, 1, value); + } + get y() { + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; + } + set y(value: number) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { x?: number; y?: number }): Point { + const message = new Point({}); + if (data.x != null) { + message.x = data.x; + } + if (data.y != null) { + message.y = data.y; + } + return message; + } + toObject() { + const data: { + x?: number; + y?: number; + } = {}; + if (this.x != null) { + data.x = this.x; + } + if (this.y != null) { + data.y = this.y; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.x != 0) writer.writeFloat(1, this.x); + if (this.y != 0) writer.writeFloat(2, this.y); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Point { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new Point(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + message.x = reader.readFloat(); + break; + case 2: + message.y = reader.readFloat(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Point { + return Point.deserialize(bytes); + } + } + export class Transform extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { position?: Point; scale?: Point; rotation?: number; skew?: Point; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("position" in data && data.position != undefined) { - this.position = data.position; - } - if ("scale" in data && data.scale != undefined) { - this.scale = data.scale; - } - if ("rotation" in data && data.rotation != undefined) { - this.rotation = data.rotation; - } - if ("skew" in data && data.skew != undefined) { - this.skew = data.skew; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('position' in data && data.position != undefined) { + this.position = data.position; } - get position() { - return pb_1.Message.getWrapperField(this, Point, 1) as Point; + if ('scale' in data && data.scale != undefined) { + this.scale = data.scale; } - set position(value: Point) { - pb_1.Message.setWrapperField(this, 1, value); + if ('rotation' in data && data.rotation != undefined) { + this.rotation = data.rotation; } - get has_position() { - return pb_1.Message.getField(this, 1) != null; - } - get scale() { - return pb_1.Message.getWrapperField(this, Point, 2) as Point; - } - set scale(value: Point) { - pb_1.Message.setWrapperField(this, 2, value); - } - get has_scale() { - return pb_1.Message.getField(this, 2) != null; - } - get rotation() { - return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; - } - set rotation(value: number) { - pb_1.Message.setField(this, 3, value); - } - get skew() { - return pb_1.Message.getWrapperField(this, Point, 4) as Point; - } - set skew(value: Point) { - pb_1.Message.setWrapperField(this, 4, value); - } - get has_skew() { - return pb_1.Message.getField(this, 4) != null; - } - static fromObject(data: { - position?: ReturnType; - scale?: ReturnType; - rotation?: number; - skew?: ReturnType; - }): Transform { - const message = new Transform({}); - if (data.position != null) { - message.position = Point.fromObject(data.position); - } - if (data.scale != null) { - message.scale = Point.fromObject(data.scale); - } - if (data.rotation != null) { - message.rotation = data.rotation; - } - if (data.skew != null) { - message.skew = Point.fromObject(data.skew); - } - return message; - } - toObject() { - const data: { - position?: ReturnType; - scale?: ReturnType; - rotation?: number; - skew?: ReturnType; - } = {}; - if (this.position != null) { - data.position = this.position.toObject(); - } - if (this.scale != null) { - data.scale = this.scale.toObject(); - } - if (this.rotation != null) { - data.rotation = this.rotation; - } - if (this.skew != null) { - data.skew = this.skew.toObject(); - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.has_position) - writer.writeMessage(1, this.position, () => this.position.serialize(writer)); - if (this.has_scale) - writer.writeMessage(2, this.scale, () => this.scale.serialize(writer)); - if (this.rotation != 0) - writer.writeFloat(3, this.rotation); - if (this.has_skew) - writer.writeMessage(4, this.skew, () => this.skew.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Transform { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Transform(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.position, () => message.position = Point.deserialize(reader)); - break; - case 2: - reader.readMessage(message.scale, () => message.scale = Point.deserialize(reader)); - break; - case 3: - message.rotation = reader.readFloat(); - break; - case 4: - reader.readMessage(message.skew, () => message.skew = Point.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Transform { - return Transform.deserialize(bytes); + if ('skew' in data && data.skew != undefined) { + this.skew = data.skew; } + } } - export class ChildTransform extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get position() { + return pb_1.Message.getWrapperField(this, Point, 1) as Point; + } + set position(value: Point) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_position() { + return pb_1.Message.getField(this, 1) != null; + } + get scale() { + return pb_1.Message.getWrapperField(this, Point, 2) as Point; + } + set scale(value: Point) { + pb_1.Message.setWrapperField(this, 2, value); + } + get has_scale() { + return pb_1.Message.getField(this, 2) != null; + } + get rotation() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; + } + set rotation(value: number) { + pb_1.Message.setField(this, 3, value); + } + get skew() { + return pb_1.Message.getWrapperField(this, Point, 4) as Point; + } + set skew(value: Point) { + pb_1.Message.setWrapperField(this, 4, value); + } + get has_skew() { + return pb_1.Message.getField(this, 4) != null; + } + static fromObject(data: { + position?: ReturnType; + scale?: ReturnType; + rotation?: number; + skew?: ReturnType; + }): Transform { + const message = new Transform({}); + if (data.position != null) { + message.position = Point.fromObject(data.position); + } + if (data.scale != null) { + message.scale = Point.fromObject(data.scale); + } + if (data.rotation != null) { + message.rotation = data.rotation; + } + if (data.skew != null) { + message.skew = Point.fromObject(data.skew); + } + return message; + } + toObject() { + const data: { + position?: ReturnType; + scale?: ReturnType; + rotation?: number; + skew?: ReturnType; + } = {}; + if (this.position != null) { + data.position = this.position.toObject(); + } + if (this.scale != null) { + data.scale = this.scale.toObject(); + } + if (this.rotation != null) { + data.rotation = this.rotation; + } + if (this.skew != null) { + data.skew = this.skew.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_position) + writer.writeMessage(1, this.position, () => + this.position.serialize(writer) + ); + if (this.has_scale) + writer.writeMessage(2, this.scale, () => this.scale.serialize(writer)); + if (this.rotation != 0) writer.writeFloat(3, this.rotation); + if (this.has_skew) + writer.writeMessage(4, this.skew, () => this.skew.serialize(writer)); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Transform { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new Transform(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage( + message.position, + () => (message.position = Point.deserialize(reader)) + ); + break; + case 2: + reader.readMessage( + message.scale, + () => (message.scale = Point.deserialize(reader)) + ); + break; + case 3: + message.rotation = reader.readFloat(); + break; + case 4: + reader.readMessage( + message.skew, + () => (message.skew = Point.deserialize(reader)) + ); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Transform { + return Transform.deserialize(bytes); + } + } + export class ChildTransform extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { name?: string; transform?: Transform; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("name" in data && data.name != undefined) { - this.name = data.name; - } - if ("transform" in data && data.transform != undefined) { - this.transform = data.transform; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('name' in data && data.name != undefined) { + this.name = data.name; } - get name() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set name(value: string) { - pb_1.Message.setField(this, 1, value); - } - get transform() { - return pb_1.Message.getWrapperField(this, Transform, 2) as Transform; - } - set transform(value: Transform) { - pb_1.Message.setWrapperField(this, 2, value); - } - get has_transform() { - return pb_1.Message.getField(this, 2) != null; - } - static fromObject(data: { - name?: string; - transform?: ReturnType; - }): ChildTransform { - const message = new ChildTransform({}); - if (data.name != null) { - message.name = data.name; - } - if (data.transform != null) { - message.transform = Transform.fromObject(data.transform); - } - return message; - } - toObject() { - const data: { - name?: string; - transform?: ReturnType; - } = {}; - if (this.name != null) { - data.name = this.name; - } - if (this.transform != null) { - data.transform = this.transform.toObject(); - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.name.length) - writer.writeString(1, this.name); - if (this.has_transform) - writer.writeMessage(2, this.transform, () => this.transform.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ChildTransform { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ChildTransform(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.name = reader.readString(); - break; - case 2: - reader.readMessage(message.transform, () => message.transform = Transform.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): ChildTransform { - return ChildTransform.deserialize(bytes); + if ('transform' in data && data.transform != undefined) { + this.transform = data.transform; } + } } - export class CommonInfo extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get name() { + return pb_1.Message.getFieldWithDefault(this, 1, '') as string; + } + set name(value: string) { + pb_1.Message.setField(this, 1, value); + } + get transform() { + return pb_1.Message.getWrapperField(this, Transform, 2) as Transform; + } + set transform(value: Transform) { + pb_1.Message.setWrapperField(this, 2, value); + } + get has_transform() { + return pb_1.Message.getField(this, 2) != null; + } + static fromObject(data: { + name?: string; + transform?: ReturnType; + }): ChildTransform { + const message = new ChildTransform({}); + if (data.name != null) { + message.name = data.name; + } + if (data.transform != null) { + message.transform = Transform.fromObject(data.transform); + } + return message; + } + toObject() { + const data: { + name?: string; + transform?: ReturnType; + } = {}; + if (this.name != null) { + data.name = this.name; + } + if (this.transform != null) { + data.transform = this.transform.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.name.length) writer.writeString(1, this.name); + if (this.has_transform) + writer.writeMessage(2, this.transform, () => + this.transform.serialize(writer) + ); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ChildTransform { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new ChildTransform(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + message.name = reader.readString(); + break; + case 2: + reader.readMessage( + message.transform, + () => (message.transform = Transform.deserialize(reader)) + ); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): ChildTransform { + return ChildTransform.deserialize(bytes); + } + } + export class CommonInfo extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { graphicType?: string; transform?: Transform; childTransforms?: ChildTransform[]; id?: number; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("graphicType" in data && data.graphicType != undefined) { - this.graphicType = data.graphicType; - } - if ("transform" in data && data.transform != undefined) { - this.transform = data.transform; - } - if ("childTransforms" in data && data.childTransforms != undefined) { - this.childTransforms = data.childTransforms; - } - if ("id" in data && data.id != undefined) { - this.id = data.id; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [4], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('graphicType' in data && data.graphicType != undefined) { + this.graphicType = data.graphicType; } - get graphicType() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + if ('transform' in data && data.transform != undefined) { + this.transform = data.transform; } - set graphicType(value: string) { - pb_1.Message.setField(this, 2, value); + if ('childTransforms' in data && data.childTransforms != undefined) { + this.childTransforms = data.childTransforms; } - get transform() { - return pb_1.Message.getWrapperField(this, Transform, 3) as Transform; - } - set transform(value: Transform) { - pb_1.Message.setWrapperField(this, 3, value); - } - get has_transform() { - return pb_1.Message.getField(this, 3) != null; - } - get childTransforms() { - return pb_1.Message.getRepeatedWrapperField(this, ChildTransform, 4) as ChildTransform[]; - } - set childTransforms(value: ChildTransform[]) { - pb_1.Message.setRepeatedWrapperField(this, 4, value); - } - get id() { - return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; - } - set id(value: number) { - pb_1.Message.setField(this, 5, value); - } - static fromObject(data: { - graphicType?: string; - transform?: ReturnType; - childTransforms?: ReturnType[]; - id?: number; - }): CommonInfo { - const message = new CommonInfo({}); - if (data.graphicType != null) { - message.graphicType = data.graphicType; - } - if (data.transform != null) { - message.transform = Transform.fromObject(data.transform); - } - if (data.childTransforms != null) { - message.childTransforms = data.childTransforms.map(item => ChildTransform.fromObject(item)); - } - if (data.id != null) { - message.id = data.id; - } - return message; - } - toObject() { - const data: { - graphicType?: string; - transform?: ReturnType; - childTransforms?: ReturnType[]; - id?: number; - } = {}; - if (this.graphicType != null) { - data.graphicType = this.graphicType; - } - if (this.transform != null) { - data.transform = this.transform.toObject(); - } - if (this.childTransforms != null) { - data.childTransforms = this.childTransforms.map((item: ChildTransform) => item.toObject()); - } - if (this.id != null) { - data.id = this.id; - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.graphicType.length) - writer.writeString(2, this.graphicType); - if (this.has_transform) - writer.writeMessage(3, this.transform, () => this.transform.serialize(writer)); - if (this.childTransforms.length) - writer.writeRepeatedMessage(4, this.childTransforms, (item: ChildTransform) => item.serialize(writer)); - if (this.id != 0) - writer.writeUint32(5, this.id); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): CommonInfo { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CommonInfo(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 2: - message.graphicType = reader.readString(); - break; - case 3: - reader.readMessage(message.transform, () => message.transform = Transform.deserialize(reader)); - break; - case 4: - reader.readMessage(message.childTransforms, () => pb_1.Message.addToRepeatedWrapperField(message, 4, ChildTransform.deserialize(reader), ChildTransform)); - break; - case 5: - message.id = reader.readUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): CommonInfo { - return CommonInfo.deserialize(bytes); + if ('id' in data && data.id != undefined) { + this.id = data.id; } + } } - export class UniqueIdOfStationLayout extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get graphicType() { + return pb_1.Message.getFieldWithDefault(this, 2, '') as string; + } + set graphicType(value: string) { + pb_1.Message.setField(this, 2, value); + } + get transform() { + return pb_1.Message.getWrapperField(this, Transform, 3) as Transform; + } + set transform(value: Transform) { + pb_1.Message.setWrapperField(this, 3, value); + } + get has_transform() { + return pb_1.Message.getField(this, 3) != null; + } + get childTransforms() { + return pb_1.Message.getRepeatedWrapperField( + this, + ChildTransform, + 4 + ) as ChildTransform[]; + } + set childTransforms(value: ChildTransform[]) { + pb_1.Message.setRepeatedWrapperField(this, 4, value); + } + get id() { + return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; + } + set id(value: number) { + pb_1.Message.setField(this, 5, value); + } + static fromObject(data: { + graphicType?: string; + transform?: ReturnType; + childTransforms?: ReturnType[]; + id?: number; + }): CommonInfo { + const message = new CommonInfo({}); + if (data.graphicType != null) { + message.graphicType = data.graphicType; + } + if (data.transform != null) { + message.transform = Transform.fromObject(data.transform); + } + if (data.childTransforms != null) { + message.childTransforms = data.childTransforms.map((item) => + ChildTransform.fromObject(item) + ); + } + if (data.id != null) { + message.id = data.id; + } + return message; + } + toObject() { + const data: { + graphicType?: string; + transform?: ReturnType; + childTransforms?: ReturnType< + typeof ChildTransform.prototype.toObject + >[]; + id?: number; + } = {}; + if (this.graphicType != null) { + data.graphicType = this.graphicType; + } + if (this.transform != null) { + data.transform = this.transform.toObject(); + } + if (this.childTransforms != null) { + data.childTransforms = this.childTransforms.map( + (item: ChildTransform) => item.toObject() + ); + } + if (this.id != null) { + data.id = this.id; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.graphicType.length) writer.writeString(2, this.graphicType); + if (this.has_transform) + writer.writeMessage(3, this.transform, () => + this.transform.serialize(writer) + ); + if (this.childTransforms.length) + writer.writeRepeatedMessage( + 4, + this.childTransforms, + (item: ChildTransform) => item.serialize(writer) + ); + if (this.id != 0) writer.writeUint32(5, this.id); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): CommonInfo { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new CommonInfo(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 2: + message.graphicType = reader.readString(); + break; + case 3: + reader.readMessage( + message.transform, + () => (message.transform = Transform.deserialize(reader)) + ); + break; + case 4: + reader.readMessage(message.childTransforms, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 4, + ChildTransform.deserialize(reader), + ChildTransform + ) + ); + break; + case 5: + message.id = reader.readUint32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): CommonInfo { + return CommonInfo.deserialize(bytes); + } + } + export class UniqueIdOfStationLayout extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { city?: string; lineId?: string; mainCoordinateSystem?: string; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("city" in data && data.city != undefined) { - this.city = data.city; - } - if ("lineId" in data && data.lineId != undefined) { - this.lineId = data.lineId; - } - if ("mainCoordinateSystem" in data && data.mainCoordinateSystem != undefined) { - this.mainCoordinateSystem = data.mainCoordinateSystem; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('city' in data && data.city != undefined) { + this.city = data.city; } - get city() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + if ('lineId' in data && data.lineId != undefined) { + this.lineId = data.lineId; } - set city(value: string) { - pb_1.Message.setField(this, 1, value); - } - get lineId() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set lineId(value: string) { - pb_1.Message.setField(this, 2, value); - } - get mainCoordinateSystem() { - return pb_1.Message.getFieldWithDefault(this, 3, "") as string; - } - set mainCoordinateSystem(value: string) { - pb_1.Message.setField(this, 3, value); - } - static fromObject(data: { - city?: string; - lineId?: string; - mainCoordinateSystem?: string; - }): UniqueIdOfStationLayout { - const message = new UniqueIdOfStationLayout({}); - if (data.city != null) { - message.city = data.city; - } - if (data.lineId != null) { - message.lineId = data.lineId; - } - if (data.mainCoordinateSystem != null) { - message.mainCoordinateSystem = data.mainCoordinateSystem; - } - return message; - } - toObject() { - const data: { - city?: string; - lineId?: string; - mainCoordinateSystem?: string; - } = {}; - if (this.city != null) { - data.city = this.city; - } - if (this.lineId != null) { - data.lineId = this.lineId; - } - if (this.mainCoordinateSystem != null) { - data.mainCoordinateSystem = this.mainCoordinateSystem; - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.city.length) - writer.writeString(1, this.city); - if (this.lineId.length) - writer.writeString(2, this.lineId); - if (this.mainCoordinateSystem.length) - writer.writeString(3, this.mainCoordinateSystem); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): UniqueIdOfStationLayout { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new UniqueIdOfStationLayout(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.city = reader.readString(); - break; - case 2: - message.lineId = reader.readString(); - break; - case 3: - message.mainCoordinateSystem = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): UniqueIdOfStationLayout { - return UniqueIdOfStationLayout.deserialize(bytes); + if ( + 'mainCoordinateSystem' in data && + data.mainCoordinateSystem != undefined + ) { + this.mainCoordinateSystem = data.mainCoordinateSystem; } + } } - export class Arrow extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get city() { + return pb_1.Message.getFieldWithDefault(this, 1, '') as string; + } + set city(value: string) { + pb_1.Message.setField(this, 1, value); + } + get lineId() { + return pb_1.Message.getFieldWithDefault(this, 2, '') as string; + } + set lineId(value: string) { + pb_1.Message.setField(this, 2, value); + } + get mainCoordinateSystem() { + return pb_1.Message.getFieldWithDefault(this, 3, '') as string; + } + set mainCoordinateSystem(value: string) { + pb_1.Message.setField(this, 3, value); + } + static fromObject(data: { + city?: string; + lineId?: string; + mainCoordinateSystem?: string; + }): UniqueIdOfStationLayout { + const message = new UniqueIdOfStationLayout({}); + if (data.city != null) { + message.city = data.city; + } + if (data.lineId != null) { + message.lineId = data.lineId; + } + if (data.mainCoordinateSystem != null) { + message.mainCoordinateSystem = data.mainCoordinateSystem; + } + return message; + } + toObject() { + const data: { + city?: string; + lineId?: string; + mainCoordinateSystem?: string; + } = {}; + if (this.city != null) { + data.city = this.city; + } + if (this.lineId != null) { + data.lineId = this.lineId; + } + if (this.mainCoordinateSystem != null) { + data.mainCoordinateSystem = this.mainCoordinateSystem; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.city.length) writer.writeString(1, this.city); + if (this.lineId.length) writer.writeString(2, this.lineId); + if (this.mainCoordinateSystem.length) + writer.writeString(3, this.mainCoordinateSystem); + if (!w) return writer.getResultBuffer(); + } + static deserialize( + bytes: Uint8Array | pb_1.BinaryReader + ): UniqueIdOfStationLayout { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new UniqueIdOfStationLayout(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + message.city = reader.readString(); + break; + case 2: + message.lineId = reader.readString(); + break; + case 3: + message.mainCoordinateSystem = reader.readString(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): UniqueIdOfStationLayout { + return UniqueIdOfStationLayout.deserialize(bytes); + } + } + export class Arrow extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; points?: Point[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("common" in data && data.common != undefined) { - this.common = data.common; - } - if ("code" in data && data.code != undefined) { - this.code = data.code; - } - if ("points" in data && data.points != undefined) { - this.points = data.points; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [3], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('common' in data && data.common != undefined) { + this.common = data.common; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_common() { - return pb_1.Message.getField(this, 1) != null; - } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set code(value: string) { - pb_1.Message.setField(this, 2, value); - } - get points() { - return pb_1.Message.getRepeatedWrapperField(this, Point, 3) as Point[]; - } - set points(value: Point[]) { - pb_1.Message.setRepeatedWrapperField(this, 3, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - points?: ReturnType[]; - }): Arrow { - const message = new Arrow({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.points != null) { - message.points = data.points.map(item => Point.fromObject(item)); - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - points?: ReturnType[]; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.points != null) { - data.points = this.points.map((item: Point) => item.toObject()); - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.has_common) - writer.writeMessage(1, this.common, () => this.common.serialize(writer)); - if (this.code.length) - writer.writeString(2, this.code); - if (this.points.length) - writer.writeRepeatedMessage(3, this.points, (item: Point) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Arrow { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Arrow(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader)); - break; - case 2: - message.code = reader.readString(); - break; - case 3: - reader.readMessage(message.points, () => pb_1.Message.addToRepeatedWrapperField(message, 3, Point.deserialize(reader), Point)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Arrow { - return Arrow.deserialize(bytes); + if ('points' in data && data.points != undefined) { + this.points = data.points; } + } } - export class IscsText extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + } + set common(value: CommonInfo) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_common() { + return pb_1.Message.getField(this, 1) != null; + } + get code() { + return pb_1.Message.getFieldWithDefault(this, 2, '') as string; + } + set code(value: string) { + pb_1.Message.setField(this, 2, value); + } + get points() { + return pb_1.Message.getRepeatedWrapperField(this, Point, 3) as Point[]; + } + set points(value: Point[]) { + pb_1.Message.setRepeatedWrapperField(this, 3, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + points?: ReturnType[]; + }): Arrow { + const message = new Arrow({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.points != null) { + message.points = data.points.map((item) => Point.fromObject(item)); + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + points?: ReturnType[]; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.points != null) { + data.points = this.points.map((item: Point) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_common) + writer.writeMessage(1, this.common, () => + this.common.serialize(writer) + ); + if (this.code.length) writer.writeString(2, this.code); + if (this.points.length) + writer.writeRepeatedMessage(3, this.points, (item: Point) => + item.serialize(writer) + ); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Arrow { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new Arrow(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage( + message.common, + () => (message.common = CommonInfo.deserialize(reader)) + ); + break; + case 2: + message.code = reader.readString(); + break; + case 3: + reader.readMessage(message.points, () => + pb_1.Message.addToRepeatedWrapperField( + message, + 3, + Point.deserialize(reader), + Point + ) + ); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Arrow { + return Arrow.deserialize(bytes); + } + } + export class IscsText extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor( + data?: + | any[] + | { common?: CommonInfo; code?: string; content?: string; color?: string; fontSize?: number; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("common" in data && data.common != undefined) { - this.common = data.common; - } - if ("code" in data && data.code != undefined) { - this.code = data.code; - } - if ("content" in data && data.content != undefined) { - this.content = data.content; - } - if ("color" in data && data.color != undefined) { - this.color = data.color; - } - if ("fontSize" in data && data.fontSize != undefined) { - this.fontSize = data.fontSize; - } - } + } + ) { + super(); + pb_1.Message.initialize( + this, + Array.isArray(data) ? data : [], + 0, + -1, + [], + this.#one_of_decls + ); + if (!Array.isArray(data) && typeof data == 'object') { + if ('common' in data && data.common != undefined) { + this.common = data.common; } - get common() { - return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + if ('code' in data && data.code != undefined) { + this.code = data.code; } - set common(value: CommonInfo) { - pb_1.Message.setWrapperField(this, 1, value); + if ('content' in data && data.content != undefined) { + this.content = data.content; } - get has_common() { - return pb_1.Message.getField(this, 1) != null; + if ('color' in data && data.color != undefined) { + this.color = data.color; } - get code() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set code(value: string) { - pb_1.Message.setField(this, 2, value); - } - get content() { - return pb_1.Message.getFieldWithDefault(this, 3, "") as string; - } - set content(value: string) { - pb_1.Message.setField(this, 3, value); - } - get color() { - return pb_1.Message.getFieldWithDefault(this, 4, "") as string; - } - set color(value: string) { - pb_1.Message.setField(this, 4, value); - } - get fontSize() { - return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; - } - set fontSize(value: number) { - pb_1.Message.setField(this, 5, value); - } - static fromObject(data: { - common?: ReturnType; - code?: string; - content?: string; - color?: string; - fontSize?: number; - }): IscsText { - const message = new IscsText({}); - if (data.common != null) { - message.common = CommonInfo.fromObject(data.common); - } - if (data.code != null) { - message.code = data.code; - } - if (data.content != null) { - message.content = data.content; - } - if (data.color != null) { - message.color = data.color; - } - if (data.fontSize != null) { - message.fontSize = data.fontSize; - } - return message; - } - toObject() { - const data: { - common?: ReturnType; - code?: string; - content?: string; - color?: string; - fontSize?: number; - } = {}; - if (this.common != null) { - data.common = this.common.toObject(); - } - if (this.code != null) { - data.code = this.code; - } - if (this.content != null) { - data.content = this.content; - } - if (this.color != null) { - data.color = this.color; - } - if (this.fontSize != null) { - data.fontSize = this.fontSize; - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.has_common) - writer.writeMessage(1, this.common, () => this.common.serialize(writer)); - if (this.code.length) - writer.writeString(2, this.code); - if (this.content.length) - writer.writeString(3, this.content); - if (this.color.length) - writer.writeString(4, this.color); - if (this.fontSize != 0) - writer.writeInt32(5, this.fontSize); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): IscsText { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new IscsText(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader)); - break; - case 2: - message.code = reader.readString(); - break; - case 3: - message.content = reader.readString(); - break; - case 4: - message.color = reader.readString(); - break; - case 5: - message.fontSize = reader.readInt32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): IscsText { - return IscsText.deserialize(bytes); + if ('fontSize' in data && data.fontSize != undefined) { + this.fontSize = data.fontSize; } + } } + get common() { + return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo; + } + set common(value: CommonInfo) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_common() { + return pb_1.Message.getField(this, 1) != null; + } + get code() { + return pb_1.Message.getFieldWithDefault(this, 2, '') as string; + } + set code(value: string) { + pb_1.Message.setField(this, 2, value); + } + get content() { + return pb_1.Message.getFieldWithDefault(this, 3, '') as string; + } + set content(value: string) { + pb_1.Message.setField(this, 3, value); + } + get color() { + return pb_1.Message.getFieldWithDefault(this, 4, '') as string; + } + set color(value: string) { + pb_1.Message.setField(this, 4, value); + } + get fontSize() { + return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; + } + set fontSize(value: number) { + pb_1.Message.setField(this, 5, value); + } + static fromObject(data: { + common?: ReturnType; + code?: string; + content?: string; + color?: string; + fontSize?: number; + }): IscsText { + const message = new IscsText({}); + if (data.common != null) { + message.common = CommonInfo.fromObject(data.common); + } + if (data.code != null) { + message.code = data.code; + } + if (data.content != null) { + message.content = data.content; + } + if (data.color != null) { + message.color = data.color; + } + if (data.fontSize != null) { + message.fontSize = data.fontSize; + } + return message; + } + toObject() { + const data: { + common?: ReturnType; + code?: string; + content?: string; + color?: string; + fontSize?: number; + } = {}; + if (this.common != null) { + data.common = this.common.toObject(); + } + if (this.code != null) { + data.code = this.code; + } + if (this.content != null) { + data.content = this.content; + } + if (this.color != null) { + data.color = this.color; + } + if (this.fontSize != null) { + data.fontSize = this.fontSize; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_common) + writer.writeMessage(1, this.common, () => + this.common.serialize(writer) + ); + if (this.code.length) writer.writeString(2, this.code); + if (this.content.length) writer.writeString(3, this.content); + if (this.color.length) writer.writeString(4, this.color); + if (this.fontSize != 0) writer.writeInt32(5, this.fontSize); + if (!w) return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): IscsText { + const reader = + bytes instanceof pb_1.BinaryReader + ? bytes + : new pb_1.BinaryReader(bytes), + message = new IscsText(); + while (reader.nextField()) { + if (reader.isEndGroup()) break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage( + message.common, + () => (message.common = CommonInfo.deserialize(reader)) + ); + break; + case 2: + message.code = reader.readString(); + break; + case 3: + message.content = reader.readString(); + break; + case 4: + message.color = reader.readString(); + break; + case 5: + message.fontSize = reader.readInt32(); + break; + default: + reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): IscsText { + return IscsText.deserialize(bytes); + } + } }