diff --git a/CHANGELOG.md b/CHANGELOG.md index b0bea89b..f7ebb6ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,16 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [v0.4.3] - 2023-08-04 + +### Changes + +- Scale Signatures for rust guests now properly use borrow/ownership semantics + +### Fixes + +- The NPM package for `scale` now has a proper `index.js` file so it can be imported + ## [v0.4.2] - 2023-09-27 ### Fixes @@ -261,7 +271,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Initial release of the Scale Runtime library. -[unreleased]: https://github.com/loopholelabs/scale/compare/v0.4.2...HEAD +[unreleased]: https://github.com/loopholelabs/scale/compare/v0.4.3...HEAD +[v0.4.3]: https://github.com/loopholelabs/scale/compare/v0.4.3 [v0.4.2]: https://github.com/loopholelabs/scale/compare/v0.4.2 [v0.4.1]: https://github.com/loopholelabs/scale/compare/v0.4.1 [v0.4.0]: https://github.com/loopholelabs/scale/compare/v0.4.0 diff --git a/Cargo.toml b/Cargo.toml index 28952f4f..02ba54c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "scale_rs" -version = "0.4.2" +version = "0.4.3" edition = "2021" description = "Scale is a framework for building high-performance plugin systems into any application, all powered by WebAssembly." homepage = "https://scale.sh" diff --git a/compile/rust/templates/lib.rs.templ b/compile/rust/templates/lib.rs.templ index 7457190f..9a7920ef 100644 --- a/compile/rust/templates/lib.rs.templ +++ b/compile/rust/templates/lib.rs.templ @@ -20,7 +20,7 @@ pub unsafe extern "C" fn run() -> u64 { let (ptr, len) = match signature::read() { Ok(opt) => { let output_opt = match opt { - Some(mut input) => { {{ .package_schema.Name }}::{{ .package_schema.Function }}(Some(&mut input)) }, + Some(input) => { {{ .package_schema.Name }}::{{ .package_schema.Function }}(Some(input)) }, None => { {{ .package_schema.Name }}::{{ .package_schema.Function }}(None) } }; match output_opt { diff --git a/compile/typescript/builder/interpreter/Cargo.toml b/compile/typescript/builder/interpreter/Cargo.toml index 21b549c8..579937e4 100644 --- a/compile/typescript/builder/interpreter/Cargo.toml +++ b/compile/typescript/builder/interpreter/Cargo.toml @@ -15,7 +15,7 @@ path = "main.rs" scale_signature_interfaces = "0.1.7" quickjs-wasm-sys = "1.1.0" once_cell = "1.4.0" -polyglot_rs = "1.1.2" +polyglot_rs = "1.1.3" anyhow = "1.0.75" flate2 = { version = "1.0.25", optional = true} diff --git a/compile/typescript/builder/js_builder-aarch64-apple-darwin b/compile/typescript/builder/js_builder-aarch64-apple-darwin index 041db381..49f4b6df 100755 Binary files a/compile/typescript/builder/js_builder-aarch64-apple-darwin and b/compile/typescript/builder/js_builder-aarch64-apple-darwin differ diff --git a/compile/typescript/builder/js_builder-aarch64-unknown-linux-gnu b/compile/typescript/builder/js_builder-aarch64-unknown-linux-gnu index b7bf4fa1..1399c0c2 100755 Binary files a/compile/typescript/builder/js_builder-aarch64-unknown-linux-gnu and b/compile/typescript/builder/js_builder-aarch64-unknown-linux-gnu differ diff --git a/compile/typescript/builder/js_builder-x86_64-apple-darwin b/compile/typescript/builder/js_builder-x86_64-apple-darwin index a4c04b0d..e53f2982 100755 Binary files a/compile/typescript/builder/js_builder-x86_64-apple-darwin and b/compile/typescript/builder/js_builder-x86_64-apple-darwin differ diff --git a/compile/typescript/builder/js_builder-x86_64-pc-windows-msvc.exe b/compile/typescript/builder/js_builder-x86_64-pc-windows-msvc.exe index 9c8dabca..a6a8621e 100644 Binary files a/compile/typescript/builder/js_builder-x86_64-pc-windows-msvc.exe and b/compile/typescript/builder/js_builder-x86_64-pc-windows-msvc.exe differ diff --git a/compile/typescript/builder/js_builder-x86_64-unknown-linux-gnu b/compile/typescript/builder/js_builder-x86_64-unknown-linux-gnu index 41fe9686..018067e6 100755 Binary files a/compile/typescript/builder/js_builder-x86_64-unknown-linux-gnu and b/compile/typescript/builder/js_builder-x86_64-unknown-linux-gnu differ diff --git a/index.ts b/index.ts new file mode 100644 index 00000000..ad220b27 --- /dev/null +++ b/index.ts @@ -0,0 +1,19 @@ +/* + Copyright 2022 Loophole Labs + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +export * from "./scale"; +export * from "./instance"; +export * from "./config"; \ No newline at end of file diff --git a/integration/golang_tests/generated/generated.go b/integration/golang_tests/generated/generated.go index e27b3036..d501e4ad 100644 --- a/integration/golang_tests/generated/generated.go +++ b/integration/golang_tests/generated/generated.go @@ -1,4 +1,4 @@ -// Code generated by scale-signature v0.4.2, DO NOT EDIT. +// Code generated by scale-signature v0.4.3, DO NOT EDIT. // output: generated package generated diff --git a/integration/golang_tests/host_signature/host.go b/integration/golang_tests/host_signature/host.go index 7e363362..5cb1f9de 100644 --- a/integration/golang_tests/host_signature/host.go +++ b/integration/golang_tests/host_signature/host.go @@ -1,4 +1,4 @@ -// Code generated by scale-signature v0.4.2, DO NOT EDIT. +// Code generated by scale-signature v0.4.3, DO NOT EDIT. // output: signature package signature diff --git a/integration/golang_tests/host_signature/types.go b/integration/golang_tests/host_signature/types.go index 0a1eb2b9..eab9d0c8 100644 --- a/integration/golang_tests/host_signature/types.go +++ b/integration/golang_tests/host_signature/types.go @@ -1,4 +1,4 @@ -// Code generated by scale-signature v0.4.2, DO NOT EDIT. +// Code generated by scale-signature v0.4.3, DO NOT EDIT. // output: signature package signature diff --git a/integration/golang_tests/signature/guest.go b/integration/golang_tests/signature/guest.go index 77fb2dbb..2f68d100 100644 --- a/integration/golang_tests/signature/guest.go +++ b/integration/golang_tests/signature/guest.go @@ -1,4 +1,4 @@ -// Code generated by scale-signature v0.4.2, DO NOT EDIT. +// Code generated by scale-signature v0.4.3, DO NOT EDIT. // output: signature package signature diff --git a/integration/golang_tests/signature/types.go b/integration/golang_tests/signature/types.go index 64de5bb8..76e355f9 100644 --- a/integration/golang_tests/signature/types.go +++ b/integration/golang_tests/signature/types.go @@ -1,4 +1,4 @@ -// Code generated by scale-signature v0.4.2, DO NOT EDIT. +// Code generated by scale-signature v0.4.3, DO NOT EDIT. // output: signature package signature diff --git a/integration/rust_tests/function/lib.rs b/integration/rust_tests/function/lib.rs index 854f5516..89618dab 100644 --- a/integration/rust_tests/function/lib.rs +++ b/integration/rust_tests/function/lib.rs @@ -17,10 +17,11 @@ use signature::types; pub fn example( - ctx: Option<&mut types::ModelWithAllFieldTypes>, + ctx: Option, ) -> Result, Box> { println!("This is a Rust Function"); - let unwrapped = ctx.unwrap(); + let mut unwrapped = ctx.unwrap(); unwrapped.string_field = "This is a Rust Function".to_string(); return signature::next(Some(unwrapped)); + // return Ok(Some(unwrapped)) } diff --git a/integration/rust_tests/generated/generated.rs b/integration/rust_tests/generated/generated.rs index 8985e7df..39982681 100644 --- a/integration/rust_tests/generated/generated.rs +++ b/integration/rust_tests/generated/generated.rs @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.4.2, DO NOT EDIT. +// Code generated by scale-signature 0.4.3, DO NOT EDIT. // output: generated #![allow(dead_code)] diff --git a/integration/rust_tests/signature/guest.rs b/integration/rust_tests/signature/guest.rs index 01af3780..57a17484 100644 --- a/integration/rust_tests/signature/guest.rs +++ b/integration/rust_tests/signature/guest.rs @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.4.2, DO NOT EDIT. +// Code generated by scale-signature 0.4.3, DO NOT EDIT. // output: local_example_latest_guest pub mod types; @@ -62,10 +62,13 @@ pub unsafe fn hash() -> (u32, u32) { }; } pub fn next( - ctx: Option<&mut types::ModelWithAllFieldTypes>, + ctx: Option, ) -> Result, Box> { unsafe { - let (ptr, len) = write(ctx); + let (ptr, len) = match ctx { + Some(mut ctx) => write(Some(&mut ctx)), + None => write(None), + }; _next(ptr, len); read() } diff --git a/integration/rust_tests/signature/types.rs b/integration/rust_tests/signature/types.rs index 9797fd54..6cdb38b8 100644 --- a/integration/rust_tests/signature/types.rs +++ b/integration/rust_tests/signature/types.rs @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.4.2, DO NOT EDIT. +// Code generated by scale-signature 0.4.3, DO NOT EDIT. // output: local_example_latest_guest #![allow(dead_code)] diff --git a/integration/typescript_tests/generated/generated.d.ts b/integration/typescript_tests/generated/generated.d.ts index 5eb8abe3..9211fbd3 100644 --- a/integration/typescript_tests/generated/generated.d.ts +++ b/integration/typescript_tests/generated/generated.d.ts @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.4.2, DO NOT EDIT. +// Code generated by scale-signature 0.4.3, DO NOT EDIT. // output: generated import { Encoder, Decoder, Kind } from "@loopholelabs/polyglot" diff --git a/integration/typescript_tests/generated/generated.js b/integration/typescript_tests/generated/generated.js index 7027bcf6..c9d1accc 100644 --- a/integration/typescript_tests/generated/generated.js +++ b/integration/typescript_tests/generated/generated.js @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.4.2, DO NOT EDIT. +// Code generated by scale-signature 0.4.3, DO NOT EDIT. // output: generated "use strict"; diff --git a/integration/typescript_tests/generated/generated.js.map b/integration/typescript_tests/generated/generated.js.map index b01c122a..7a051832 100644 --- a/integration/typescript_tests/generated/generated.js.map +++ b/integration/typescript_tests/generated/generated.js.map @@ -2,7 +2,7 @@ "version": 3, "sources": [""], "sourceRoot": "generated.js", - "sourcesContent": ["// Code generated by scale-signature 0.4.2, DO NOT EDIT.\n// output: generated\n\nimport { Encoder, Decoder, Kind } from \"@loopholelabs/polyglot\"\n\nexport class Context {\n a: number;\n b: number;\n c: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.a = decoder.int32();\n this.b = decoder.int32();\n this.c = decoder.int32();\n } else {\n this.a = 0;\n this.b = 0;\n this.c = 0;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.int32(this.a);\n encoder.int32(this.b);\n encoder.int32(this.c);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): Context | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new Context(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n"], + "sourcesContent": ["// Code generated by scale-signature 0.4.3, DO NOT EDIT.\n// output: generated\n\nimport { Encoder, Decoder, Kind } from \"@loopholelabs/polyglot\"\n\nexport class Context {\n a: number;\n b: number;\n c: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.a = decoder.int32();\n this.b = decoder.int32();\n this.c = decoder.int32();\n } else {\n this.a = 0;\n this.b = 0;\n this.c = 0;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.int32(this.a);\n encoder.int32(this.b);\n encoder.int32(this.c);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): Context | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new Context(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n"], "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,MAAM,QAAQ;AAAA;AAAA;AAAA;AAAA,EAQnB,YAAa,SAAmB;AAC9B,QAAI,SAAS;AACX,UAAI;AACJ,UAAI;AACF,cAAM,QAAQ,MAAM;AAAA,MACtB,SAAS,GAAG;AAAA,MAAC;AACb,UAAI,OAAO,QAAQ,aAAa;AAC9B,cAAM;AAAA,MACR;AACA,WAAK,IAAI,QAAQ,MAAM;AACvB,WAAK,IAAI,QAAQ,MAAM;AACvB,WAAK,IAAI,QAAQ,MAAM;AAAA,IACzB,OAAO;AACL,WAAK,IAAI;AACT,WAAK,IAAI;AACT,WAAK,IAAI;AAAA,IACX;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,OAAQ,SAAkB;AACxB,YAAQ,MAAM,KAAK,CAAC;AACpB,YAAQ,MAAM,KAAK,CAAC;AACpB,YAAQ,MAAM,KAAK,CAAC;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,OAAQ,SAAuC;AACpD,QAAI,QAAQ,KAAK,GAAG;AAClB,aAAO;AAAA,IACT;AACA,WAAO,IAAI,QAAQ,OAAO;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,iBAAkB,SAAkB;AACzC,YAAQ,KAAK;AAAA,EACf;AACF;", "names": [] } diff --git a/integration/typescript_tests/host_signature/index.d.ts b/integration/typescript_tests/host_signature/index.d.ts index 9d86da35..bf26051f 100644 --- a/integration/typescript_tests/host_signature/index.d.ts +++ b/integration/typescript_tests/host_signature/index.d.ts @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.4.2, DO NOT EDIT. +// Code generated by scale-signature 0.4.3, DO NOT EDIT. // output: local-example-latest-host import { Signature as SignatureInterface } from "@loopholelabs/scale-signature-interfaces"; diff --git a/integration/typescript_tests/host_signature/index.js b/integration/typescript_tests/host_signature/index.js index 84ad75d1..f1477915 100644 --- a/integration/typescript_tests/host_signature/index.js +++ b/integration/typescript_tests/host_signature/index.js @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.4.2, DO NOT EDIT. +// Code generated by scale-signature 0.4.3, DO NOT EDIT. // output: local-example-latest-host "use strict"; diff --git a/integration/typescript_tests/host_signature/index.js.map b/integration/typescript_tests/host_signature/index.js.map index 8c71849a..506a088d 100644 --- a/integration/typescript_tests/host_signature/index.js.map +++ b/integration/typescript_tests/host_signature/index.js.map @@ -2,7 +2,7 @@ "version": 3, "sources": [""], "sourceRoot": "index.js", - "sourcesContent": ["// Code generated by scale-signature 0.4.2, DO NOT EDIT.\n// output: local-example-latest-host\n\n/* eslint no-bitwise: off */\n\nimport { Signature as SignatureInterface } from \"@loopholelabs/scale-signature-interfaces\";\nimport { Decoder, Encoder, Kind } from \"@loopholelabs/polyglot\";\n\nexport * from \"./types\";\nimport { ModelWithAllFieldTypes } from \"./types\";\n\nconst hash = \"3a592aa345d412faa2e6285ee048ca2ab5aa64b0caa2f9ca67b2c1e0792101e5\"\n\n// New returns a new signature and tells the Scale Runtime how to use it\n//\n// This function should be passed into the scale runtime config as an argument\nexport function New(): Signature {\n return new Signature();\n}\n\n// Signature is the host representation of the signature\n//\n// Users should not use this type directly, but instead pass the New() function\n// to the Scale Runtime\nexport class Signature implements SignatureInterface {\n public context: ModelWithAllFieldTypes;\n\n constructor() {\n this.context = new ModelWithAllFieldTypes();\n }\n\n // Read reads the context from the given Uint8Array and returns an error if one occurred\n //\n // This method is meant to be used by the Scale Runtime to deserialize the Signature\n Read(b: Uint8Array): Error | undefined {\n const dec = new Decoder(b);\n try {\n Object.assign(this.context, ModelWithAllFieldTypes.decode(dec));\n } catch (err) {\n return err as Error;\n }\n return undefined;\n }\n\n // Write writes the signature into a Uint8Array and returns it\n //\n // This method is meant to be used by the Scale Runtime to serialize the Signature\n Write(): Uint8Array {\n const enc = new Encoder();\n this.context.encode(enc);\n return enc.bytes;\n }\n\n // Error writes the signature into a Uint8Array and returns it\n //\n // This method is meant to be used by the Scale Runtime to return an error\n Error(err: Error): Uint8Array {\n const enc = new Encoder();\n enc.error(err);\n return enc.bytes;\n }\n\n // Hash returns the hash of the signature\n //\n // This method is meant to be used by the Scale Runtime to validate Signature and Function compatibility\n Hash(): string {\n return hash;\n }\n}\n"], + "sourcesContent": ["// Code generated by scale-signature 0.4.3, DO NOT EDIT.\n// output: local-example-latest-host\n\n/* eslint no-bitwise: off */\n\nimport { Signature as SignatureInterface } from \"@loopholelabs/scale-signature-interfaces\";\nimport { Decoder, Encoder, Kind } from \"@loopholelabs/polyglot\";\n\nexport * from \"./types\";\nimport { ModelWithAllFieldTypes } from \"./types\";\n\nconst hash = \"3a592aa345d412faa2e6285ee048ca2ab5aa64b0caa2f9ca67b2c1e0792101e5\"\n\n// New returns a new signature and tells the Scale Runtime how to use it\n//\n// This function should be passed into the scale runtime config as an argument\nexport function New(): Signature {\n return new Signature();\n}\n\n// Signature is the host representation of the signature\n//\n// Users should not use this type directly, but instead pass the New() function\n// to the Scale Runtime\nexport class Signature implements SignatureInterface {\n public context: ModelWithAllFieldTypes;\n\n constructor() {\n this.context = new ModelWithAllFieldTypes();\n }\n\n // Read reads the context from the given Uint8Array and returns an error if one occurred\n //\n // This method is meant to be used by the Scale Runtime to deserialize the Signature\n Read(b: Uint8Array): Error | undefined {\n const dec = new Decoder(b);\n try {\n Object.assign(this.context, ModelWithAllFieldTypes.decode(dec));\n } catch (err) {\n return err as Error;\n }\n return undefined;\n }\n\n // Write writes the signature into a Uint8Array and returns it\n //\n // This method is meant to be used by the Scale Runtime to serialize the Signature\n Write(): Uint8Array {\n const enc = new Encoder();\n this.context.encode(enc);\n return enc.bytes;\n }\n\n // Error writes the signature into a Uint8Array and returns it\n //\n // This method is meant to be used by the Scale Runtime to return an error\n Error(err: Error): Uint8Array {\n const enc = new Encoder();\n enc.error(err);\n return enc.bytes;\n }\n\n // Hash returns the hash of the signature\n //\n // This method is meant to be used by the Scale Runtime to validate Signature and Function compatibility\n Hash(): string {\n return hash;\n }\n}\n"], "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,sBAAuC;AAEvC,0BAAc,oBARd;AASA,mBAAuC;AAEvC,MAAM,OAAO;AAKN,SAAS,MAAiB;AAC/B,SAAO,IAAI,UAAU;AACvB;AAMO,MAAM,UAAwC;AAAA,EAGnD,cAAc;AACZ,SAAK,UAAU,IAAI,oCAAuB;AAAA,EAC5C;AAAA;AAAA;AAAA;AAAA,EAKA,KAAK,GAAkC;AACrC,UAAM,MAAM,IAAI,wBAAQ,CAAC;AACzB,QAAI;AACF,aAAO,OAAO,KAAK,SAAS,oCAAuB,OAAO,GAAG,CAAC;AAAA,IAChE,SAAS,KAAK;AACZ,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,QAAoB;AAClB,UAAM,MAAM,IAAI,wBAAQ;AACxB,SAAK,QAAQ,OAAO,GAAG;AACvB,WAAO,IAAI;AAAA,EACb;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,KAAwB;AAC5B,UAAM,MAAM,IAAI,wBAAQ;AACxB,QAAI,MAAM,GAAG;AACb,WAAO,IAAI;AAAA,EACb;AAAA;AAAA;AAAA;AAAA,EAKA,OAAe;AACb,WAAO;AAAA,EACT;AACF;", "names": [] } diff --git a/integration/typescript_tests/host_signature/index.ts b/integration/typescript_tests/host_signature/index.ts index 6008300c..ebaae2d5 100644 --- a/integration/typescript_tests/host_signature/index.ts +++ b/integration/typescript_tests/host_signature/index.ts @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.4.2, DO NOT EDIT. +// Code generated by scale-signature 0.4.3, DO NOT EDIT. // output: local-example-latest-host /* eslint no-bitwise: off */ diff --git a/integration/typescript_tests/host_signature/types.d.ts b/integration/typescript_tests/host_signature/types.d.ts index d344cd31..0bc5d2fe 100644 --- a/integration/typescript_tests/host_signature/types.d.ts +++ b/integration/typescript_tests/host_signature/types.d.ts @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.4.2, DO NOT EDIT. +// Code generated by scale-signature 0.4.3, DO NOT EDIT. // output: local-example-latest-host import { Encoder, Decoder, Kind } from "@loopholelabs/polyglot" diff --git a/integration/typescript_tests/host_signature/types.js b/integration/typescript_tests/host_signature/types.js index 537384b1..ea106fbc 100644 --- a/integration/typescript_tests/host_signature/types.js +++ b/integration/typescript_tests/host_signature/types.js @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.4.2, DO NOT EDIT. +// Code generated by scale-signature 0.4.3, DO NOT EDIT. // output: local-example-latest-host "use strict"; diff --git a/integration/typescript_tests/host_signature/types.js.map b/integration/typescript_tests/host_signature/types.js.map index f433ed0e..bf3af8d6 100644 --- a/integration/typescript_tests/host_signature/types.js.map +++ b/integration/typescript_tests/host_signature/types.js.map @@ -2,7 +2,7 @@ "version": 3, "sources": [""], "sourceRoot": "types.js", - "sourcesContent": ["// Code generated by scale-signature 0.4.2, DO NOT EDIT.\n// output: local-example-latest-host\n\nimport { Encoder, Decoder, Kind } from \"@loopholelabs/polyglot\"\n\nexport enum GenericEnum {\n FirstValue = 0,\n\n SecondValue = 1,\n\n DefaultValue = 2,\n\n}\nexport class EmptyModel {\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n } else {\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): EmptyModel | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new EmptyModel(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// EmptyModelWithDescription: Test Description\nexport class EmptyModelWithDescription {\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n } else {\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): EmptyModelWithDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new EmptyModelWithDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithSingleStringField {\n stringField: string;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n } else {\n this.stringField = \"DefaultValue\";\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleStringField | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleStringField(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithSingleStringFieldAndDescription: Test Description\nexport class ModelWithSingleStringFieldAndDescription {\n stringField: string;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n } else {\n this.stringField = \"DefaultValue\";\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleStringFieldAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleStringFieldAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithSingleInt32Field {\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.int32Field = decoder.int32();\n } else {\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleInt32Field | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleInt32Field(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithSingleInt32FieldAndDescription: Test Description\nexport class ModelWithSingleInt32FieldAndDescription {\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.int32Field = decoder.int32();\n } else {\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleInt32FieldAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleInt32FieldAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithMultipleFields {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFields | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFields(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithMultipleFieldsAndDescription: Test Description\nexport class ModelWithMultipleFieldsAndDescription {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEnum {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnum | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnum(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEnumAndDescription: Test Description\nexport class ModelWithEnumAndDescription {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEnumAccessor {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEnumAccessorAndDescription: Test Description\nexport class ModelWithEnumAccessorAndDescription {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithMultipleFieldsAccessor {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithMultipleFieldsAccessorAndDescription: Test Description\nexport class ModelWithMultipleFieldsAccessorAndDescription {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEmbeddedModels {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModels | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModels(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEmbeddedModelsAndDescription: Test Description\nexport class ModelWithEmbeddedModelsAndDescription {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEmbeddedModelsAccessor {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEmbeddedModelsAccessorAndDescription: Test Description\nexport class ModelWithEmbeddedModelsAccessorAndDescription {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithAllFieldTypes {\n modelField: EmptyModel | undefined;\n\n modelArrayField: Array;\n\n stringField: string;\n\n stringArrayField: string[];\n\n stringMapField: Map;\n\n stringMapFieldEmbedded: Map;\n\n int32Field: number;\n\n int32ArrayField: number[];\n\n int32MapField: Map;\n\n int32MapFieldEmbedded: Map;\n\n int64Field: bigint;\n\n int64ArrayField: bigint[];\n\n int64MapField: Map;\n\n int64MapFieldEmbedded: Map;\n\n uint32Field: number;\n\n uint32ArrayField: number[];\n\n uint32MapField: Map;\n\n uint32MapFieldEmbedded: Map;\n\n uint64Field: bigint;\n\n uint64ArrayField: bigint[];\n\n uint64MapField: Map;\n\n uint64MapFieldEmbedded: Map;\n\n float32Field: number;\n\n float32ArrayField: number[];\n\n float64Field: number;\n\n float64ArrayField: number[];\n\n enumField: GenericEnum;\n\n enumArrayField: GenericEnum[];\n\n enumMapField: Map;\n\n enumMapFieldEmbedded: Map;\n\n bytesField: Uint8Array;\n\n bytesArrayField: Uint8Array[];\n\n boolField: boolean;\n\n boolArrayField: boolean[];\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.modelField = EmptyModel.decode(decoder);\n const modelArrayFieldSize = decoder.array(Kind.Any);\n this.modelArrayField = new Array(modelArrayFieldSize);\n for (let i = 0; i < modelArrayFieldSize; i += 1) {\n const x = EmptyModel.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.modelArrayField[i] = x;\n }\n }\n this.stringField = decoder.string();\n const stringArrayFieldSize = decoder.array(Kind.String);\n this.stringArrayField = new Array(stringArrayFieldSize);\n for (let i = 0; i < stringArrayFieldSize; i += 1) {\n this.stringArrayField[i] = decoder.string();\n }\n this.stringMapField = new Map();\n let stringMapFieldSize = decoder.map(Kind.String, Kind.String);\n for (let i = 0; i < stringMapFieldSize; i++) {\n let key = decoder.string();\n let val = decoder.string();\n this.stringMapField.set(key, val);\n }\n this.stringMapFieldEmbedded = new Map();\n let stringMapFieldEmbeddedSize = decoder.map(Kind.String, Kind.Any);\n for (let i = 0; i < stringMapFieldEmbeddedSize; i++) {\n let key = decoder.string();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.stringMapFieldEmbedded.set(key, val);\n }\n }\n this.int32Field = decoder.int32();\n const int32ArrayFieldSize = decoder.array(Kind.Int32);\n this.int32ArrayField = new Array(int32ArrayFieldSize);\n for (let i = 0; i < int32ArrayFieldSize; i += 1) {\n this.int32ArrayField[i] = decoder.int32();\n }\n this.int32MapField = new Map();\n let int32MapFieldSize = decoder.map(Kind.Int32, Kind.Int32);\n for (let i = 0; i < int32MapFieldSize; i++) {\n let key = decoder.int32();\n let val = decoder.int32();\n this.int32MapField.set(key, val);\n }\n this.int32MapFieldEmbedded = new Map();\n let int32MapFieldEmbeddedSize = decoder.map(Kind.Int32, Kind.Any);\n for (let i = 0; i < int32MapFieldEmbeddedSize; i++) {\n let key = decoder.int32();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.int32MapFieldEmbedded.set(key, val);\n }\n }\n this.int64Field = decoder.int64();\n const int64ArrayFieldSize = decoder.array(Kind.Int64);\n this.int64ArrayField = new Array(int64ArrayFieldSize);\n for (let i = 0; i < int64ArrayFieldSize; i += 1) {\n this.int64ArrayField[i] = decoder.int64();\n }\n this.int64MapField = new Map();\n let int64MapFieldSize = decoder.map(Kind.Int64, Kind.Int64);\n for (let i = 0; i < int64MapFieldSize; i++) {\n let key = decoder.int64();\n let val = decoder.int64();\n this.int64MapField.set(key, val);\n }\n this.int64MapFieldEmbedded = new Map();\n let int64MapFieldEmbeddedSize = decoder.map(Kind.Int64, Kind.Any);\n for (let i = 0; i < int64MapFieldEmbeddedSize; i++) {\n let key = decoder.int64();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.int64MapFieldEmbedded.set(key, val);\n }\n }\n this.uint32Field = decoder.uint32();\n const uint32ArrayFieldSize = decoder.array(Kind.Uint32);\n this.uint32ArrayField = new Array(uint32ArrayFieldSize);\n for (let i = 0; i < uint32ArrayFieldSize; i += 1) {\n this.uint32ArrayField[i] = decoder.uint32();\n }\n this.uint32MapField = new Map();\n let uint32MapFieldSize = decoder.map(Kind.Uint32, Kind.Uint32);\n for (let i = 0; i < uint32MapFieldSize; i++) {\n let key = decoder.uint32();\n let val = decoder.uint32();\n this.uint32MapField.set(key, val);\n }\n this.uint32MapFieldEmbedded = new Map();\n let uint32MapFieldEmbeddedSize = decoder.map(Kind.Uint32, Kind.Any);\n for (let i = 0; i < uint32MapFieldEmbeddedSize; i++) {\n let key = decoder.uint32();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.uint32MapFieldEmbedded.set(key, val);\n }\n }\n this.uint64Field = decoder.uint64();\n const uint64ArrayFieldSize = decoder.array(Kind.Uint64);\n this.uint64ArrayField = new Array(uint64ArrayFieldSize);\n for (let i = 0; i < uint64ArrayFieldSize; i += 1) {\n this.uint64ArrayField[i] = decoder.uint64();\n }\n this.uint64MapField = new Map();\n let uint64MapFieldSize = decoder.map(Kind.Uint64, Kind.Uint64);\n for (let i = 0; i < uint64MapFieldSize; i++) {\n let key = decoder.uint64();\n let val = decoder.uint64();\n this.uint64MapField.set(key, val);\n }\n this.uint64MapFieldEmbedded = new Map();\n let uint64MapFieldEmbeddedSize = decoder.map(Kind.Uint64, Kind.Any);\n for (let i = 0; i < uint64MapFieldEmbeddedSize; i++) {\n let key = decoder.uint64();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.uint64MapFieldEmbedded.set(key, val);\n }\n }\n this.float32Field = decoder.float32();\n const float32ArrayFieldSize = decoder.array(Kind.Float32);\n this.float32ArrayField = new Array(float32ArrayFieldSize);\n for (let i = 0; i < float32ArrayFieldSize; i += 1) {\n this.float32ArrayField[i] = decoder.float32();\n }\n this.float64Field = decoder.float64();\n const float64ArrayFieldSize = decoder.array(Kind.Float64);\n this.float64ArrayField = new Array(float64ArrayFieldSize);\n for (let i = 0; i < float64ArrayFieldSize; i += 1) {\n this.float64ArrayField[i] = decoder.float64();\n }\n this.enumField = decoder.uint32();\n const enumArrayFieldSize = decoder.array(Kind.Uint32);\n this.enumArrayField = new Array(enumArrayFieldSize);\n for (let i = 0; i < enumArrayFieldSize; i += 1) {\n this.enumArrayField[i] = decoder.uint32();\n }\n this.enumMapField = new Map();\n let enumMapFieldSize = decoder.map(Kind.Uint32, Kind.String);\n for (let i = 0; i < enumMapFieldSize; i++) {\n let key = decoder.uint32();\n let val = decoder.string();\n this.enumMapField.set(key, val);\n }\n this.enumMapFieldEmbedded = new Map();\n let enumMapFieldEmbeddedSize = decoder.map(Kind.Uint32, Kind.Any);\n for (let i = 0; i < enumMapFieldEmbeddedSize; i++) {\n let key = decoder.uint32();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.enumMapFieldEmbedded.set(key, val);\n }\n }\n this.bytesField = decoder.uint8Array();\n const bytesArrayFieldSize = decoder.array(Kind.Uint8Array);\n this.bytesArrayField = new Array(bytesArrayFieldSize);\n for (let i = 0; i < bytesArrayFieldSize; i += 1) {\n this.bytesArrayField[i] = decoder.uint8Array();\n }\n this.boolField = decoder.boolean();\n const boolArrayFieldSize = decoder.array(Kind.Boolean);\n this.boolArrayField = new Array(boolArrayFieldSize);\n for (let i = 0; i < boolArrayFieldSize; i += 1) {\n this.boolArrayField[i] = decoder.boolean();\n }\n } else {\n this.modelField = new EmptyModel();\n this.modelArrayField = [];\n this.stringField = \"DefaultValue\";\n this.stringArrayField = [];\n this.stringMapField = new Map();\n this.stringMapFieldEmbedded = new Map();\n this.int32Field = 32;\n this.int32ArrayField = [];\n this.int32MapField = new Map();\n this.int32MapFieldEmbedded = new Map();\n this.int64Field = 64n;\n this.int64ArrayField = [];\n this.int64MapField = new Map();\n this.int64MapFieldEmbedded = new Map();\n this.uint32Field = 32;\n this.uint32ArrayField = [];\n this.uint32MapField = new Map();\n this.uint32MapFieldEmbedded = new Map();\n this.uint64Field = 64n;\n this.uint64ArrayField = [];\n this.uint64MapField = new Map();\n this.uint64MapFieldEmbedded = new Map();\n this.float32Field = 32.32;\n this.float32ArrayField = [];\n this.float64Field = 64.64;\n this.float64ArrayField = [];\n this.enumField = GenericEnum.DefaultValue;\n this.enumArrayField = [];\n this.enumMapField = new Map();\n this.enumMapFieldEmbedded = new Map();\n this.bytesField = new Uint8Array(512);\n this.bytesArrayField = [];\n this.boolField = true;\n this.boolArrayField = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.modelField === \"undefined\") {\n encoder.null();\n } else {\n this.modelField.encode(encoder);\n }\n const modelArrayFieldLength = this.modelArrayField.length;\n encoder.array(modelArrayFieldLength, Kind.Any);\n for (let i = 0; i < modelArrayFieldLength; i += 1) {\n const el = this.modelArrayField[i];\n el.encode(encoder);\n }\n encoder.string(this.stringField);\n const stringArrayFieldLength = this.stringArrayField.length;\n encoder.array(stringArrayFieldLength, Kind.String);\n for (let i = 0; i < stringArrayFieldLength; i += 1) {\n encoder.string(this.stringArrayField[i]);\n }\n encoder.map(this.stringMapField.size, Kind.String, Kind.String);\n this.stringMapField.forEach((val, key) => {\n encoder.string(key);\n encoder.string(val);\n });\n encoder.map(this.stringMapFieldEmbedded.size, Kind.String, Kind.Any);\n this.stringMapFieldEmbedded.forEach((val, key) => {\n encoder.string(key);\n val.encode(encoder);\n });\n encoder.int32(this.int32Field);\n const int32ArrayFieldLength = this.int32ArrayField.length;\n encoder.array(int32ArrayFieldLength, Kind.Int32);\n for (let i = 0; i < int32ArrayFieldLength; i += 1) {\n encoder.int32(this.int32ArrayField[i]);\n }\n encoder.map(this.int32MapField.size, Kind.Int32, Kind.Int32);\n this.int32MapField.forEach((val, key) => {\n encoder.int32(key);\n encoder.int32(val);\n });\n encoder.map(this.int32MapFieldEmbedded.size, Kind.Int32, Kind.Any);\n this.int32MapFieldEmbedded.forEach((val, key) => {\n encoder.int32(key);\n val.encode(encoder);\n });\n encoder.int64(this.int64Field);\n const int64ArrayFieldLength = this.int64ArrayField.length;\n encoder.array(int64ArrayFieldLength, Kind.Int64);\n for (let i = 0; i < int64ArrayFieldLength; i += 1) {\n encoder.int64(this.int64ArrayField[i]);\n }\n encoder.map(this.int64MapField.size, Kind.Int64, Kind.Int64);\n this.int64MapField.forEach((val, key) => {\n encoder.int64(key);\n encoder.int64(val);\n });\n encoder.map(this.int64MapFieldEmbedded.size, Kind.Int64, Kind.Any);\n this.int64MapFieldEmbedded.forEach((val, key) => {\n encoder.int64(key);\n val.encode(encoder);\n });\n encoder.uint32(this.uint32Field);\n const uint32ArrayFieldLength = this.uint32ArrayField.length;\n encoder.array(uint32ArrayFieldLength, Kind.Uint32);\n for (let i = 0; i < uint32ArrayFieldLength; i += 1) {\n encoder.uint32(this.uint32ArrayField[i]);\n }\n encoder.map(this.uint32MapField.size, Kind.Uint32, Kind.Uint32);\n this.uint32MapField.forEach((val, key) => {\n encoder.uint32(key);\n encoder.uint32(val);\n });\n encoder.map(this.uint32MapFieldEmbedded.size, Kind.Uint32, Kind.Any);\n this.uint32MapFieldEmbedded.forEach((val, key) => {\n encoder.uint32(key);\n val.encode(encoder);\n });\n encoder.uint64(this.uint64Field);\n const uint64ArrayFieldLength = this.uint64ArrayField.length;\n encoder.array(uint64ArrayFieldLength, Kind.Uint64);\n for (let i = 0; i < uint64ArrayFieldLength; i += 1) {\n encoder.uint64(this.uint64ArrayField[i]);\n }\n encoder.map(this.uint64MapField.size, Kind.Uint64, Kind.Uint64);\n this.uint64MapField.forEach((val, key) => {\n encoder.uint64(key);\n encoder.uint64(val);\n });\n encoder.map(this.uint64MapFieldEmbedded.size, Kind.Uint64, Kind.Any);\n this.uint64MapFieldEmbedded.forEach((val, key) => {\n encoder.uint64(key);\n val.encode(encoder);\n });\n encoder.float32(this.float32Field);\n const float32ArrayFieldLength = this.float32ArrayField.length;\n encoder.array(float32ArrayFieldLength, Kind.Float32);\n for (let i = 0; i < float32ArrayFieldLength; i += 1) {\n encoder.float32(this.float32ArrayField[i]);\n }\n encoder.float64(this.float64Field);\n const float64ArrayFieldLength = this.float64ArrayField.length;\n encoder.array(float64ArrayFieldLength, Kind.Float64);\n for (let i = 0; i < float64ArrayFieldLength; i += 1) {\n encoder.float64(this.float64ArrayField[i]);\n }\n encoder.uint32(this.enumField);\n const enumArrayFieldLength = this.enumArrayField.length;\n encoder.array(enumArrayFieldLength, Kind.Uint32);\n for (let i = 0; i < enumArrayFieldLength; i += 1) {\n encoder.uint32(this.enumArrayField[i]);\n }\n encoder.map(this.enumMapField.size, Kind.Uint32, Kind.String);\n this.enumMapField.forEach((val, key) => {\n encoder.uint32(key);\n encoder.string(val);\n });\n encoder.map(this.enumMapFieldEmbedded.size, Kind.Uint32, Kind.Any);\n this.enumMapFieldEmbedded.forEach((val, key) => {\n encoder.uint32(key);\n val.encode(encoder);\n });\n encoder.uint8Array(this.bytesField);\n const bytesArrayFieldLength = this.bytesArrayField.length;\n encoder.array(bytesArrayFieldLength, Kind.Uint8Array);\n for (let i = 0; i < bytesArrayFieldLength; i += 1) {\n encoder.uint8Array(this.bytesArrayField[i]);\n }\n encoder.boolean(this.boolField);\n const boolArrayFieldLength = this.boolArrayField.length;\n encoder.array(boolArrayFieldLength, Kind.Boolean);\n for (let i = 0; i < boolArrayFieldLength; i += 1) {\n encoder.boolean(this.boolArrayField[i]);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithAllFieldTypes | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithAllFieldTypes(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n"], + "sourcesContent": ["// Code generated by scale-signature 0.4.3, DO NOT EDIT.\n// output: local-example-latest-host\n\nimport { Encoder, Decoder, Kind } from \"@loopholelabs/polyglot\"\n\nexport enum GenericEnum {\n FirstValue = 0,\n\n SecondValue = 1,\n\n DefaultValue = 2,\n\n}\nexport class EmptyModel {\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n } else {\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): EmptyModel | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new EmptyModel(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// EmptyModelWithDescription: Test Description\nexport class EmptyModelWithDescription {\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n } else {\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): EmptyModelWithDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new EmptyModelWithDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithSingleStringField {\n stringField: string;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n } else {\n this.stringField = \"DefaultValue\";\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleStringField | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleStringField(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithSingleStringFieldAndDescription: Test Description\nexport class ModelWithSingleStringFieldAndDescription {\n stringField: string;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n } else {\n this.stringField = \"DefaultValue\";\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleStringFieldAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleStringFieldAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithSingleInt32Field {\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.int32Field = decoder.int32();\n } else {\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleInt32Field | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleInt32Field(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithSingleInt32FieldAndDescription: Test Description\nexport class ModelWithSingleInt32FieldAndDescription {\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.int32Field = decoder.int32();\n } else {\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleInt32FieldAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleInt32FieldAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithMultipleFields {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFields | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFields(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithMultipleFieldsAndDescription: Test Description\nexport class ModelWithMultipleFieldsAndDescription {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEnum {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnum | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnum(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEnumAndDescription: Test Description\nexport class ModelWithEnumAndDescription {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEnumAccessor {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEnumAccessorAndDescription: Test Description\nexport class ModelWithEnumAccessorAndDescription {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithMultipleFieldsAccessor {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithMultipleFieldsAccessorAndDescription: Test Description\nexport class ModelWithMultipleFieldsAccessorAndDescription {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEmbeddedModels {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModels | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModels(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEmbeddedModelsAndDescription: Test Description\nexport class ModelWithEmbeddedModelsAndDescription {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEmbeddedModelsAccessor {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEmbeddedModelsAccessorAndDescription: Test Description\nexport class ModelWithEmbeddedModelsAccessorAndDescription {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithAllFieldTypes {\n modelField: EmptyModel | undefined;\n\n modelArrayField: Array;\n\n stringField: string;\n\n stringArrayField: string[];\n\n stringMapField: Map;\n\n stringMapFieldEmbedded: Map;\n\n int32Field: number;\n\n int32ArrayField: number[];\n\n int32MapField: Map;\n\n int32MapFieldEmbedded: Map;\n\n int64Field: bigint;\n\n int64ArrayField: bigint[];\n\n int64MapField: Map;\n\n int64MapFieldEmbedded: Map;\n\n uint32Field: number;\n\n uint32ArrayField: number[];\n\n uint32MapField: Map;\n\n uint32MapFieldEmbedded: Map;\n\n uint64Field: bigint;\n\n uint64ArrayField: bigint[];\n\n uint64MapField: Map;\n\n uint64MapFieldEmbedded: Map;\n\n float32Field: number;\n\n float32ArrayField: number[];\n\n float64Field: number;\n\n float64ArrayField: number[];\n\n enumField: GenericEnum;\n\n enumArrayField: GenericEnum[];\n\n enumMapField: Map;\n\n enumMapFieldEmbedded: Map;\n\n bytesField: Uint8Array;\n\n bytesArrayField: Uint8Array[];\n\n boolField: boolean;\n\n boolArrayField: boolean[];\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.modelField = EmptyModel.decode(decoder);\n const modelArrayFieldSize = decoder.array(Kind.Any);\n this.modelArrayField = new Array(modelArrayFieldSize);\n for (let i = 0; i < modelArrayFieldSize; i += 1) {\n const x = EmptyModel.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.modelArrayField[i] = x;\n }\n }\n this.stringField = decoder.string();\n const stringArrayFieldSize = decoder.array(Kind.String);\n this.stringArrayField = new Array(stringArrayFieldSize);\n for (let i = 0; i < stringArrayFieldSize; i += 1) {\n this.stringArrayField[i] = decoder.string();\n }\n this.stringMapField = new Map();\n let stringMapFieldSize = decoder.map(Kind.String, Kind.String);\n for (let i = 0; i < stringMapFieldSize; i++) {\n let key = decoder.string();\n let val = decoder.string();\n this.stringMapField.set(key, val);\n }\n this.stringMapFieldEmbedded = new Map();\n let stringMapFieldEmbeddedSize = decoder.map(Kind.String, Kind.Any);\n for (let i = 0; i < stringMapFieldEmbeddedSize; i++) {\n let key = decoder.string();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.stringMapFieldEmbedded.set(key, val);\n }\n }\n this.int32Field = decoder.int32();\n const int32ArrayFieldSize = decoder.array(Kind.Int32);\n this.int32ArrayField = new Array(int32ArrayFieldSize);\n for (let i = 0; i < int32ArrayFieldSize; i += 1) {\n this.int32ArrayField[i] = decoder.int32();\n }\n this.int32MapField = new Map();\n let int32MapFieldSize = decoder.map(Kind.Int32, Kind.Int32);\n for (let i = 0; i < int32MapFieldSize; i++) {\n let key = decoder.int32();\n let val = decoder.int32();\n this.int32MapField.set(key, val);\n }\n this.int32MapFieldEmbedded = new Map();\n let int32MapFieldEmbeddedSize = decoder.map(Kind.Int32, Kind.Any);\n for (let i = 0; i < int32MapFieldEmbeddedSize; i++) {\n let key = decoder.int32();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.int32MapFieldEmbedded.set(key, val);\n }\n }\n this.int64Field = decoder.int64();\n const int64ArrayFieldSize = decoder.array(Kind.Int64);\n this.int64ArrayField = new Array(int64ArrayFieldSize);\n for (let i = 0; i < int64ArrayFieldSize; i += 1) {\n this.int64ArrayField[i] = decoder.int64();\n }\n this.int64MapField = new Map();\n let int64MapFieldSize = decoder.map(Kind.Int64, Kind.Int64);\n for (let i = 0; i < int64MapFieldSize; i++) {\n let key = decoder.int64();\n let val = decoder.int64();\n this.int64MapField.set(key, val);\n }\n this.int64MapFieldEmbedded = new Map();\n let int64MapFieldEmbeddedSize = decoder.map(Kind.Int64, Kind.Any);\n for (let i = 0; i < int64MapFieldEmbeddedSize; i++) {\n let key = decoder.int64();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.int64MapFieldEmbedded.set(key, val);\n }\n }\n this.uint32Field = decoder.uint32();\n const uint32ArrayFieldSize = decoder.array(Kind.Uint32);\n this.uint32ArrayField = new Array(uint32ArrayFieldSize);\n for (let i = 0; i < uint32ArrayFieldSize; i += 1) {\n this.uint32ArrayField[i] = decoder.uint32();\n }\n this.uint32MapField = new Map();\n let uint32MapFieldSize = decoder.map(Kind.Uint32, Kind.Uint32);\n for (let i = 0; i < uint32MapFieldSize; i++) {\n let key = decoder.uint32();\n let val = decoder.uint32();\n this.uint32MapField.set(key, val);\n }\n this.uint32MapFieldEmbedded = new Map();\n let uint32MapFieldEmbeddedSize = decoder.map(Kind.Uint32, Kind.Any);\n for (let i = 0; i < uint32MapFieldEmbeddedSize; i++) {\n let key = decoder.uint32();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.uint32MapFieldEmbedded.set(key, val);\n }\n }\n this.uint64Field = decoder.uint64();\n const uint64ArrayFieldSize = decoder.array(Kind.Uint64);\n this.uint64ArrayField = new Array(uint64ArrayFieldSize);\n for (let i = 0; i < uint64ArrayFieldSize; i += 1) {\n this.uint64ArrayField[i] = decoder.uint64();\n }\n this.uint64MapField = new Map();\n let uint64MapFieldSize = decoder.map(Kind.Uint64, Kind.Uint64);\n for (let i = 0; i < uint64MapFieldSize; i++) {\n let key = decoder.uint64();\n let val = decoder.uint64();\n this.uint64MapField.set(key, val);\n }\n this.uint64MapFieldEmbedded = new Map();\n let uint64MapFieldEmbeddedSize = decoder.map(Kind.Uint64, Kind.Any);\n for (let i = 0; i < uint64MapFieldEmbeddedSize; i++) {\n let key = decoder.uint64();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.uint64MapFieldEmbedded.set(key, val);\n }\n }\n this.float32Field = decoder.float32();\n const float32ArrayFieldSize = decoder.array(Kind.Float32);\n this.float32ArrayField = new Array(float32ArrayFieldSize);\n for (let i = 0; i < float32ArrayFieldSize; i += 1) {\n this.float32ArrayField[i] = decoder.float32();\n }\n this.float64Field = decoder.float64();\n const float64ArrayFieldSize = decoder.array(Kind.Float64);\n this.float64ArrayField = new Array(float64ArrayFieldSize);\n for (let i = 0; i < float64ArrayFieldSize; i += 1) {\n this.float64ArrayField[i] = decoder.float64();\n }\n this.enumField = decoder.uint32();\n const enumArrayFieldSize = decoder.array(Kind.Uint32);\n this.enumArrayField = new Array(enumArrayFieldSize);\n for (let i = 0; i < enumArrayFieldSize; i += 1) {\n this.enumArrayField[i] = decoder.uint32();\n }\n this.enumMapField = new Map();\n let enumMapFieldSize = decoder.map(Kind.Uint32, Kind.String);\n for (let i = 0; i < enumMapFieldSize; i++) {\n let key = decoder.uint32();\n let val = decoder.string();\n this.enumMapField.set(key, val);\n }\n this.enumMapFieldEmbedded = new Map();\n let enumMapFieldEmbeddedSize = decoder.map(Kind.Uint32, Kind.Any);\n for (let i = 0; i < enumMapFieldEmbeddedSize; i++) {\n let key = decoder.uint32();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.enumMapFieldEmbedded.set(key, val);\n }\n }\n this.bytesField = decoder.uint8Array();\n const bytesArrayFieldSize = decoder.array(Kind.Uint8Array);\n this.bytesArrayField = new Array(bytesArrayFieldSize);\n for (let i = 0; i < bytesArrayFieldSize; i += 1) {\n this.bytesArrayField[i] = decoder.uint8Array();\n }\n this.boolField = decoder.boolean();\n const boolArrayFieldSize = decoder.array(Kind.Boolean);\n this.boolArrayField = new Array(boolArrayFieldSize);\n for (let i = 0; i < boolArrayFieldSize; i += 1) {\n this.boolArrayField[i] = decoder.boolean();\n }\n } else {\n this.modelField = new EmptyModel();\n this.modelArrayField = [];\n this.stringField = \"DefaultValue\";\n this.stringArrayField = [];\n this.stringMapField = new Map();\n this.stringMapFieldEmbedded = new Map();\n this.int32Field = 32;\n this.int32ArrayField = [];\n this.int32MapField = new Map();\n this.int32MapFieldEmbedded = new Map();\n this.int64Field = 64n;\n this.int64ArrayField = [];\n this.int64MapField = new Map();\n this.int64MapFieldEmbedded = new Map();\n this.uint32Field = 32;\n this.uint32ArrayField = [];\n this.uint32MapField = new Map();\n this.uint32MapFieldEmbedded = new Map();\n this.uint64Field = 64n;\n this.uint64ArrayField = [];\n this.uint64MapField = new Map();\n this.uint64MapFieldEmbedded = new Map();\n this.float32Field = 32.32;\n this.float32ArrayField = [];\n this.float64Field = 64.64;\n this.float64ArrayField = [];\n this.enumField = GenericEnum.DefaultValue;\n this.enumArrayField = [];\n this.enumMapField = new Map();\n this.enumMapFieldEmbedded = new Map();\n this.bytesField = new Uint8Array(512);\n this.bytesArrayField = [];\n this.boolField = true;\n this.boolArrayField = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.modelField === \"undefined\") {\n encoder.null();\n } else {\n this.modelField.encode(encoder);\n }\n const modelArrayFieldLength = this.modelArrayField.length;\n encoder.array(modelArrayFieldLength, Kind.Any);\n for (let i = 0; i < modelArrayFieldLength; i += 1) {\n const el = this.modelArrayField[i];\n el.encode(encoder);\n }\n encoder.string(this.stringField);\n const stringArrayFieldLength = this.stringArrayField.length;\n encoder.array(stringArrayFieldLength, Kind.String);\n for (let i = 0; i < stringArrayFieldLength; i += 1) {\n encoder.string(this.stringArrayField[i]);\n }\n encoder.map(this.stringMapField.size, Kind.String, Kind.String);\n this.stringMapField.forEach((val, key) => {\n encoder.string(key);\n encoder.string(val);\n });\n encoder.map(this.stringMapFieldEmbedded.size, Kind.String, Kind.Any);\n this.stringMapFieldEmbedded.forEach((val, key) => {\n encoder.string(key);\n val.encode(encoder);\n });\n encoder.int32(this.int32Field);\n const int32ArrayFieldLength = this.int32ArrayField.length;\n encoder.array(int32ArrayFieldLength, Kind.Int32);\n for (let i = 0; i < int32ArrayFieldLength; i += 1) {\n encoder.int32(this.int32ArrayField[i]);\n }\n encoder.map(this.int32MapField.size, Kind.Int32, Kind.Int32);\n this.int32MapField.forEach((val, key) => {\n encoder.int32(key);\n encoder.int32(val);\n });\n encoder.map(this.int32MapFieldEmbedded.size, Kind.Int32, Kind.Any);\n this.int32MapFieldEmbedded.forEach((val, key) => {\n encoder.int32(key);\n val.encode(encoder);\n });\n encoder.int64(this.int64Field);\n const int64ArrayFieldLength = this.int64ArrayField.length;\n encoder.array(int64ArrayFieldLength, Kind.Int64);\n for (let i = 0; i < int64ArrayFieldLength; i += 1) {\n encoder.int64(this.int64ArrayField[i]);\n }\n encoder.map(this.int64MapField.size, Kind.Int64, Kind.Int64);\n this.int64MapField.forEach((val, key) => {\n encoder.int64(key);\n encoder.int64(val);\n });\n encoder.map(this.int64MapFieldEmbedded.size, Kind.Int64, Kind.Any);\n this.int64MapFieldEmbedded.forEach((val, key) => {\n encoder.int64(key);\n val.encode(encoder);\n });\n encoder.uint32(this.uint32Field);\n const uint32ArrayFieldLength = this.uint32ArrayField.length;\n encoder.array(uint32ArrayFieldLength, Kind.Uint32);\n for (let i = 0; i < uint32ArrayFieldLength; i += 1) {\n encoder.uint32(this.uint32ArrayField[i]);\n }\n encoder.map(this.uint32MapField.size, Kind.Uint32, Kind.Uint32);\n this.uint32MapField.forEach((val, key) => {\n encoder.uint32(key);\n encoder.uint32(val);\n });\n encoder.map(this.uint32MapFieldEmbedded.size, Kind.Uint32, Kind.Any);\n this.uint32MapFieldEmbedded.forEach((val, key) => {\n encoder.uint32(key);\n val.encode(encoder);\n });\n encoder.uint64(this.uint64Field);\n const uint64ArrayFieldLength = this.uint64ArrayField.length;\n encoder.array(uint64ArrayFieldLength, Kind.Uint64);\n for (let i = 0; i < uint64ArrayFieldLength; i += 1) {\n encoder.uint64(this.uint64ArrayField[i]);\n }\n encoder.map(this.uint64MapField.size, Kind.Uint64, Kind.Uint64);\n this.uint64MapField.forEach((val, key) => {\n encoder.uint64(key);\n encoder.uint64(val);\n });\n encoder.map(this.uint64MapFieldEmbedded.size, Kind.Uint64, Kind.Any);\n this.uint64MapFieldEmbedded.forEach((val, key) => {\n encoder.uint64(key);\n val.encode(encoder);\n });\n encoder.float32(this.float32Field);\n const float32ArrayFieldLength = this.float32ArrayField.length;\n encoder.array(float32ArrayFieldLength, Kind.Float32);\n for (let i = 0; i < float32ArrayFieldLength; i += 1) {\n encoder.float32(this.float32ArrayField[i]);\n }\n encoder.float64(this.float64Field);\n const float64ArrayFieldLength = this.float64ArrayField.length;\n encoder.array(float64ArrayFieldLength, Kind.Float64);\n for (let i = 0; i < float64ArrayFieldLength; i += 1) {\n encoder.float64(this.float64ArrayField[i]);\n }\n encoder.uint32(this.enumField);\n const enumArrayFieldLength = this.enumArrayField.length;\n encoder.array(enumArrayFieldLength, Kind.Uint32);\n for (let i = 0; i < enumArrayFieldLength; i += 1) {\n encoder.uint32(this.enumArrayField[i]);\n }\n encoder.map(this.enumMapField.size, Kind.Uint32, Kind.String);\n this.enumMapField.forEach((val, key) => {\n encoder.uint32(key);\n encoder.string(val);\n });\n encoder.map(this.enumMapFieldEmbedded.size, Kind.Uint32, Kind.Any);\n this.enumMapFieldEmbedded.forEach((val, key) => {\n encoder.uint32(key);\n val.encode(encoder);\n });\n encoder.uint8Array(this.bytesField);\n const bytesArrayFieldLength = this.bytesArrayField.length;\n encoder.array(bytesArrayFieldLength, Kind.Uint8Array);\n for (let i = 0; i < bytesArrayFieldLength; i += 1) {\n encoder.uint8Array(this.bytesArrayField[i]);\n }\n encoder.boolean(this.boolField);\n const boolArrayFieldLength = this.boolArrayField.length;\n encoder.array(boolArrayFieldLength, Kind.Boolean);\n for (let i = 0; i < boolArrayFieldLength; i += 1) {\n encoder.boolean(this.boolArrayField[i]);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithAllFieldTypes | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithAllFieldTypes(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n"], "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,sBAAuC;AAEhC,IAAK,cAAL,kBAAKA,iBAAL;AACL,EAAAA,0BAAA,gBAAa,KAAb;AAEA,EAAAA,0BAAA,iBAAc,KAAd;AAEA,EAAAA,0BAAA,kBAAe,KAAf;AALU,SAAAA;AAAA,GAAA;AAQL,MAAM,WAAW;AAAA;AAAA;AAAA;AAAA,EAItB,YAAa,SAAmB;AAC9B,QAAI,SAAS;AACX,UAAI;AACJ,UAAI;AACF,cAAM,QAAQ,MAAM;AAAA,MACtB,SAAS,GAAG;AAAA,MAAC;AACb,UAAI,OAAO,QAAQ,aAAa;AAC9B,cAAM;AAAA,MACR;AAAA,IACF,OAAO;AAAA,IACP;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,OAAQ,SAAkB;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,OAAQ,SAA0C;AACvD,QAAI,QAAQ,KAAK,GAAG;AAClB,aAAO;AAAA,IACT;AACA,WAAO,IAAI,WAAW,OAAO;AAAA,EAC/B;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,iBAAkB,SAAkB;AACzC,YAAQ,KAAK;AAAA,EACf;AACF;AAGO,MAAM,0BAA0B;AAAA;AAAA;AAAA;AAAA,EAIrC,YAAa,SAAmB;AAC9B,QAAI,SAAS;AACX,UAAI;AACJ,UAAI;AACF,cAAM,QAAQ,MAAM;AAAA,MACtB,SAAS,GAAG;AAAA,MAAC;AACb,UAAI,OAAO,QAAQ,a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,KAAK,gBAAgB;AACnD,YAAQ,MAAM,uBAAuB,qBAAK,UAAU;AACpD,aAAS,IAAI,GAAG,IAAI,uBAAuB,KAAK,GAAG;AACjD,cAAQ,WAAW,KAAK,gBAAgB,CAAC,CAAC;AAAA,IAC5C;AACA,YAAQ,QAAQ,KAAK,SAAS;AAC9B,UAAM,uBAAuB,KAAK,eAAe;AACjD,YAAQ,MAAM,sBAAsB,qBAAK,OAAO;AAChD,aAAS,IAAI,GAAG,IAAI,sBAAsB,KAAK,GAAG;AAChD,cAAQ,QAAQ,KAAK,eAAe,CAAC,CAAC;AAAA,IACxC;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,OAAQ,SAAsD;AACnE,QAAI,QAAQ,KAAK,GAAG;AAClB,aAAO;AAAA,IACT;AACA,WAAO,IAAI,uBAAuB,OAAO;AAAA,EAC3C;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,iBAAkB,SAAkB;AACzC,YAAQ,KAAK;AAAA,EACf;AACF;", "names": ["GenericEnum"] } diff --git a/integration/typescript_tests/host_signature/types.ts b/integration/typescript_tests/host_signature/types.ts index 66b8d862..7333d6a7 100644 --- a/integration/typescript_tests/host_signature/types.ts +++ b/integration/typescript_tests/host_signature/types.ts @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.4.2, DO NOT EDIT. +// Code generated by scale-signature 0.4.3, DO NOT EDIT. // output: local-example-latest-host import { Encoder, Decoder, Kind } from "@loopholelabs/polyglot" diff --git a/integration/typescript_tests/signature/index.d.ts b/integration/typescript_tests/signature/index.d.ts index c880d534..f6983f71 100644 --- a/integration/typescript_tests/signature/index.d.ts +++ b/integration/typescript_tests/signature/index.d.ts @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.4.2, DO NOT EDIT. +// Code generated by scale-signature 0.4.3, DO NOT EDIT. // output: local-example-latest-guest export * from "./types"; diff --git a/integration/typescript_tests/signature/index.js b/integration/typescript_tests/signature/index.js index 3e8382c9..a83c5bc7 100644 --- a/integration/typescript_tests/signature/index.js +++ b/integration/typescript_tests/signature/index.js @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.4.2, DO NOT EDIT. +// Code generated by scale-signature 0.4.3, DO NOT EDIT. // output: local-example-latest-guest "use strict"; diff --git a/integration/typescript_tests/signature/index.js.map b/integration/typescript_tests/signature/index.js.map index dd6303d7..efc28dc3 100644 --- a/integration/typescript_tests/signature/index.js.map +++ b/integration/typescript_tests/signature/index.js.map @@ -2,7 +2,7 @@ "version": 3, "sources": [""], "sourceRoot": "index.js", - "sourcesContent": ["// Code generated by scale-signature 0.4.2, DO NOT EDIT.\n// output: local-example-latest-guest\n\n/* eslint no-bitwise: off */\n\nimport { Signature as SignatureInterface, TYPESCRIPT_ADDRESS_OF, TYPESCRIPT_NEXT} from \"@loopholelabs/scale-signature-interfaces\";\nimport { Decoder, Encoder, Kind } from \"@loopholelabs/polyglot\";\n\n(global as any).WRITE_BUFFER = new Uint8Array().buffer;\n(global as any).READ_BUFFER = new Uint8Array().buffer;\n\nexport * from \"./types\";\nimport { ModelWithAllFieldTypes } from \"./types\";\n\nconst hash = \"3a592aa345d412faa2e6285ee048ca2ab5aa64b0caa2f9ca67b2c1e0792101e5\"\n\n// Write serializes the signature into the global WRITE_BUFFER and returns the pointer to the buffer and its size\n//\n// Users should not use this method.\nexport function Write(ctx?: ModelWithAllFieldTypes): number[] {\n const enc = new Encoder();\n if (typeof ctx === \"undefined\") {\n enc.null();\n } else {\n ctx.encode(enc);\n }\n const len = enc.bytes.buffer.byteLength;\n (global as any).WRITE_BUFFER = enc.bytes.buffer;\n const addrof = (global as any)[TYPESCRIPT_ADDRESS_OF];\n const ptr = addrof((global as any).WRITE_BUFFER);\n return [ptr, len];\n}\n\n// Read deserializes signature from the global READ_BUFFER\n//\n// Users should not use this method.\nexport function Read(): ModelWithAllFieldTypes | undefined {\n const dec = new Decoder(new Uint8Array((global as any).READ_BUFFER));\n return ModelWithAllFieldTypes.decode(dec);\n}\n\n// Error serializes an error into the global writeBuffer and returns a pointer to the buffer and its size\n//\n// Users should not use this method.\nexport function Error(err: Error): number[] {\n const enc = new Encoder();\n enc.error(err);\n const len = enc.bytes.buffer.byteLength;\n (global as any).WRITE_BUFFER = enc.bytes.buffer;\n const addrof = (global as any)[TYPESCRIPT_ADDRESS_OF];\n const ptr = addrof((global as any).WRITE_BUFFER);\n return [ptr, len];\n}\n\n// Resize resizes the global READ_BUFFER to the given size and returns the pointer to the buffer\n//\n// Users should not use this method.\nexport function Resize(size: number): number {\n (global as any).READ_BUFFER = new Uint8Array(size).buffer;\n const addrof = (global as any)[TYPESCRIPT_ADDRESS_OF];\n return addrof((global as any).READ_BUFFER);\n}\n\n// Hash returns the hash of the Scale Signature\n//\n// Users should not use this method.\nexport function Hash(): number[] {\n const enc = new Encoder();\n enc.string(hash);\n const len = enc.bytes.buffer.byteLength;\n (global as any).WRITE_BUFFER = enc.bytes.buffer;\n const addrof = (global as any)[TYPESCRIPT_ADDRESS_OF];\n const ptr = addrof((global as any).WRITE_BUFFER);\n return [ptr, len];\n}\n\n// Next calls the next function in the Scale Function Chain\nexport function Next(ctx?: ModelWithAllFieldTypes): ModelWithAllFieldTypes | undefined {\n const [ptr, len] = Write(ctx);\n const next = (global as any)[TYPESCRIPT_NEXT];\n next([ptr, len]);\n return Read();\n}\n"], + "sourcesContent": ["// Code generated by scale-signature 0.4.3, DO NOT EDIT.\n// output: local-example-latest-guest\n\n/* eslint no-bitwise: off */\n\nimport { Signature as SignatureInterface, TYPESCRIPT_ADDRESS_OF, TYPESCRIPT_NEXT} from \"@loopholelabs/scale-signature-interfaces\";\nimport { Decoder, Encoder, Kind } from \"@loopholelabs/polyglot\";\n\n(global as any).WRITE_BUFFER = new Uint8Array().buffer;\n(global as any).READ_BUFFER = new Uint8Array().buffer;\n\nexport * from \"./types\";\nimport { ModelWithAllFieldTypes } from \"./types\";\n\nconst hash = \"3a592aa345d412faa2e6285ee048ca2ab5aa64b0caa2f9ca67b2c1e0792101e5\"\n\n// Write serializes the signature into the global WRITE_BUFFER and returns the pointer to the buffer and its size\n//\n// Users should not use this method.\nexport function Write(ctx?: ModelWithAllFieldTypes): number[] {\n const enc = new Encoder();\n if (typeof ctx === \"undefined\") {\n enc.null();\n } else {\n ctx.encode(enc);\n }\n const len = enc.bytes.buffer.byteLength;\n (global as any).WRITE_BUFFER = enc.bytes.buffer;\n const addrof = (global as any)[TYPESCRIPT_ADDRESS_OF];\n const ptr = addrof((global as any).WRITE_BUFFER);\n return [ptr, len];\n}\n\n// Read deserializes signature from the global READ_BUFFER\n//\n// Users should not use this method.\nexport function Read(): ModelWithAllFieldTypes | undefined {\n const dec = new Decoder(new Uint8Array((global as any).READ_BUFFER));\n return ModelWithAllFieldTypes.decode(dec);\n}\n\n// Error serializes an error into the global writeBuffer and returns a pointer to the buffer and its size\n//\n// Users should not use this method.\nexport function Error(err: Error): number[] {\n const enc = new Encoder();\n enc.error(err);\n const len = enc.bytes.buffer.byteLength;\n (global as any).WRITE_BUFFER = enc.bytes.buffer;\n const addrof = (global as any)[TYPESCRIPT_ADDRESS_OF];\n const ptr = addrof((global as any).WRITE_BUFFER);\n return [ptr, len];\n}\n\n// Resize resizes the global READ_BUFFER to the given size and returns the pointer to the buffer\n//\n// Users should not use this method.\nexport function Resize(size: number): number {\n (global as any).READ_BUFFER = new Uint8Array(size).buffer;\n const addrof = (global as any)[TYPESCRIPT_ADDRESS_OF];\n return addrof((global as any).READ_BUFFER);\n}\n\n// Hash returns the hash of the Scale Signature\n//\n// Users should not use this method.\nexport function Hash(): number[] {\n const enc = new Encoder();\n enc.string(hash);\n const len = enc.bytes.buffer.byteLength;\n (global as any).WRITE_BUFFER = enc.bytes.buffer;\n const addrof = (global as any)[TYPESCRIPT_ADDRESS_OF];\n const ptr = addrof((global as any).WRITE_BUFFER);\n return [ptr, len];\n}\n\n// Next calls the next function in the Scale Function Chain\nexport function Next(ctx?: ModelWithAllFieldTypes): ModelWithAllFieldTypes | undefined {\n const [ptr, len] =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MAAM,IAAI,wBAAQ;AACxB,MAAI,OAAO,IAAI;AACf,QAAM,MAAM,IAAI,MAAM,OAAO;AAC7B,EAAC,OAAe,eAAe,IAAI,MAAM;AACzC,QAAM,SAAU,OAAe,uDAAqB;AACpD,QAAM,MAAM,OAAQ,OAAe,YAAY;AAC/C,SAAO,CAAC,KAAK,GAAG;AAClB;AAGO,SAAS,KAAK,KAAkE;AACrF,QAAM,CAAC,KAAK,GAAG,IAAI,MAAM,GAAG;AAC5B,QAAM,OAAQ,OAAe,iDAAe;AAC5C,OAAK,CAAC,KAAK,GAAG,CAAC;AACf,SAAO,KAAK;AACd;", "names": ["Error"] } diff --git a/integration/typescript_tests/signature/index.ts b/integration/typescript_tests/signature/index.ts index 8a981146..08af6339 100644 --- a/integration/typescript_tests/signature/index.ts +++ b/integration/typescript_tests/signature/index.ts @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.4.2, DO NOT EDIT. +// Code generated by scale-signature 0.4.3, DO NOT EDIT. // output: local-example-latest-guest /* eslint no-bitwise: off */ diff --git a/integration/typescript_tests/signature/types.d.ts b/integration/typescript_tests/signature/types.d.ts index 5d1686ff..bb971a1d 100644 --- a/integration/typescript_tests/signature/types.d.ts +++ b/integration/typescript_tests/signature/types.d.ts @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.4.2, DO NOT EDIT. +// Code generated by scale-signature 0.4.3, DO NOT EDIT. // output: local-example-latest-guest import { Encoder, Decoder, Kind } from "@loopholelabs/polyglot" diff --git a/integration/typescript_tests/signature/types.js b/integration/typescript_tests/signature/types.js index 689c6b7b..e3b2848f 100644 --- a/integration/typescript_tests/signature/types.js +++ b/integration/typescript_tests/signature/types.js @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.4.2, DO NOT EDIT. +// Code generated by scale-signature 0.4.3, DO NOT EDIT. // output: local-example-latest-guest "use strict"; diff --git a/integration/typescript_tests/signature/types.js.map b/integration/typescript_tests/signature/types.js.map index fe1169de..b1a08169 100644 --- a/integration/typescript_tests/signature/types.js.map +++ b/integration/typescript_tests/signature/types.js.map @@ -2,7 +2,7 @@ "version": 3, "sources": [""], "sourceRoot": "types.js", - "sourcesContent": ["// Code generated by scale-signature 0.4.2, DO NOT EDIT.\n// output: local-example-latest-guest\n\nimport { Encoder, Decoder, Kind } from \"@loopholelabs/polyglot\"\n\nexport enum GenericEnum {\n FirstValue = 0,\n\n SecondValue = 1,\n\n DefaultValue = 2,\n\n}\nexport class EmptyModel {\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n } else {\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): EmptyModel | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new EmptyModel(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// EmptyModelWithDescription: Test Description\nexport class EmptyModelWithDescription {\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n } else {\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): EmptyModelWithDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new EmptyModelWithDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithSingleStringField {\n stringField: string;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n } else {\n this.stringField = \"DefaultValue\";\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleStringField | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleStringField(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithSingleStringFieldAndDescription: Test Description\nexport class ModelWithSingleStringFieldAndDescription {\n stringField: string;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n } else {\n this.stringField = \"DefaultValue\";\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleStringFieldAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleStringFieldAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithSingleInt32Field {\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.int32Field = decoder.int32();\n } else {\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleInt32Field | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleInt32Field(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithSingleInt32FieldAndDescription: Test Description\nexport class ModelWithSingleInt32FieldAndDescription {\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.int32Field = decoder.int32();\n } else {\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleInt32FieldAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleInt32FieldAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithMultipleFields {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFields | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFields(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithMultipleFieldsAndDescription: Test Description\nexport class ModelWithMultipleFieldsAndDescription {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEnum {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnum | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnum(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEnumAndDescription: Test Description\nexport class ModelWithEnumAndDescription {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEnumAccessor {\n #enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.#enumField = decoder.uint32();\n } else {\n this.#enumField = GenericEnum.DefaultValue;\n }\n }\n\n get enumField(): GenericEnum {\n return this.#enumField;\n }\n\n set enumField(val: GenericEnum) {\n this.#enumField = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.#enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEnumAccessorAndDescription: Test Description\nexport class ModelWithEnumAccessorAndDescription {\n #enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.#enumField = decoder.uint32();\n } else {\n this.#enumField = GenericEnum.DefaultValue;\n }\n }\n\n get enumField(): GenericEnum {\n return this.#enumField;\n }\n\n set enumField(val: GenericEnum) {\n this.#enumField = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.#enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithMultipleFieldsAccessor {\n #stringField: string;\n\n #int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.#stringField = decoder.string();\n this.#int32Field = decoder.int32();\n } else {\n this.#stringField = \"DefaultValue\";\n this.#int32Field = 32;\n }\n }\n\n get stringField(): string {\n return this.#stringField;\n }\n\n set stringField(val: string) {\n if (!/^[a-zA-Z0-9]*$/.test(val)) {\n throw new Error(\"value must match ^[a-zA-Z0-9]*$\");\n }\n if (val.length > 20 || val.length < 1) {\n throw new Error(\"length must be between 1 and 20\");\n }\n val = val.toUpperCase();\n this.#stringField = val;\n }\n\n get int32Field(): number {\n return this.#int32Field;\n }\n\n set int32Field (val: number) {\n if (val > 100 || val < 0) {\n throw new Error(\"value must be between 0 and 100\");\n }\n this.#int32Field = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.#stringField);\n encoder.int32(this.#int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithMultipleFieldsAccessorAndDescription: Test Description\nexport class ModelWithMultipleFieldsAccessorAndDescription {\n #stringField: string;\n\n #int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.#stringField = decoder.string();\n this.#int32Field = decoder.int32();\n } else {\n this.#stringField = \"DefaultValue\";\n this.#int32Field = 32;\n }\n }\n\n get stringField(): string {\n return this.#stringField;\n }\n\n set stringField(val: string) {\n this.#stringField = val;\n }\n\n get int32Field(): number {\n return this.#int32Field;\n }\n\n set int32Field (val: number) {\n this.#int32Field = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.#stringField);\n encoder.int32(this.#int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEmbeddedModels {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModels | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModels(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEmbeddedModelsAndDescription: Test Description\nexport class ModelWithEmbeddedModelsAndDescription {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEmbeddedModelsAccessor {\n #embeddedEmptyModel: EmptyModel | undefined;\n\n #embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.#embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.#embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.#embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.#embeddedEmptyModel = new EmptyModel();\n this.#embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n get embeddedEmptyModel(): EmptyModel | undefined {\n return this.#embeddedEmptyModel;\n }\n\n set embeddedEmptyModel(val: EmptyModel | undefined) {\n this.#embeddedEmptyModel = val;\n }\n\n get embeddedModelArrayWithMultipleFieldsAccessor(): Array {\n return this.#embeddedModelArrayWithMultipleFieldsAccessor;\n }\n\n set EmbeddedModelArrayWithMultipleFieldsAccessor(val: Array) {\n this.#embeddedModelArrayWithMultipleFieldsAccessor = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.#embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.#embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.#embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.#embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEmbeddedModelsAccessorAndDescription: Test Description\nexport class ModelWithEmbeddedModelsAccessorAndDescription {\n #embeddedEmptyModel: EmptyModel | undefined;\n\n #embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.#embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.#embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.#embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.#embeddedEmptyModel = new EmptyModel();\n this.#embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n get embeddedEmptyModel(): EmptyModel | undefined {\n return this.#embeddedEmptyModel;\n }\n\n set embeddedEmptyModel(val: EmptyModel | undefined) {\n this.#embeddedEmptyModel = val;\n }\n\n get embeddedModelArrayWithMultipleFieldsAccessor(): Array {\n return this.#embeddedModelArrayWithMultipleFieldsAccessor;\n }\n\n set EmbeddedModelArrayWithMultipleFieldsAccessor(val: Array) {\n this.#embeddedModelArrayWithMultipleFieldsAccessor = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.#embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.#embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.#embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.#embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithAllFieldTypes {\n modelField: EmptyModel | undefined;\n\n modelArrayField: Array;\n\n stringField: string;\n\n stringArrayField: string[];\n\n stringMapField: Map;\n\n stringMapFieldEmbedded: Map;\n\n int32Field: number;\n\n int32ArrayField: number[];\n\n int32MapField: Map;\n\n int32MapFieldEmbedded: Map;\n\n int64Field: bigint;\n\n int64ArrayField: bigint[];\n\n int64MapField: Map;\n\n int64MapFieldEmbedded: Map;\n\n uint32Field: number;\n\n uint32ArrayField: number[];\n\n uint32MapField: Map;\n\n uint32MapFieldEmbedded: Map;\n\n uint64Field: bigint;\n\n uint64ArrayField: bigint[];\n\n uint64MapField: Map;\n\n uint64MapFieldEmbedded: Map;\n\n float32Field: number;\n\n float32ArrayField: number[];\n\n float64Field: number;\n\n float64ArrayField: number[];\n\n enumField: GenericEnum;\n\n enumArrayField: GenericEnum[];\n\n enumMapField: Map;\n\n enumMapFieldEmbedded: Map;\n\n bytesField: Uint8Array;\n\n bytesArrayField: Uint8Array[];\n\n boolField: boolean;\n\n boolArrayField: boolean[];\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.modelField = EmptyModel.decode(decoder);\n const modelArrayFieldSize = decoder.array(Kind.Any);\n this.modelArrayField = new Array(modelArrayFieldSize);\n for (let i = 0; i < modelArrayFieldSize; i += 1) {\n const x = EmptyModel.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.modelArrayField[i] = x;\n }\n }\n this.stringField = decoder.string();\n const stringArrayFieldSize = decoder.array(Kind.String);\n this.stringArrayField = new Array(stringArrayFieldSize);\n for (let i = 0; i < stringArrayFieldSize; i += 1) {\n this.stringArrayField[i] = decoder.string();\n }\n this.stringMapField = new Map();\n let stringMapFieldSize = decoder.map(Kind.String, Kind.String);\n for (let i = 0; i < stringMapFieldSize; i++) {\n let key = decoder.string();\n let val = decoder.string();\n this.stringMapField.set(key, val);\n }\n this.stringMapFieldEmbedded = new Map();\n let stringMapFieldEmbeddedSize = decoder.map(Kind.String, Kind.Any);\n for (let i = 0; i < stringMapFieldEmbeddedSize; i++) {\n let key = decoder.string();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.stringMapFieldEmbedded.set(key, val);\n }\n }\n this.int32Field = decoder.int32();\n const int32ArrayFieldSize = decoder.array(Kind.Int32);\n this.int32ArrayField = new Array(int32ArrayFieldSize);\n for (let i = 0; i < int32ArrayFieldSize; i += 1) {\n this.int32ArrayField[i] = decoder.int32();\n }\n this.int32MapField = new Map();\n let int32MapFieldSize = decoder.map(Kind.Int32, Kind.Int32);\n for (let i = 0; i < int32MapFieldSize; i++) {\n let key = decoder.int32();\n let val = decoder.int32();\n this.int32MapField.set(key, val);\n }\n this.int32MapFieldEmbedded = new Map();\n let int32MapFieldEmbeddedSize = decoder.map(Kind.Int32, Kind.Any);\n for (let i = 0; i < int32MapFieldEmbeddedSize; i++) {\n let key = decoder.int32();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.int32MapFieldEmbedded.set(key, val);\n }\n }\n this.int64Field = decoder.int64();\n const int64ArrayFieldSize = decoder.array(Kind.Int64);\n this.int64ArrayField = new Array(int64ArrayFieldSize);\n for (let i = 0; i < int64ArrayFieldSize; i += 1) {\n this.int64ArrayField[i] = decoder.int64();\n }\n this.int64MapField = new Map();\n let int64MapFieldSize = decoder.map(Kind.Int64, Kind.Int64);\n for (let i = 0; i < int64MapFieldSize; i++) {\n let key = decoder.int64();\n let val = decoder.int64();\n this.int64MapField.set(key, val);\n }\n this.int64MapFieldEmbedded = new Map();\n let int64MapFieldEmbeddedSize = decoder.map(Kind.Int64, Kind.Any);\n for (let i = 0; i < int64MapFieldEmbeddedSize; i++) {\n let key = decoder.int64();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.int64MapFieldEmbedded.set(key, val);\n }\n }\n this.uint32Field = decoder.uint32();\n const uint32ArrayFieldSize = decoder.array(Kind.Uint32);\n this.uint32ArrayField = new Array(uint32ArrayFieldSize);\n for (let i = 0; i < uint32ArrayFieldSize; i += 1) {\n this.uint32ArrayField[i] = decoder.uint32();\n }\n this.uint32MapField = new Map();\n let uint32MapFieldSize = decoder.map(Kind.Uint32, Kind.Uint32);\n for (let i = 0; i < uint32MapFieldSize; i++) {\n let key = decoder.uint32();\n let val = decoder.uint32();\n this.uint32MapField.set(key, val);\n }\n this.uint32MapFieldEmbedded = new Map();\n let uint32MapFieldEmbeddedSize = decoder.map(Kind.Uint32, Kind.Any);\n for (let i = 0; i < uint32MapFieldEmbeddedSize; i++) {\n let key = decoder.uint32();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.uint32MapFieldEmbedded.set(key, val);\n }\n }\n this.uint64Field = decoder.uint64();\n const uint64ArrayFieldSize = decoder.array(Kind.Uint64);\n this.uint64ArrayField = new Array(uint64ArrayFieldSize);\n for (let i = 0; i < uint64ArrayFieldSize; i += 1) {\n this.uint64ArrayField[i] = decoder.uint64();\n }\n this.uint64MapField = new Map();\n let uint64MapFieldSize = decoder.map(Kind.Uint64, Kind.Uint64);\n for (let i = 0; i < uint64MapFieldSize; i++) {\n let key = decoder.uint64();\n let val = decoder.uint64();\n this.uint64MapField.set(key, val);\n }\n this.uint64MapFieldEmbedded = new Map();\n let uint64MapFieldEmbeddedSize = decoder.map(Kind.Uint64, Kind.Any);\n for (let i = 0; i < uint64MapFieldEmbeddedSize; i++) {\n let key = decoder.uint64();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.uint64MapFieldEmbedded.set(key, val);\n }\n }\n this.float32Field = decoder.float32();\n const float32ArrayFieldSize = decoder.array(Kind.Float32);\n this.float32ArrayField = new Array(float32ArrayFieldSize);\n for (let i = 0; i < float32ArrayFieldSize; i += 1) {\n this.float32ArrayField[i] = decoder.float32();\n }\n this.float64Field = decoder.float64();\n const float64ArrayFieldSize = decoder.array(Kind.Float64);\n this.float64ArrayField = new Array(float64ArrayFieldSize);\n for (let i = 0; i < float64ArrayFieldSize; i += 1) {\n this.float64ArrayField[i] = decoder.float64();\n }\n this.enumField = decoder.uint32();\n const enumArrayFieldSize = decoder.array(Kind.Uint32);\n this.enumArrayField = new Array(enumArrayFieldSize);\n for (let i = 0; i < enumArrayFieldSize; i += 1) {\n this.enumArrayField[i] = decoder.uint32();\n }\n this.enumMapField = new Map();\n let enumMapFieldSize = decoder.map(Kind.Uint32, Kind.String);\n for (let i = 0; i < enumMapFieldSize; i++) {\n let key = decoder.uint32();\n let val = decoder.string();\n this.enumMapField.set(key, val);\n }\n this.enumMapFieldEmbedded = new Map();\n let enumMapFieldEmbeddedSize = decoder.map(Kind.Uint32, Kind.Any);\n for (let i = 0; i < enumMapFieldEmbeddedSize; i++) {\n let key = decoder.uint32();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.enumMapFieldEmbedded.set(key, val);\n }\n }\n this.bytesField = decoder.uint8Array();\n const bytesArrayFieldSize = decoder.array(Kind.Uint8Array);\n this.bytesArrayField = new Array(bytesArrayFieldSize);\n for (let i = 0; i < bytesArrayFieldSize; i += 1) {\n this.bytesArrayField[i] = decoder.uint8Array();\n }\n this.boolField = decoder.boolean();\n const boolArrayFieldSize = decoder.array(Kind.Boolean);\n this.boolArrayField = new Array(boolArrayFieldSize);\n for (let i = 0; i < boolArrayFieldSize; i += 1) {\n this.boolArrayField[i] = decoder.boolean();\n }\n } else {\n this.modelField = new EmptyModel();\n this.modelArrayField = [];\n this.stringField = \"DefaultValue\";\n this.stringArrayField = [];\n this.stringMapField = new Map();\n this.stringMapFieldEmbedded = new Map();\n this.int32Field = 32;\n this.int32ArrayField = [];\n this.int32MapField = new Map();\n this.int32MapFieldEmbedded = new Map();\n this.int64Field = 64n;\n this.int64ArrayField = [];\n this.int64MapField = new Map();\n this.int64MapFieldEmbedded = new Map();\n this.uint32Field = 32;\n this.uint32ArrayField = [];\n this.uint32MapField = new Map();\n this.uint32MapFieldEmbedded = new Map();\n this.uint64Field = 64n;\n this.uint64ArrayField = [];\n this.uint64MapField = new Map();\n this.uint64MapFieldEmbedded = new Map();\n this.float32Field = 32.32;\n this.float32ArrayField = [];\n this.float64Field = 64.64;\n this.float64ArrayField = [];\n this.enumField = GenericEnum.DefaultValue;\n this.enumArrayField = [];\n this.enumMapField = new Map();\n this.enumMapFieldEmbedded = new Map();\n this.bytesField = new Uint8Array(512);\n this.bytesArrayField = [];\n this.boolField = true;\n this.boolArrayField = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.modelField === \"undefined\") {\n encoder.null();\n } else {\n this.modelField.encode(encoder);\n }\n const modelArrayFieldLength = this.modelArrayField.length;\n encoder.array(modelArrayFieldLength, Kind.Any);\n for (let i = 0; i < modelArrayFieldLength; i += 1) {\n const el = this.modelArrayField[i];\n el.encode(encoder);\n }\n encoder.string(this.stringField);\n const stringArrayFieldLength = this.stringArrayField.length;\n encoder.array(stringArrayFieldLength, Kind.String);\n for (let i = 0; i < stringArrayFieldLength; i += 1) {\n encoder.string(this.stringArrayField[i]);\n }\n encoder.map(this.stringMapField.size, Kind.String, Kind.String);\n this.stringMapField.forEach((val, key) => {\n encoder.string(key);\n encoder.string(val);\n });\n encoder.map(this.stringMapFieldEmbedded.size, Kind.String, Kind.Any);\n this.stringMapFieldEmbedded.forEach((val, key) => {\n encoder.string(key);\n val.encode(encoder);\n });\n encoder.int32(this.int32Field);\n const int32ArrayFieldLength = this.int32ArrayField.length;\n encoder.array(int32ArrayFieldLength, Kind.Int32);\n for (let i = 0; i < int32ArrayFieldLength; i += 1) {\n encoder.int32(this.int32ArrayField[i]);\n }\n encoder.map(this.int32MapField.size, Kind.Int32, Kind.Int32);\n this.int32MapField.forEach((val, key) => {\n encoder.int32(key);\n encoder.int32(val);\n });\n encoder.map(this.int32MapFieldEmbedded.size, Kind.Int32, Kind.Any);\n this.int32MapFieldEmbedded.forEach((val, key) => {\n encoder.int32(key);\n val.encode(encoder);\n });\n encoder.int64(this.int64Field);\n const int64ArrayFieldLength = this.int64ArrayField.length;\n encoder.array(int64ArrayFieldLength, Kind.Int64);\n for (let i = 0; i < int64ArrayFieldLength; i += 1) {\n encoder.int64(this.int64ArrayField[i]);\n }\n encoder.map(this.int64MapField.size, Kind.Int64, Kind.Int64);\n this.int64MapField.forEach((val, key) => {\n encoder.int64(key);\n encoder.int64(val);\n });\n encoder.map(this.int64MapFieldEmbedded.size, Kind.Int64, Kind.Any);\n this.int64MapFieldEmbedded.forEach((val, key) => {\n encoder.int64(key);\n val.encode(encoder);\n });\n encoder.uint32(this.uint32Field);\n const uint32ArrayFieldLength = this.uint32ArrayField.length;\n encoder.array(uint32ArrayFieldLength, Kind.Uint32);\n for (let i = 0; i < uint32ArrayFieldLength; i += 1) {\n encoder.uint32(this.uint32ArrayField[i]);\n }\n encoder.map(this.uint32MapField.size, Kind.Uint32, Kind.Uint32);\n this.uint32MapField.forEach((val, key) => {\n encoder.uint32(key);\n encoder.uint32(val);\n });\n encoder.map(this.uint32MapFieldEmbedded.size, Kind.Uint32, Kind.Any);\n this.uint32MapFieldEmbedded.forEach((val, key) => {\n encoder.uint32(key);\n val.encode(encoder);\n });\n encoder.uint64(this.uint64Field);\n const uint64ArrayFieldLength = this.uint64ArrayField.length;\n encoder.array(uint64ArrayFieldLength, Kind.Uint64);\n for (let i = 0; i < uint64ArrayFieldLength; i += 1) {\n encoder.uint64(this.uint64ArrayField[i]);\n }\n encoder.map(this.uint64MapField.size, Kind.Uint64, Kind.Uint64);\n this.uint64MapField.forEach((val, key) => {\n encoder.uint64(key);\n encoder.uint64(val);\n });\n encoder.map(this.uint64MapFieldEmbedded.size, Kind.Uint64, Kind.Any);\n this.uint64MapFieldEmbedded.forEach((val, key) => {\n encoder.uint64(key);\n val.encode(encoder);\n });\n encoder.float32(this.float32Field);\n const float32ArrayFieldLength = this.float32ArrayField.length;\n encoder.array(float32ArrayFieldLength, Kind.Float32);\n for (let i = 0; i < float32ArrayFieldLength; i += 1) {\n encoder.float32(this.float32ArrayField[i]);\n }\n encoder.float64(this.float64Field);\n const float64ArrayFieldLength = this.float64ArrayField.length;\n encoder.array(float64ArrayFieldLength, Kind.Float64);\n for (let i = 0; i < float64ArrayFieldLength; i += 1) {\n encoder.float64(this.float64ArrayField[i]);\n }\n encoder.uint32(this.enumField);\n const enumArrayFieldLength = this.enumArrayField.length;\n encoder.array(enumArrayFieldLength, Kind.Uint32);\n for (let i = 0; i < enumArrayFieldLength; i += 1) {\n encoder.uint32(this.enumArrayField[i]);\n }\n encoder.map(this.enumMapField.size, Kind.Uint32, Kind.String);\n this.enumMapField.forEach((val, key) => {\n encoder.uint32(key);\n encoder.string(val);\n });\n encoder.map(this.enumMapFieldEmbedded.size, Kind.Uint32, Kind.Any);\n this.enumMapFieldEmbedded.forEach((val, key) => {\n encoder.uint32(key);\n val.encode(encoder);\n });\n encoder.uint8Array(this.bytesField);\n const bytesArrayFieldLength = this.bytesArrayField.length;\n encoder.array(bytesArrayFieldLength, Kind.Uint8Array);\n for (let i = 0; i < bytesArrayFieldLength; i += 1) {\n encoder.uint8Array(this.bytesArrayField[i]);\n }\n encoder.boolean(this.boolField);\n const boolArrayFieldLength = this.boolArrayField.length;\n encoder.array(boolArrayFieldLength, Kind.Boolean);\n for (let i = 0; i < boolArrayFieldLength; i += 1) {\n encoder.boolean(this.boolArrayField[i]);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithAllFieldTypes | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithAllFieldTypes(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n"], + "sourcesContent": ["// Code generated by scale-signature 0.4.3, DO NOT EDIT.\n// output: local-example-latest-guest\n\nimport { Encoder, Decoder, Kind } from \"@loopholelabs/polyglot\"\n\nexport enum GenericEnum {\n FirstValue = 0,\n\n SecondValue = 1,\n\n DefaultValue = 2,\n\n}\nexport class EmptyModel {\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n } else {\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): EmptyModel | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new EmptyModel(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// EmptyModelWithDescription: Test Description\nexport class EmptyModelWithDescription {\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n } else {\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): EmptyModelWithDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new EmptyModelWithDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithSingleStringField {\n stringField: string;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n } else {\n this.stringField = \"DefaultValue\";\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleStringField | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleStringField(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithSingleStringFieldAndDescription: Test Description\nexport class ModelWithSingleStringFieldAndDescription {\n stringField: string;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n } else {\n this.stringField = \"DefaultValue\";\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleStringFieldAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleStringFieldAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithSingleInt32Field {\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.int32Field = decoder.int32();\n } else {\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleInt32Field | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleInt32Field(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithSingleInt32FieldAndDescription: Test Description\nexport class ModelWithSingleInt32FieldAndDescription {\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.int32Field = decoder.int32();\n } else {\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleInt32FieldAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleInt32FieldAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithMultipleFields {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFields | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFields(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithMultipleFieldsAndDescription: Test Description\nexport class ModelWithMultipleFieldsAndDescription {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEnum {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnum | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnum(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEnumAndDescription: Test Description\nexport class ModelWithEnumAndDescription {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEnumAccessor {\n #enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.#enumField = decoder.uint32();\n } else {\n this.#enumField = GenericEnum.DefaultValue;\n }\n }\n\n get enumField(): GenericEnum {\n return this.#enumField;\n }\n\n set enumField(val: GenericEnum) {\n this.#enumField = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.#enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEnumAccessorAndDescription: Test Description\nexport class ModelWithEnumAccessorAndDescription {\n #enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.#enumField = decoder.uint32();\n } else {\n this.#enumField = GenericEnum.DefaultValue;\n }\n }\n\n get enumField(): GenericEnum {\n return this.#enumField;\n }\n\n set enumField(val: GenericEnum) {\n this.#enumField = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.#enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithMultipleFieldsAccessor {\n #stringField: string;\n\n #int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.#stringField = decoder.string();\n this.#int32Field = decoder.int32();\n } else {\n this.#stringField = \"DefaultValue\";\n this.#int32Field = 32;\n }\n }\n\n get stringField(): string {\n return this.#stringField;\n }\n\n set stringField(val: string) {\n if (!/^[a-zA-Z0-9]*$/.test(val)) {\n throw new Error(\"value must match ^[a-zA-Z0-9]*$\");\n }\n if (val.length > 20 || val.length < 1) {\n throw new Error(\"length must be between 1 and 20\");\n }\n val = val.toUpperCase();\n this.#stringField = val;\n }\n\n get int32Field(): number {\n return this.#int32Field;\n }\n\n set int32Field (val: number) {\n if (val > 100 || val < 0) {\n throw new Error(\"value must be between 0 and 100\");\n }\n this.#int32Field = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.#stringField);\n encoder.int32(this.#int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithMultipleFieldsAccessorAndDescription: Test Description\nexport class ModelWithMultipleFieldsAccessorAndDescription {\n #stringField: string;\n\n #int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.#stringField = decoder.string();\n this.#int32Field = decoder.int32();\n } else {\n this.#stringField = \"DefaultValue\";\n this.#int32Field = 32;\n }\n }\n\n get stringField(): string {\n return this.#stringField;\n }\n\n set stringField(val: string) {\n this.#stringField = val;\n }\n\n get int32Field(): number {\n return this.#int32Field;\n }\n\n set int32Field (val: number) {\n this.#int32Field = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.#stringField);\n encoder.int32(this.#int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEmbeddedModels {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModels | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModels(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEmbeddedModelsAndDescription: Test Description\nexport class ModelWithEmbeddedModelsAndDescription {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEmbeddedModelsAccessor {\n #embeddedEmptyModel: EmptyModel | undefined;\n\n #embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.#embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.#embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.#embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.#embeddedEmptyModel = new EmptyModel();\n this.#embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n get embeddedEmptyModel(): EmptyModel | undefined {\n return this.#embeddedEmptyModel;\n }\n\n set embeddedEmptyModel(val: EmptyModel | undefined) {\n this.#embeddedEmptyModel = val;\n }\n\n get embeddedModelArrayWithMultipleFieldsAccessor(): Array {\n return this.#embeddedModelArrayWithMultipleFieldsAccessor;\n }\n\n set EmbeddedModelArrayWithMultipleFieldsAccessor(val: Array) {\n this.#embeddedModelArrayWithMultipleFieldsAccessor = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.#embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.#embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.#embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.#embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEmbeddedModelsAccessorAndDescription: Test Description\nexport class ModelWithEmbeddedModelsAccessorAndDescription {\n #embeddedEmptyModel: EmptyModel | undefined;\n\n #embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.#embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.#embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.#embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.#embeddedEmptyModel = new EmptyModel();\n this.#embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n get embeddedEmptyModel(): EmptyModel | undefined {\n return this.#embeddedEmptyModel;\n }\n\n set embeddedEmptyModel(val: EmptyModel | undefined) {\n this.#embeddedEmptyModel = val;\n }\n\n get embeddedModelArrayWithMultipleFieldsAccessor(): Array {\n return this.#embeddedModelArrayWithMultipleFieldsAccessor;\n }\n\n set EmbeddedModelArrayWithMultipleFieldsAccessor(val: Array) {\n this.#embeddedModelArrayWithMultipleFieldsAccessor = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.#embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.#embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.#embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.#embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithAllFieldTypes {\n modelField: EmptyModel | undefined;\n\n modelArrayField: Array;\n\n stringField: string;\n\n stringArrayField: string[];\n\n stringMapField: Map;\n\n stringMapFieldEmbedded: Map;\n\n int32Field: number;\n\n int32ArrayField: number[];\n\n int32MapField: Map;\n\n int32MapFieldEmbedded: Map;\n\n int64Field: bigint;\n\n int64ArrayField: bigint[];\n\n int64MapField: Map;\n\n int64MapFieldEmbedded: Map;\n\n uint32Field: number;\n\n uint32ArrayField: number[];\n\n uint32MapField: Map;\n\n uint32MapFieldEmbedded: Map;\n\n uint64Field: bigint;\n\n uint64ArrayField: bigint[];\n\n uint64MapField: Map;\n\n uint64MapFieldEmbedded: Map;\n\n float32Field: number;\n\n float32ArrayField: number[];\n\n float64Field: number;\n\n float64ArrayField: number[];\n\n enumField: GenericEnum;\n\n enumArrayField: GenericEnum[];\n\n enumMapField: Map;\n\n enumMapFieldEmbedded: Map;\n\n bytesField: Uint8Array;\n\n bytesArrayField: Uint8Array[];\n\n boolField: boolean;\n\n boolArrayField: boolean[];\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.modelField = EmptyModel.decode(decoder);\n const modelArrayFieldSize = decoder.array(Kind.Any);\n this.modelArrayField = new Array(modelArrayFieldSize);\n for (let i = 0; i < modelArrayFieldSize; i += 1) {\n const x = EmptyModel.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.modelArrayField[i] = x;\n }\n }\n this.stringField = decoder.string();\n const stringArrayFieldSize = decoder.array(Kind.String);\n this.stringArrayField = new Array(stringArrayFieldSize);\n for (let i = 0; i < stringArrayFieldSize; i += 1) {\n this.stringArrayField[i] = decoder.string();\n }\n this.stringMapField = new Map();\n let stringMapFieldSize = decoder.map(Kind.String, Kind.String);\n for (let i = 0; i < stringMapFieldSize; i++) {\n let key = decoder.string();\n let val = decoder.string();\n this.stringMapField.set(key, val);\n }\n this.stringMapFieldEmbedded = new Map();\n let stringMapFieldEmbeddedSize = decoder.map(Kind.String, Kind.Any);\n for (let i = 0; i < stringMapFieldEmbeddedSize; i++) {\n let key = decoder.string();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.stringMapFieldEmbedded.set(key, val);\n }\n }\n this.int32Field = decoder.int32();\n const int32ArrayFieldSize = decoder.array(Kind.Int32);\n this.int32ArrayField = new Array(int32ArrayFieldSize);\n for (let i = 0; i < int32ArrayFieldSize; i += 1) {\n this.int32ArrayField[i] = decoder.int32();\n }\n this.int32MapField = new Map();\n let int32MapFieldSize = decoder.map(Kind.Int32, Kind.Int32);\n for (let i = 0; i < int32MapFieldSize; i++) {\n let key = decoder.int32();\n let val = decoder.int32();\n this.int32MapField.set(key, val);\n }\n this.int32MapFieldEmbedded = new Map();\n let int32MapFieldEmbeddedSize = decoder.map(Kind.Int32, Kind.Any);\n for (let i = 0; i < int32MapFieldEmbeddedSize; i++) {\n let key = decoder.int32();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.int32MapFieldEmbedded.set(key, val);\n }\n }\n this.int64Field = decoder.int64();\n const int64ArrayFieldSize = decoder.array(Kind.Int64);\n this.int64ArrayField = new Array(int64ArrayFieldSize);\n for (let i = 0; i < int64ArrayFieldSize; i += 1) {\n this.int64ArrayField[i] = decoder.int64();\n }\n this.int64MapField = new Map();\n let int64MapFieldSize = decoder.map(Kind.Int64, Kind.Int64);\n for (let i = 0; i < int64MapFieldSize; i++) {\n let key = decoder.int64();\n let val = decoder.int64();\n this.int64MapField.set(key, val);\n }\n this.int64MapFieldEmbedded = new Map();\n let int64MapFieldEmbeddedSize = decoder.map(Kind.Int64, Kind.Any);\n for (let i = 0; i < int64MapFieldEmbeddedSize; i++) {\n let key = decoder.int64();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.int64MapFieldEmbedded.set(key, val);\n }\n }\n this.uint32Field = decoder.uint32();\n const uint32ArrayFieldSize = decoder.array(Kind.Uint32);\n this.uint32ArrayField = new Array(uint32ArrayFieldSize);\n for (let i = 0; i < uint32ArrayFieldSize; i += 1) {\n this.uint32ArrayField[i] = decoder.uint32();\n }\n this.uint32MapField = new Map();\n let uint32MapFieldSize = decoder.map(Kind.Uint32, Kind.Uint32);\n for (let i = 0; i < uint32MapFieldSize; i++) {\n let key = decoder.uint32();\n let val = decoder.uint32();\n this.uint32MapField.set(key, val);\n }\n this.uint32MapFieldEmbedded = new Map();\n let uint32MapFieldEmbeddedSize = decoder.map(Kind.Uint32, Kind.Any);\n for (let i = 0; i < uint32MapFieldEmbeddedSize; i++) {\n let key = decoder.uint32();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.uint32MapFieldEmbedded.set(key, val);\n }\n }\n this.uint64Field = decoder.uint64();\n const uint64ArrayFieldSize = decoder.array(Kind.Uint64);\n this.uint64ArrayField = new Array(uint64ArrayFieldSize);\n for (let i = 0; i < uint64ArrayFieldSize; i += 1) {\n this.uint64ArrayField[i] = decoder.uint64();\n }\n this.uint64MapField = new Map();\n let uint64MapFieldSize = decoder.map(Kind.Uint64, Kind.Uint64);\n for (let i = 0; i < uint64MapFieldSize; i++) {\n let key = decoder.uint64();\n let val = decoder.uint64();\n this.uint64MapField.set(key, val);\n }\n this.uint64MapFieldEmbedded = new Map();\n let uint64MapFieldEmbeddedSize = decoder.map(Kind.Uint64, Kind.Any);\n for (let i = 0; i < uint64MapFieldEmbeddedSize; i++) {\n let key = decoder.uint64();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.uint64MapFieldEmbedded.set(key, val);\n }\n }\n this.float32Field = decoder.float32();\n const float32ArrayFieldSize = decoder.array(Kind.Float32);\n this.float32ArrayField = new Array(float32ArrayFieldSize);\n for (let i = 0; i < float32ArrayFieldSize; i += 1) {\n this.float32ArrayField[i] = decoder.float32();\n }\n this.float64Field = decoder.float64();\n const float64ArrayFieldSize = decoder.array(Kind.Float64);\n this.float64ArrayField = new Array(float64ArrayFieldSize);\n for (let i = 0; i < float64ArrayFieldSize; i += 1) {\n this.float64ArrayField[i] = decoder.float64();\n }\n this.enumField = decoder.uint32();\n const enumArrayFieldSize = decoder.array(Kind.Uint32);\n this.enumArrayField = new Array(enumArrayFieldSize);\n for (let i = 0; i < enumArrayFieldSize; i += 1) {\n this.enumArrayField[i] = decoder.uint32();\n }\n this.enumMapField = new Map();\n let enumMapFieldSize = decoder.map(Kind.Uint32, Kind.String);\n for (let i = 0; i < enumMapFieldSize; i++) {\n let key = decoder.uint32();\n let val = decoder.string();\n this.enumMapField.set(key, val);\n }\n this.enumMapFieldEmbedded = new Map();\n let enumMapFieldEmbeddedSize = decoder.map(Kind.Uint32, Kind.Any);\n for (let i = 0; i < enumMapFieldEmbeddedSize; i++) {\n let key = decoder.uint32();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.enumMapFieldEmbedded.set(key, val);\n }\n }\n this.bytesField = decoder.uint8Array();\n const bytesArrayFieldSize = decoder.array(Kind.Uint8Array);\n this.bytesArrayField = new Array(bytesArrayFieldSize);\n for (let i = 0; i < bytesArrayFieldSize; i += 1) {\n this.bytesArrayField[i] = decoder.uint8Array();\n }\n this.boolField = decoder.boolean();\n const boolArrayFieldSize = decoder.array(Kind.Boolean);\n this.boolArrayField = new Array(boolArrayFieldSize);\n for (let i = 0; i < boolArrayFieldSize; i += 1) {\n this.boolArrayField[i] = decoder.boolean();\n }\n } else {\n this.modelField = new EmptyModel();\n this.modelArrayField = [];\n this.stringField = \"DefaultValue\";\n this.stringArrayField = [];\n this.stringMapField = new Map();\n this.stringMapFieldEmbedded = new Map();\n this.int32Field = 32;\n this.int32ArrayField = [];\n this.int32MapField = new Map();\n this.int32MapFieldEmbedded = new Map();\n this.int64Field = 64n;\n this.int64ArrayField = [];\n this.int64MapField = new Map();\n this.int64MapFieldEmbedded = new Map();\n this.uint32Field = 32;\n this.uint32ArrayField = [];\n this.uint32MapField = new Map();\n this.uint32MapFieldEmbedded = new Map();\n this.uint64Field = 64n;\n this.uint64ArrayField = [];\n this.uint64MapField = new Map();\n this.uint64MapFieldEmbedded = new Map();\n this.float32Field = 32.32;\n this.float32ArrayField = [];\n this.float64Field = 64.64;\n this.float64ArrayField = [];\n this.enumField = GenericEnum.DefaultValue;\n this.enumArrayField = [];\n this.enumMapField = new Map();\n this.enumMapFieldEmbedded = new Map();\n this.bytesField = new Uint8Array(512);\n this.bytesArrayField = [];\n this.boolField = true;\n this.boolArrayField = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.modelField === \"undefined\") {\n encoder.null();\n } else {\n this.modelField.encode(encoder);\n }\n const modelArrayFieldLength = this.modelArrayField.length;\n encoder.array(modelArrayFieldLength, Kind.Any);\n for (let i = 0; i < modelArrayFieldLength; i += 1) {\n const el = this.modelArrayField[i];\n el.encode(encoder);\n }\n encoder.string(this.stringField);\n const stringArrayFieldLength = this.stringArrayField.length;\n encoder.array(stringArrayFieldLength, Kind.String);\n for (let i = 0; i < stringArrayFieldLength; i += 1) {\n encoder.string(this.stringArrayField[i]);\n }\n encoder.map(this.stringMapField.size, Kind.String, Kind.String);\n this.stringMapField.forEach((val, key) => {\n encoder.string(key);\n encoder.string(val);\n });\n encoder.map(this.stringMapFieldEmbedded.size, Kind.String, Kind.Any);\n this.stringMapFieldEmbedded.forEach((val, key) => {\n encoder.string(key);\n val.encode(encoder);\n });\n encoder.int32(this.int32Field);\n const int32ArrayFieldLength = this.int32ArrayField.length;\n encoder.array(int32ArrayFieldLength, Kind.Int32);\n for (let i = 0; i < int32ArrayFieldLength; i += 1) {\n encoder.int32(this.int32ArrayField[i]);\n }\n encoder.map(this.int32MapField.size, Kind.Int32, Kind.Int32);\n this.int32MapField.forEach((val, key) => {\n encoder.int32(key);\n encoder.int32(val);\n });\n encoder.map(this.int32MapFieldEmbedded.size, Kind.Int32, Kind.Any);\n this.int32MapFieldEmbedded.forEach((val, key) => {\n encoder.int32(key);\n val.encode(encoder);\n });\n encoder.int64(this.int64Field);\n const int64ArrayFieldLength = this.int64ArrayField.length;\n encoder.array(int64ArrayFieldLength, Kind.Int64);\n for (let i = 0; i < int64ArrayFieldLength; i += 1) {\n encoder.int64(this.int64ArrayField[i]);\n }\n encoder.map(this.int64MapField.size, Kind.Int64, Kind.Int64);\n this.int64MapField.forEach((val, key) => {\n encoder.int64(key);\n encoder.int64(val);\n });\n encoder.map(this.int64MapFieldEmbedded.size, Kind.Int64, Kind.Any);\n this.int64MapFieldEmbedded.forEach((val, key) => {\n encoder.int64(key);\n val.encode(encoder);\n });\n encoder.uint32(this.uint32Field);\n const uint32ArrayFieldLength = this.uint32ArrayField.length;\n encoder.array(uint32ArrayFieldLength, Kind.Uint32);\n for (let i = 0; i < uint32ArrayFieldLength; i += 1) {\n encoder.uint32(this.uint32ArrayField[i]);\n }\n encoder.map(this.uint32MapField.size, Kind.Uint32, Kind.Uint32);\n this.uint32MapField.forEach((val, key) => {\n encoder.uint32(key);\n encoder.uint32(val);\n });\n encoder.map(this.uint32MapFieldEmbedded.size, Kind.Uint32, Kind.Any);\n this.uint32MapFieldEmbedded.forEach((val, key) => {\n encoder.uint32(key);\n val.encode(encoder);\n });\n encoder.uint64(this.uint64Field);\n const uint64ArrayFieldLength = this.uint64ArrayField.length;\n encoder.array(uint64ArrayFieldLength, Kind.Uint64);\n for (let i = 0; i < uint64ArrayFieldLength; i += 1) {\n encoder.uint64(this.uint64ArrayField[i]);\n }\n encoder.map(this.uint64MapField.size, Kind.Uint64, Kind.Uint64);\n this.uint64MapField.forEach((val, key) => {\n encoder.uint64(key);\n encoder.uint64(val);\n });\n encoder.map(this.uint64MapFieldEmbedded.size, Kind.Uint64, Kind.Any);\n this.uint64MapFieldEmbedded.forEach((val, key) => {\n encoder.uint64(key);\n val.encode(encoder);\n });\n encoder.float32(this.float32Field);\n const float32ArrayFieldLength = this.float32ArrayField.length;\n encoder.array(float32ArrayFieldLength, Kind.Float32);\n for (let i = 0; i < float32ArrayFieldLength; i += 1) {\n encoder.float32(this.float32ArrayField[i]);\n }\n encoder.float64(this.float64Field);\n const float64ArrayFieldLength = this.float64ArrayField.length;\n encoder.array(float64ArrayFieldLength, Kind.Float64);\n for (let i = 0; i < float64ArrayFieldLength; i += 1) {\n encoder.float64(this.float64ArrayField[i]);\n }\n encoder.uint32(this.enumField);\n const enumArrayFieldLength = this.enumArrayField.length;\n encoder.array(enumArrayFieldLength, Kind.Uint32);\n for (let i = 0; i < enumArrayFieldLength; i += 1) {\n encoder.uint32(this.enumArrayField[i]);\n }\n encoder.map(this.enumMapField.size, Kind.Uint32, Kind.String);\n this.enumMapField.forEach((val, key) => {\n encoder.uint32(key);\n encoder.string(val);\n });\n encoder.map(this.enumMapFieldEmbedded.size, Kind.Uint32, Kind.Any);\n this.enumMapFieldEmbedded.forEach((val, key) => {\n encoder.uint32(key);\n val.encode(encoder);\n });\n encoder.uint8Array(this.bytesField);\n const bytesArrayFieldLength = this.bytesArrayField.length;\n encoder.array(bytesArrayFieldLength, Kind.Uint8Array);\n for (let i = 0; i < bytesArrayFieldLength; i += 1) {\n encoder.uint8Array(this.bytesArrayField[i]);\n }\n encoder.boolean(this.boolField);\n const boolArrayFieldLength = this.boolArrayField.length;\n encoder.array(boolArrayFieldLength, Kind.Boolean);\n for (let i = 0; i < boolArrayFieldLength; i += 1) {\n encoder.boolean(this.boolArrayField[i]);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithAllFieldTypes | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithAllFieldTypes(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.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YAAQ,IAAI,KAAK,qBAAqB,MAAM,qBAAK,QAAQ,qBAAK,GAAG;AACjE,SAAK,qBAAqB,QAAQ,CAAC,KAAK,QAAQ;AAC9C,cAAQ,OAAO,GAAG;AAClB,UAAI,OAAO,OAAO;AAAA,IACpB,CAAC;AACD,YAAQ,WAAW,KAAK,UAAU;AAClC,UAAM,wBAAwB,KAAK,gBAAgB;AACnD,YAAQ,MAAM,uBAAuB,qBAAK,UAAU;AACpD,aAAS,IAAI,GAAG,IAAI,uBAAuB,KAAK,GAAG;AACjD,cAAQ,WAAW,KAAK,gBAAgB,CAAC,CAAC;AAAA,IAC5C;AACA,YAAQ,QAAQ,KAAK,SAAS;AAC9B,UAAM,uBAAuB,KAAK,eAAe;AACjD,YAAQ,MAAM,sBAAsB,qBAAK,OAAO;AAChD,aAAS,IAAI,GAAG,IAAI,sBAAsB,KAAK,GAAG;AAChD,cAAQ,QAAQ,KAAK,eAAe,CAAC,CAAC;AAAA,IACxC;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,OAAQ,SAAsD;AACnE,QAAI,QAAQ,KAAK,GAAG;AAClB,aAAO;AAAA,IACT;AACA,WAAO,IAAI,uBAAuB,OAAO;AAAA,EAC3C;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,iBAAkB,SAAkB;AACzC,YAAQ,KAAK;AAAA,EACf;AACF;", "names": ["GenericEnum"] } diff --git a/integration/typescript_tests/signature/types.ts b/integration/typescript_tests/signature/types.ts index 6a43bb1e..015b9fff 100644 --- a/integration/typescript_tests/signature/types.ts +++ b/integration/typescript_tests/signature/types.ts @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.4.2, DO NOT EDIT. +// Code generated by scale-signature 0.4.3, DO NOT EDIT. // output: local-example-latest-guest import { Encoder, Decoder, Kind } from "@loopholelabs/polyglot" diff --git a/package.json b/package.json index f8f86fbc..fd4d586a 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "@loopholelabs/scale", - "version": "0.4.2", + "version": "0.4.3", "description": "Scale is a framework for building high-performance plugin systems into any application, all powered by WebAssembly.", - "source": "scale.ts", + "source": "index.ts", "types": "types.d.ts", "license": "Apache-2.0", "scripts": { diff --git a/signature/converter/converter_tests/generated.go b/signature/converter/converter_tests/generated.go index 2df57f16..7480ba0a 100644 --- a/signature/converter/converter_tests/generated.go +++ b/signature/converter/converter_tests/generated.go @@ -1,4 +1,4 @@ -// Code generated by scale-signature v0.4.2, DO NOT EDIT. +// Code generated by scale-signature v0.4.3, DO NOT EDIT. // output: generated package generated diff --git a/signature/generator/golang/generated.txt b/signature/generator/golang/generated.txt index 9d0b1e81..1f3c49fb 100644 --- a/signature/generator/golang/generated.txt +++ b/signature/generator/golang/generated.txt @@ -1,4 +1,4 @@ -// Code generated by scale-signature v0.4.2, DO NOT EDIT. +// Code generated by scale-signature v0.4.3, DO NOT EDIT. // output: types package types diff --git a/signature/generator/golang/generator_test.go b/signature/generator/golang/generator_test.go index fc9409ea..4f1c3c05 100644 --- a/signature/generator/golang/generator_test.go +++ b/signature/generator/golang/generator_test.go @@ -38,5 +38,5 @@ func TestGenerator(t *testing.T) { require.NoError(t, err) require.Equal(t, string(master), string(formatted)) - t.Log(string(formatted)) + // t.Log(string(formatted)) } diff --git a/signature/generator/rust/format/rustfmt/lib.rs b/signature/generator/rust/format/rustfmt/lib.rs index 38d5ba38..0ec0cb1b 100644 --- a/signature/generator/rust/format/rustfmt/lib.rs +++ b/signature/generator/rust/format/rustfmt/lib.rs @@ -1,9 +1,9 @@ use signature::types; pub fn scale( - ctx: Option<&mut types::Context>, + ctx: Option, ) -> Result, Box> { - let unwrapped = ctx.unwrap(); + let mut unwrapped = ctx.unwrap(); unwrapped.data = prettyplease::unparse(&syn::parse_str(unwrapped.data.as_str()).unwrap()); - signature::next(Some(unwrapped)) + Ok(Some(unwrapped)) } diff --git a/signature/generator/rust/format/signature/guest/Cargo.toml b/signature/generator/rust/format/signature/guest/Cargo.toml index a462f1c9..656ec07c 100644 --- a/signature/generator/rust/format/signature/guest/Cargo.toml +++ b/signature/generator/rust/format/signature/guest/Cargo.toml @@ -18,4 +18,4 @@ version = "0.7.0" version = "1.9.4" [dependencies.polyglot_rs] -version = "1.1.2" \ No newline at end of file +version = "1.1.3" \ No newline at end of file diff --git a/signature/generator/rust/format/signature/guest/guest.rs b/signature/generator/rust/format/signature/guest/guest.rs index 0fb5e5df..f80ad1c0 100644 --- a/signature/generator/rust/format/signature/guest/guest.rs +++ b/signature/generator/rust/format/signature/guest/guest.rs @@ -2,7 +2,7 @@ // output: local_rustfmt_latest_guest pub mod types; -use crate::types::{Decode, Encode}; +use crate::types::{Context, Decode, Encode}; use polyglot_rs::Encoder; use std::io::Cursor; @@ -93,10 +93,13 @@ pub unsafe fn hash() -> (u32, u32) { // next calls the next function in the Scale Function Chain pub fn next( - ctx: Option<&mut types::Context>, + ctx: Option, ) -> Result, Box> { unsafe { - let (ptr, len) = write(ctx); + let (ptr, len) = match ctx { + Some(ctx) => write(&mut ctx), + None => write(None), + }; _next(ptr, len); read() } diff --git a/signature/generator/rust/generated.txt b/signature/generator/rust/generated.txt index a85360b4..3b9d9f69 100755 --- a/signature/generator/rust/generated.txt +++ b/signature/generator/rust/generated.txt @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.4.2, DO NOT EDIT. +// Code generated by scale-signature 0.4.3, DO NOT EDIT. // output: types #![allow(dead_code)] diff --git a/signature/generator/rust/generator_test.go b/signature/generator/rust/generator_test.go index 3f501ac0..4465c8d4 100644 --- a/signature/generator/rust/generator_test.go +++ b/signature/generator/rust/generator_test.go @@ -38,6 +38,5 @@ func TestGenerator(t *testing.T) { require.NoError(t, err) require.Equal(t, string(master), string(formatted)) - t.Log(string(formatted)) - + // t.Log(string(formatted)) } diff --git a/signature/generator/rust/templates/guest.rs.templ b/signature/generator/rust/templates/guest.rs.templ index ed2fdea9..6809af4b 100644 --- a/signature/generator/rust/templates/guest.rs.templ +++ b/signature/generator/rust/templates/guest.rs.templ @@ -93,9 +93,16 @@ pub unsafe fn hash() -> (u32, u32) { } // next calls the next function in the Scale Function Chain -pub fn next(ctx: Option<&mut types::{{ .signature_schema.Context }}>) -> Result, Box> { +pub fn next(ctx: Option) -> Result, Box> { unsafe { - let (ptr, len) = write(ctx); + let (ptr, len) = match ctx { + Some(mut ctx) => { + write(Some(&mut ctx)) + } + None => { + write(None) + } + }; _next(ptr, len); read() } diff --git a/signature/generator/typescript/generated.txt b/signature/generator/typescript/generated.txt index 93d662cc..e1041ec6 100755 --- a/signature/generator/typescript/generated.txt +++ b/signature/generator/typescript/generated.txt @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.4.2, DO NOT EDIT. +// Code generated by scale-signature 0.4.3, DO NOT EDIT. // output: types import { Encoder, Decoder, Kind } from "@loopholelabs/polyglot" diff --git a/signature/generator/typescript/generator_test.go b/signature/generator/typescript/generator_test.go index 6bab3c99..931dc058 100644 --- a/signature/generator/typescript/generator_test.go +++ b/signature/generator/typescript/generator_test.go @@ -38,6 +38,5 @@ func TestGenerator(t *testing.T) { require.NoError(t, err) require.Equal(t, string(master), string(formatted)) - t.Log(string(formatted)) - + // t.Log(string(formatted)) } diff --git a/version/current_version b/version/current_version index 6466da55..b37392d3 100644 --- a/version/current_version +++ b/version/current_version @@ -1 +1 @@ -v0.4.2 \ No newline at end of file +v0.4.3 \ No newline at end of file