From 19d2af12b5db5a0f668f50b0cae3ee0f8a7affc2 Mon Sep 17 00:00:00 2001 From: dcodeIO Date: Fri, 24 Nov 2017 18:15:12 +0100 Subject: [PATCH] CLI: Make sure enum typings become generated (#884 didn't solve this); Other: Update tests --- cli/package-lock.json | 20 +++++ cli/targets/static.js | 2 +- ext/descriptor/index.d.ts | 80 ++++++++--------- package.json | 4 +- tests/data/comments.d.ts | 4 +- tests/data/comments.js | 2 + tests/data/convert.d.ts | 2 +- tests/data/convert.js | 2 + tests/data/mapbox/vector_tile.d.ts | 8 +- tests/data/mapbox/vector_tile.js | 7 +- tests/data/package.d.ts | 4 +- tests/data/package.js | 2 + tests/data/rpc-es6.d.ts | 4 +- tests/data/rpc-es6.js | 2 + tests/data/rpc.d.ts | 4 +- tests/data/rpc.js | 2 + tests/data/test.d.ts | 114 +++++++++++------------ tests/data/test.js | 140 ++++++++++++++++++++++------- 18 files changed, 255 insertions(+), 148 deletions(-) create mode 100644 cli/package-lock.json diff --git a/cli/package-lock.json b/cli/package-lock.json new file mode 100644 index 000000000..5c6360337 --- /dev/null +++ b/cli/package-lock.json @@ -0,0 +1,20 @@ +{ + "version": "6.7.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "requires": { + "os-tmpdir": "1.0.2" + } + } + } +} diff --git a/cli/targets/static.js b/cli/targets/static.js index 5b0eb759e..ec0b044e6 100644 --- a/cli/targets/static.js +++ b/cli/targets/static.js @@ -678,7 +678,7 @@ function buildEnum(ref, enm) { push(""); var comment = [ enm.comment || enm.name + " enum.", - enm.parent instanceof protobuf.Root ? "@exports " + escapeName(enm.name) : "@memberof " + exportName(enm.parent), + enm.parent instanceof protobuf.Root ? "@exports " + escapeName(enm.name) : "@name " + exportName(enm), config.forceEnumString ? "@enum {number}" : "@enum {string}", ]; Object.keys(enm.values).forEach(function(key) { diff --git a/ext/descriptor/index.d.ts b/ext/descriptor/index.d.ts index 6734fe98b..cfec447e5 100644 --- a/ext/descriptor/index.d.ts +++ b/ext/descriptor/index.d.ts @@ -1,5 +1,45 @@ import * as $protobuf from "../.."; +export const FileDescriptorSet: $protobuf.Type; + +export const FileDescriptorProto: $protobuf.Type; + +export const DescriptorProto: $protobuf.Type & { ExtensionRange: $protobuf.Type, ReservedRange: $protobuf.Type }; + +export const FieldDescriptorProto: $protobuf.Type & { Label: $protobuf.Enum, Type: $protobuf.Enum }; + +export const OneofDescriptorProto: $protobuf.Type; + +export const EnumDescriptorProto: $protobuf.Type; + +export const ServiceDescriptorProto: $protobuf.Type; + +export const EnumValueDescriptorProto: $protobuf.Type; + +export const MethodDescriptorProto: $protobuf.Type; + +export const FileOptions: $protobuf.Type & { OptimizeMode: $protobuf.Enum }; + +export const MessageOptions: $protobuf.Type; + +export const FieldOptions: $protobuf.Type & { CType: $protobuf.Enum, JSType: $protobuf.Enum }; + +export const OneofOptions: $protobuf.Type; + +export const EnumOptions: $protobuf.Type; + +export const EnumValueOptions: $protobuf.Type; + +export const ServiceOptions: $protobuf.Type; + +export const MethodOptions: $protobuf.Type; + +export const UninterpretedOption: $protobuf.Type & { NamePart: $protobuf.Type }; + +export const SourceCodeInfo: $protobuf.Type & { Location: $protobuf.Type }; + +export const GeneratedCodeInfo: $protobuf.Type & { Annotation: $protobuf.Type }; + export interface IFileDescriptorSet { file: IFileDescriptorProto[]; } @@ -133,43 +173,3 @@ export interface IMethodDescriptorProto { export interface IMethodOptions { deprecated?: boolean; } - -export const FileDescriptorSet: $protobuf.Type; - -export const FileDescriptorProto: $protobuf.Type; - -export const DescriptorProto: $protobuf.Type & { ExtensionRange: $protobuf.Type, ReservedRange: $protobuf.Type }; - -export const FieldDescriptorProto: $protobuf.Type & { Label: $protobuf.Enum, Type: $protobuf.Enum }; - -export const OneofDescriptorProto: $protobuf.Type; - -export const EnumDescriptorProto: $protobuf.Type; - -export const ServiceDescriptorProto: $protobuf.Type; - -export const EnumValueDescriptorProto: $protobuf.Type; - -export const MethodDescriptorProto: $protobuf.Type; - -export const FileOptions: $protobuf.Type & { OptimizeMode: $protobuf.Enum }; - -export const MessageOptions: $protobuf.Type; - -export const FieldOptions: $protobuf.Type & { CType: $protobuf.Enum, JSType: $protobuf.Enum }; - -export const OneofOptions: $protobuf.Type; - -export const EnumOptions: $protobuf.Type; - -export const EnumValueOptions: $protobuf.Type; - -export const ServiceOptions: $protobuf.Type; - -export const MethodOptions: $protobuf.Type; - -export const UninterpretedOption: $protobuf.Type & { NamePart: $protobuf.Type }; - -export const SourceCodeInfo: $protobuf.Type & { Location: $protobuf.Type }; - -export const GeneratedCodeInfo: $protobuf.Type & { Annotation: $protobuf.Type }; diff --git a/package.json b/package.json index d4fc9462a..fcab76df4 100644 --- a/package.json +++ b/package.json @@ -117,8 +117,8 @@ "scripts/postinstall.js", "bin/**", "cli/**", - "ext/**", - "google/**", + "ext/**", + "google/**", "src/**" ] } diff --git a/tests/data/comments.d.ts b/tests/data/comments.d.ts index 2aff4b841..645ce0a0e 100644 --- a/tests/data/comments.d.ts +++ b/tests/data/comments.d.ts @@ -6,7 +6,7 @@ export interface ITest1 { field3?: (boolean|null); } -export class Test1 { +export class Test1 implements ITest1 { constructor(properties?: ITest1); public field1: string; public field2: number; @@ -25,7 +25,7 @@ export class Test1 { export interface ITest2 { } -export class Test2 { +export class Test2 implements ITest2 { constructor(properties?: ITest2); public static create(properties?: ITest2): Test2; public static encode(message: ITest2, writer?: $protobuf.Writer): $protobuf.Writer; diff --git a/tests/data/comments.js b/tests/data/comments.js index cec9cd2c7..9ea45617f 100644 --- a/tests/data/comments.js +++ b/tests/data/comments.js @@ -27,6 +27,7 @@ $root.Test1 = (function() { * with * a * comment. + * @implements ITest1 * @constructor * @param {ITest1=} [properties] Properties to set */ @@ -255,6 +256,7 @@ $root.Test2 = (function() { * Constructs a new Test2. * @exports Test2 * @classdesc Represents a Test2. + * @implements ITest2 * @constructor * @param {ITest2=} [properties] Properties to set */ diff --git a/tests/data/convert.d.ts b/tests/data/convert.d.ts index e7fb4ccda..fb847947c 100644 --- a/tests/data/convert.d.ts +++ b/tests/data/convert.d.ts @@ -12,7 +12,7 @@ export interface IMessage { int64Map?: ({ [k: string]: (number|Long) }|null); } -export class Message { +export class Message implements IMessage { constructor(properties?: IMessage); public stringVal: string; public stringRepeated: string[]; diff --git a/tests/data/convert.js b/tests/data/convert.js index 92354a443..90cd4e844 100644 --- a/tests/data/convert.js +++ b/tests/data/convert.js @@ -30,6 +30,7 @@ $root.Message = (function() { * Constructs a new Message. * @exports Message * @classdesc Represents a Message. + * @implements IMessage * @constructor * @param {IMessage=} [properties] Properties to set */ @@ -543,6 +544,7 @@ $root.Message = (function() { /** * SomeEnum enum. + * @name Message.SomeEnum * @enum {string} * @property {number} ONE=1 ONE value * @property {number} TWO=2 TWO value diff --git a/tests/data/mapbox/vector_tile.d.ts b/tests/data/mapbox/vector_tile.d.ts index d55aa6b04..671c36524 100644 --- a/tests/data/mapbox/vector_tile.d.ts +++ b/tests/data/mapbox/vector_tile.d.ts @@ -6,7 +6,7 @@ export namespace vector_tile { layers?: (vector_tile.Tile.ILayer[]|null); } - class Tile { + class Tile implements ITile { constructor(properties?: vector_tile.ITile); public layers: vector_tile.Tile.ILayer[]; public static create(properties?: vector_tile.ITile): vector_tile.Tile; @@ -39,7 +39,7 @@ export namespace vector_tile { boolValue?: (boolean|null); } - class Value { + class Value implements IValue { constructor(properties?: vector_tile.Tile.IValue); public stringValue: string; public floatValue: number; @@ -66,7 +66,7 @@ export namespace vector_tile { geometry?: (number[]|null); } - class Feature { + class Feature implements IFeature { constructor(properties?: vector_tile.Tile.IFeature); public id: (number|Long); public tags: number[]; @@ -92,7 +92,7 @@ export namespace vector_tile { extent?: (number|null); } - class Layer { + class Layer implements ILayer { constructor(properties?: vector_tile.Tile.ILayer); public version: number; public name: string; diff --git a/tests/data/mapbox/vector_tile.js b/tests/data/mapbox/vector_tile.js index 7abc7ec93..02d6cce54 100644 --- a/tests/data/mapbox/vector_tile.js +++ b/tests/data/mapbox/vector_tile.js @@ -31,6 +31,7 @@ $root.vector_tile = (function() { * Constructs a new Tile. * @memberof vector_tile * @classdesc Represents a Tile. + * @implements ITile * @constructor * @param {vector_tile.ITile=} [properties] Properties to set */ @@ -224,6 +225,7 @@ $root.vector_tile = (function() { /** * GeomType enum. + * @name vector_tile.Tile.GeomType * @enum {string} * @property {number} UNKNOWN=0 UNKNOWN value * @property {number} POINT=1 POINT value @@ -258,6 +260,7 @@ $root.vector_tile = (function() { * Constructs a new Value. * @memberof vector_tile.Tile * @classdesc Represents a Value. + * @implements IValue * @constructor * @param {vector_tile.Tile.IValue=} [properties] Properties to set */ @@ -616,6 +619,7 @@ $root.vector_tile = (function() { * Constructs a new Feature. * @memberof vector_tile.Tile * @classdesc Represents a Feature. + * @implements IFeature * @constructor * @param {vector_tile.Tile.IFeature=} [properties] Properties to set */ @@ -958,6 +962,7 @@ $root.vector_tile = (function() { * Constructs a new Layer. * @memberof vector_tile.Tile * @classdesc Represents a Layer. + * @implements ILayer * @constructor * @param {vector_tile.Tile.ILayer=} [properties] Properties to set */ @@ -1177,7 +1182,7 @@ $root.vector_tile = (function() { if (!Array.isArray(message.values)) return "values: array expected"; for (var i = 0; i < message.values.length; ++i) { - error = $root.vector_tile.Tile.Value.verify(message.values[i]); + var error = $root.vector_tile.Tile.Value.verify(message.values[i]); if (error) return "values." + error; } diff --git a/tests/data/package.d.ts b/tests/data/package.d.ts index 1e725464b..c3946085b 100644 --- a/tests/data/package.d.ts +++ b/tests/data/package.d.ts @@ -20,7 +20,7 @@ export interface IPackage { cliDependencies?: (string[]|null); } -export class Package { +export class Package implements IPackage { constructor(properties?: IPackage); public name: string; public version: string; @@ -57,7 +57,7 @@ export namespace Package { url?: (string|null); } - class Repository { + class Repository implements IRepository { constructor(properties?: Package.IRepository); public type: string; public url: string; diff --git a/tests/data/package.js b/tests/data/package.js index ba3a5d8a8..bf3c4a975 100644 --- a/tests/data/package.js +++ b/tests/data/package.js @@ -38,6 +38,7 @@ $root.Package = (function() { * Constructs a new Package. * @exports Package * @classdesc Represents a Package. + * @implements IPackage * @constructor * @param {IPackage=} [properties] Properties to set */ @@ -681,6 +682,7 @@ $root.Package = (function() { * Constructs a new Repository. * @memberof Package * @classdesc Represents a Repository. + * @implements IRepository * @constructor * @param {Package.IRepository=} [properties] Properties to set */ diff --git a/tests/data/rpc-es6.d.ts b/tests/data/rpc-es6.d.ts index 82cbe87e0..dfd8b5502 100644 --- a/tests/data/rpc-es6.d.ts +++ b/tests/data/rpc-es6.d.ts @@ -16,7 +16,7 @@ export interface IMyRequest { path?: (string|null); } -export class MyRequest { +export class MyRequest implements IMyRequest { constructor(properties?: IMyRequest); public path: string; public static create(properties?: IMyRequest): MyRequest; @@ -34,7 +34,7 @@ export interface IMyResponse { status?: (number|null); } -export class MyResponse { +export class MyResponse implements IMyResponse { constructor(properties?: IMyResponse); public status: number; public static create(properties?: IMyResponse): MyResponse; diff --git a/tests/data/rpc-es6.js b/tests/data/rpc-es6.js index ee518cf8a..650abeeb4 100644 --- a/tests/data/rpc-es6.js +++ b/tests/data/rpc-es6.js @@ -88,6 +88,7 @@ export const MyRequest = $root.MyRequest = (() => { * Constructs a new MyRequest. * @exports MyRequest * @classdesc Represents a MyRequest. + * @implements IMyRequest * @constructor * @param {IMyRequest=} [properties] Properties to set */ @@ -274,6 +275,7 @@ export const MyResponse = $root.MyResponse = (() => { * Constructs a new MyResponse. * @exports MyResponse * @classdesc Represents a MyResponse. + * @implements IMyResponse * @constructor * @param {IMyResponse=} [properties] Properties to set */ diff --git a/tests/data/rpc.d.ts b/tests/data/rpc.d.ts index 82cbe87e0..dfd8b5502 100644 --- a/tests/data/rpc.d.ts +++ b/tests/data/rpc.d.ts @@ -16,7 +16,7 @@ export interface IMyRequest { path?: (string|null); } -export class MyRequest { +export class MyRequest implements IMyRequest { constructor(properties?: IMyRequest); public path: string; public static create(properties?: IMyRequest): MyRequest; @@ -34,7 +34,7 @@ export interface IMyResponse { status?: (number|null); } -export class MyResponse { +export class MyResponse implements IMyResponse { constructor(properties?: IMyResponse); public status: number; public static create(properties?: IMyResponse): MyResponse; diff --git a/tests/data/rpc.js b/tests/data/rpc.js index 1b4f17129..391fcfcf1 100644 --- a/tests/data/rpc.js +++ b/tests/data/rpc.js @@ -90,6 +90,7 @@ $root.MyRequest = (function() { * Constructs a new MyRequest. * @exports MyRequest * @classdesc Represents a MyRequest. + * @implements IMyRequest * @constructor * @param {IMyRequest=} [properties] Properties to set */ @@ -276,6 +277,7 @@ $root.MyResponse = (function() { * Constructs a new MyResponse. * @exports MyResponse * @classdesc Represents a MyResponse. + * @implements IMyResponse * @constructor * @param {IMyResponse=} [properties] Properties to set */ diff --git a/tests/data/test.d.ts b/tests/data/test.d.ts index a8d6531e6..1b4d86532 100644 --- a/tests/data/test.d.ts +++ b/tests/data/test.d.ts @@ -7,7 +7,7 @@ export namespace jspb { interface IEmpty { } - class Empty { + class Empty implements IEmpty { constructor(properties?: jspb.test.IEmpty); public static create(properties?: jspb.test.IEmpty): jspb.test.Empty; public static encode(message: jspb.test.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; @@ -29,7 +29,7 @@ export namespace jspb { outerEnum?: (jspb.test.OuterEnum|null); } - class EnumContainer { + class EnumContainer implements IEnumContainer { constructor(properties?: jspb.test.IEnumContainer); public outerEnum: jspb.test.OuterEnum; public static create(properties?: jspb.test.IEnumContainer): jspb.test.EnumContainer; @@ -49,7 +49,7 @@ export namespace jspb { aBoolean?: (boolean|null); } - class Simple1 { + class Simple1 implements ISimple1 { constructor(properties?: jspb.test.ISimple1); public aString: string; public aRepeatedString: string[]; @@ -70,7 +70,7 @@ export namespace jspb { aRepeatedString?: (string[]|null); } - class Simple2 { + class Simple2 implements ISimple2 { constructor(properties?: jspb.test.ISimple2); public aString: string; public aRepeatedString: string[]; @@ -92,7 +92,7 @@ export namespace jspb { "var": string; } - class SpecialCases { + class SpecialCases implements ISpecialCases { constructor(properties?: jspb.test.ISpecialCases); public normal: string; public default_: string; @@ -117,7 +117,7 @@ export namespace jspb { aRepeatedString?: (string[]|null); } - class OptionalFields { + class OptionalFields implements IOptionalFields { constructor(properties?: jspb.test.IOptionalFields); public aString: string; public aBool: boolean; @@ -141,7 +141,7 @@ export namespace jspb { anInt?: (number|null); } - class Nested { + class Nested implements INested { constructor(properties?: jspb.test.OptionalFields.INested); public anInt: number; public static create(properties?: jspb.test.OptionalFields.INested): jspb.test.OptionalFields.Nested; @@ -168,7 +168,7 @@ export namespace jspb { ".jspb.test.simple1"?: (jspb.test.ISimple1|null); } - class HasExtensions { + class HasExtensions implements IHasExtensions { constructor(properties?: jspb.test.IHasExtensions); public str1: string; public str2: string; @@ -192,7 +192,7 @@ export namespace jspb { aRepeatedString?: (string[]|null); } - class Complex { + class Complex implements IComplex { constructor(properties?: jspb.test.IComplex); public aString: string; public anOutOfOrderBool: boolean; @@ -216,7 +216,7 @@ export namespace jspb { anInt: number; } - class Nested { + class Nested implements INested { constructor(properties?: jspb.test.Complex.INested); public anInt: number; public static create(properties?: jspb.test.Complex.INested): jspb.test.Complex.Nested; @@ -234,7 +234,7 @@ export namespace jspb { interface IOuterMessage { } - class OuterMessage { + class OuterMessage implements IOuterMessage { constructor(properties?: jspb.test.IOuterMessage); public static create(properties?: jspb.test.IOuterMessage): jspb.test.OuterMessage; public static encode(message: jspb.test.IOuterMessage, writer?: $protobuf.Writer): $protobuf.Writer; @@ -253,7 +253,7 @@ export namespace jspb { innerComplexField?: (number|null); } - class Complex { + class Complex implements IComplex { constructor(properties?: jspb.test.OuterMessage.IComplex); public innerComplexField: number; public static create(properties?: jspb.test.OuterMessage.IComplex): jspb.test.OuterMessage.Complex; @@ -272,7 +272,7 @@ export namespace jspb { ext1?: (string|null); } - class IsExtension { + class IsExtension implements IIsExtension { constructor(properties?: jspb.test.IIsExtension); public ext1: string; public static create(properties?: jspb.test.IIsExtension): jspb.test.IsExtension; @@ -289,7 +289,7 @@ export namespace jspb { interface IIndirectExtension { } - class IndirectExtension { + class IndirectExtension implements IIndirectExtension { constructor(properties?: jspb.test.IIndirectExtension); public static create(properties?: jspb.test.IIndirectExtension): jspb.test.IndirectExtension; public static encode(message: jspb.test.IIndirectExtension, writer?: $protobuf.Writer): $protobuf.Writer; @@ -311,7 +311,7 @@ export namespace jspb { bytesField?: (Uint8Array|null); } - class DefaultValues { + class DefaultValues implements IDefaultValues { constructor(properties?: jspb.test.IDefaultValues); public stringField: string; public boolField: boolean; @@ -349,7 +349,7 @@ export namespace jspb { defaultDoubleField?: (number|null); } - class FloatingPointFields { + class FloatingPointFields implements IFloatingPointFields { constructor(properties?: jspb.test.IFloatingPointFields); public optionalFloatField: number; public requiredFloatField: number; @@ -379,7 +379,7 @@ export namespace jspb { ".jspb.test.CloneExtension.extField"?: (jspb.test.ICloneExtension|null); } - class TestClone { + class TestClone implements ITestClone { constructor(properties?: jspb.test.ITestClone); public str: string; public simple1?: (jspb.test.ISimple1|null); @@ -401,7 +401,7 @@ export namespace jspb { ext?: (string|null); } - class CloneExtension { + class CloneExtension implements ICloneExtension { constructor(properties?: jspb.test.ICloneExtension); public ext: string; public static create(properties?: jspb.test.ICloneExtension): jspb.test.CloneExtension; @@ -424,7 +424,7 @@ export namespace jspb { optionalSimple?: (jspb.test.ISimple2|null); } - class TestGroup { + class TestGroup implements ITestGroup { constructor(properties?: jspb.test.ITestGroup); public repeatedGroup: jspb.test.TestGroup.IRepeatedGroup[]; public requiredGroup: jspb.test.TestGroup.IRequiredGroup; @@ -450,7 +450,7 @@ export namespace jspb { someBool?: (boolean[]|null); } - class RepeatedGroup { + class RepeatedGroup implements IRepeatedGroup { constructor(properties?: jspb.test.TestGroup.IRepeatedGroup); public id: string; public someBool: boolean[]; @@ -469,7 +469,7 @@ export namespace jspb { id: string; } - class RequiredGroup { + class RequiredGroup implements IRequiredGroup { constructor(properties?: jspb.test.TestGroup.IRequiredGroup); public id: string; public static create(properties?: jspb.test.TestGroup.IRequiredGroup): jspb.test.TestGroup.RequiredGroup; @@ -487,7 +487,7 @@ export namespace jspb { id: string; } - class OptionalGroup { + class OptionalGroup implements IOptionalGroup { constructor(properties?: jspb.test.TestGroup.IOptionalGroup); public id: string; public static create(properties?: jspb.test.TestGroup.IOptionalGroup): jspb.test.TestGroup.OptionalGroup; @@ -506,7 +506,7 @@ export namespace jspb { group?: (jspb.test.TestGroup.IRepeatedGroup|null); } - class TestGroup1 { + class TestGroup1 implements ITestGroup1 { constructor(properties?: jspb.test.ITestGroup1); public group?: (jspb.test.TestGroup.IRepeatedGroup|null); public static create(properties?: jspb.test.ITestGroup1): jspb.test.TestGroup1; @@ -525,7 +525,7 @@ export namespace jspb { ".jspb.test.TestReservedNamesExtension.foo"?: (number|null); } - class TestReservedNames { + class TestReservedNames implements ITestReservedNames { constructor(properties?: jspb.test.ITestReservedNames); public extension: number; public static create(properties?: jspb.test.ITestReservedNames): jspb.test.TestReservedNames; @@ -542,7 +542,7 @@ export namespace jspb { interface ITestReservedNamesExtension { } - class TestReservedNamesExtension { + class TestReservedNamesExtension implements ITestReservedNamesExtension { constructor(properties?: jspb.test.ITestReservedNamesExtension); public static create(properties?: jspb.test.ITestReservedNamesExtension): jspb.test.TestReservedNamesExtension; public static encode(message: jspb.test.ITestReservedNamesExtension, writer?: $protobuf.Writer): $protobuf.Writer; @@ -568,7 +568,7 @@ export namespace jspb { btwo?: (number|null); } - class TestMessageWithOneof { + class TestMessageWithOneof implements ITestMessageWithOneof { constructor(properties?: jspb.test.ITestMessageWithOneof); public pone: string; public pthree: string; @@ -600,7 +600,7 @@ export namespace jspb { data?: (Uint8Array|null); } - class TestEndsWithBytes { + class TestEndsWithBytes implements ITestEndsWithBytes { constructor(properties?: jspb.test.ITestEndsWithBytes); public value: number; public data: Uint8Array; @@ -630,7 +630,7 @@ export namespace jspb { mapStringTestmapfields?: ({ [k: string]: jspb.test.ITestMapFieldsNoBinary }|null); } - class TestMapFieldsNoBinary { + class TestMapFieldsNoBinary implements ITestMapFieldsNoBinary { constructor(properties?: jspb.test.ITestMapFieldsNoBinary); public mapStringString: { [k: string]: string }; public mapStringInt32: { [k: string]: number }; @@ -665,7 +665,7 @@ export namespace jspb { foo?: (number|null); } - class MapValueMessageNoBinary { + class MapValueMessageNoBinary implements IMapValueMessageNoBinary { constructor(properties?: jspb.test.IMapValueMessageNoBinary); public foo: number; public static create(properties?: jspb.test.IMapValueMessageNoBinary): jspb.test.MapValueMessageNoBinary; @@ -682,7 +682,7 @@ export namespace jspb { interface IDeeply { } - class Deeply { + class Deeply implements IDeeply { constructor(properties?: jspb.test.IDeeply); public static create(properties?: jspb.test.IDeeply): jspb.test.Deeply; public static encode(message: jspb.test.IDeeply, writer?: $protobuf.Writer): $protobuf.Writer; @@ -700,7 +700,7 @@ export namespace jspb { interface INested { } - class Nested { + class Nested implements INested { constructor(properties?: jspb.test.Deeply.INested); public static create(properties?: jspb.test.Deeply.INested): jspb.test.Deeply.Nested; public static encode(message: jspb.test.Deeply.INested, writer?: $protobuf.Writer): $protobuf.Writer; @@ -719,7 +719,7 @@ export namespace jspb { count?: (number|null); } - class Message { + class Message implements IMessage { constructor(properties?: jspb.test.Deeply.Nested.IMessage); public count: number; public static create(properties?: jspb.test.Deeply.Nested.IMessage): jspb.test.Deeply.Nested.Message; @@ -745,7 +745,7 @@ export namespace google { file?: (google.protobuf.IFileDescriptorProto[]|null); } - class FileDescriptorSet { + class FileDescriptorSet implements IFileDescriptorSet { constructor(properties?: google.protobuf.IFileDescriptorSet); public file: google.protobuf.IFileDescriptorProto[]; public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; @@ -774,7 +774,7 @@ export namespace google { syntax?: (string|null); } - class FileDescriptorProto { + class FileDescriptorProto implements IFileDescriptorProto { constructor(properties?: google.protobuf.IFileDescriptorProto); public name: string; public package_: string; @@ -812,7 +812,7 @@ export namespace google { reservedName?: (string[]|null); } - class DescriptorProto { + class DescriptorProto implements IDescriptorProto { constructor(properties?: google.protobuf.IDescriptorProto); public name: string; public field: google.protobuf.IFieldDescriptorProto[]; @@ -842,7 +842,7 @@ export namespace google { end?: (number|null); } - class ExtensionRange { + class ExtensionRange implements IExtensionRange { constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); public start: number; public end: number; @@ -862,7 +862,7 @@ export namespace google { end?: (number|null); } - class ReservedRange { + class ReservedRange implements IReservedRange { constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); public start: number; public end: number; @@ -891,7 +891,7 @@ export namespace google { options?: (google.protobuf.IFieldOptions|null); } - class FieldDescriptorProto { + class FieldDescriptorProto implements IFieldDescriptorProto { constructor(properties?: google.protobuf.IFieldDescriptorProto); public name: string; public number: number; @@ -949,7 +949,7 @@ export namespace google { options?: (google.protobuf.IOneofOptions|null); } - class OneofDescriptorProto { + class OneofDescriptorProto implements IOneofDescriptorProto { constructor(properties?: google.protobuf.IOneofDescriptorProto); public name: string; public options?: (google.protobuf.IOneofOptions|null); @@ -970,7 +970,7 @@ export namespace google { options?: (google.protobuf.IEnumOptions|null); } - class EnumDescriptorProto { + class EnumDescriptorProto implements IEnumDescriptorProto { constructor(properties?: google.protobuf.IEnumDescriptorProto); public name: string; public value: google.protobuf.IEnumValueDescriptorProto[]; @@ -992,7 +992,7 @@ export namespace google { options?: (google.protobuf.IEnumValueOptions|null); } - class EnumValueDescriptorProto { + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { constructor(properties?: google.protobuf.IEnumValueDescriptorProto); public name: string; public number: number; @@ -1014,7 +1014,7 @@ export namespace google { options?: (google.protobuf.IServiceOptions|null); } - class ServiceDescriptorProto { + class ServiceDescriptorProto implements IServiceDescriptorProto { constructor(properties?: google.protobuf.IServiceDescriptorProto); public name: string; public method: google.protobuf.IMethodDescriptorProto[]; @@ -1039,7 +1039,7 @@ export namespace google { serverStreaming?: (boolean|null); } - class MethodDescriptorProto { + class MethodDescriptorProto implements IMethodDescriptorProto { constructor(properties?: google.protobuf.IMethodDescriptorProto); public name: string; public inputType: string; @@ -1076,7 +1076,7 @@ export namespace google { uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } - class FileOptions { + class FileOptions implements IFileOptions { constructor(properties?: google.protobuf.IFileOptions); public javaPackage: string; public javaOuterClassname: string; @@ -1121,7 +1121,7 @@ export namespace google { uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } - class MessageOptions { + class MessageOptions implements IMessageOptions { constructor(properties?: google.protobuf.IMessageOptions); public messageSetWireFormat: boolean; public noStandardDescriptorAccessor: boolean; @@ -1149,7 +1149,7 @@ export namespace google { uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } - class FieldOptions { + class FieldOptions implements IFieldOptions { constructor(properties?: google.protobuf.IFieldOptions); public ctype: google.protobuf.FieldOptions.CType; public packed: boolean; @@ -1188,7 +1188,7 @@ export namespace google { uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } - class OneofOptions { + class OneofOptions implements IOneofOptions { constructor(properties?: google.protobuf.IOneofOptions); public uninterpretedOption: google.protobuf.IUninterpretedOption[]; public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; @@ -1209,7 +1209,7 @@ export namespace google { ".jspb.test.IsExtension.simpleOption"?: (string|null); } - class EnumOptions { + class EnumOptions implements IEnumOptions { constructor(properties?: google.protobuf.IEnumOptions); public allowAlias: boolean; public deprecated: boolean; @@ -1230,7 +1230,7 @@ export namespace google { uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } - class EnumValueOptions { + class EnumValueOptions implements IEnumValueOptions { constructor(properties?: google.protobuf.IEnumValueOptions); public deprecated: boolean; public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -1250,7 +1250,7 @@ export namespace google { uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } - class ServiceOptions { + class ServiceOptions implements IServiceOptions { constructor(properties?: google.protobuf.IServiceOptions); public deprecated: boolean; public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -1271,7 +1271,7 @@ export namespace google { uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } - class MethodOptions { + class MethodOptions implements IMethodOptions { constructor(properties?: google.protobuf.IMethodOptions); public deprecated: boolean; public idempotencyLevel: google.protobuf.MethodOptions.IdempotencyLevel; @@ -1306,7 +1306,7 @@ export namespace google { aggregateValue?: (string|null); } - class UninterpretedOption { + class UninterpretedOption implements IUninterpretedOption { constructor(properties?: google.protobuf.IUninterpretedOption); public name: google.protobuf.UninterpretedOption.INamePart[]; public identifierValue: string; @@ -1333,7 +1333,7 @@ export namespace google { isExtension: boolean; } - class NamePart { + class NamePart implements INamePart { constructor(properties?: google.protobuf.UninterpretedOption.INamePart); public namePart: string; public isExtension: boolean; @@ -1353,7 +1353,7 @@ export namespace google { location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); } - class SourceCodeInfo { + class SourceCodeInfo implements ISourceCodeInfo { constructor(properties?: google.protobuf.ISourceCodeInfo); public location: google.protobuf.SourceCodeInfo.ILocation[]; public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; @@ -1377,7 +1377,7 @@ export namespace google { leadingDetachedComments?: (string[]|null); } - class Location { + class Location implements ILocation { constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); public path: number[]; public span: number[]; @@ -1400,7 +1400,7 @@ export namespace google { annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); } - class GeneratedCodeInfo { + class GeneratedCodeInfo implements IGeneratedCodeInfo { constructor(properties?: google.protobuf.IGeneratedCodeInfo); public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; @@ -1423,7 +1423,7 @@ export namespace google { end?: (number|null); } - class Annotation { + class Annotation implements IAnnotation { constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); public path: number[]; public sourceFile: string; diff --git a/tests/data/test.js b/tests/data/test.js index ed98dce79..ce9908429 100644 --- a/tests/data/test.js +++ b/tests/data/test.js @@ -39,6 +39,7 @@ $root.jspb = (function() { * Constructs a new Empty. * @memberof jspb.test * @classdesc Represents an Empty. + * @implements IEmpty * @constructor * @param {jspb.test.IEmpty=} [properties] Properties to set */ @@ -188,6 +189,7 @@ $root.jspb = (function() { /** * OuterEnum enum. + * @name jspb.test.OuterEnum * @enum {string} * @property {number} FOO=1 FOO value * @property {number} BAR=2 BAR value @@ -212,6 +214,7 @@ $root.jspb = (function() { * Constructs a new EnumContainer. * @memberof jspb.test * @classdesc Represents an EnumContainer. + * @implements IEnumContainer * @constructor * @param {jspb.test.IEnumContainer=} [properties] Properties to set */ @@ -413,6 +416,7 @@ $root.jspb = (function() { * Constructs a new Simple1. * @memberof jspb.test * @classdesc Represents a Simple1. + * @implements ISimple1 * @constructor * @param {jspb.test.ISimple1=} [properties] Properties to set */ @@ -660,6 +664,7 @@ $root.jspb = (function() { * Constructs a new Simple2. * @memberof jspb.test * @classdesc Represents a Simple2. + * @implements ISimple2 * @constructor * @param {jspb.test.ISimple2=} [properties] Properties to set */ @@ -887,6 +892,7 @@ $root.jspb = (function() { * Constructs a new SpecialCases. * @memberof jspb.test * @classdesc Represents a SpecialCases. + * @implements ISpecialCases * @constructor * @param {jspb.test.ISpecialCases=} [properties] Properties to set */ @@ -1141,6 +1147,7 @@ $root.jspb = (function() { * Constructs a new OptionalFields. * @memberof jspb.test * @classdesc Represents an OptionalFields. + * @implements IOptionalFields * @constructor * @param {jspb.test.IOptionalFields=} [properties] Properties to set */ @@ -1332,7 +1339,7 @@ $root.jspb = (function() { if (!Array.isArray(message.aRepeatedMessage)) return "aRepeatedMessage: array expected"; for (var i = 0; i < message.aRepeatedMessage.length; ++i) { - error = $root.jspb.test.OptionalFields.Nested.verify(message.aRepeatedMessage[i]); + var error = $root.jspb.test.OptionalFields.Nested.verify(message.aRepeatedMessage[i]); if (error) return "aRepeatedMessage." + error; } @@ -1453,6 +1460,7 @@ $root.jspb = (function() { * Constructs a new Nested. * @memberof jspb.test.OptionalFields * @classdesc Represents a Nested. + * @implements INested * @constructor * @param {jspb.test.OptionalFields.INested=} [properties] Properties to set */ @@ -1650,6 +1658,7 @@ $root.jspb = (function() { * Constructs a new HasExtensions. * @memberof jspb.test * @classdesc Represents a HasExtensions. + * @implements IHasExtensions * @constructor * @param {jspb.test.IHasExtensions=} [properties] Properties to set */ @@ -1893,7 +1902,7 @@ $root.jspb = (function() { return ".jspb.test.IsExtension.extField." + error; } if (message[".jspb.test.IndirectExtension.simple"] != null && message.hasOwnProperty(".jspb.test.IndirectExtension.simple")) { - error = $root.jspb.test.Simple1.verify(message[".jspb.test.IndirectExtension.simple"]); + var error = $root.jspb.test.Simple1.verify(message[".jspb.test.IndirectExtension.simple"]); if (error) return ".jspb.test.IndirectExtension.simple." + error; } @@ -1911,13 +1920,13 @@ $root.jspb = (function() { if (!Array.isArray(message[".jspb.test.IndirectExtension.repeatedSimple"])) return ".jspb.test.IndirectExtension.repeatedSimple: array expected"; for (var i = 0; i < message[".jspb.test.IndirectExtension.repeatedSimple"].length; ++i) { - error = $root.jspb.test.Simple1.verify(message[".jspb.test.IndirectExtension.repeatedSimple"][i]); + var error = $root.jspb.test.Simple1.verify(message[".jspb.test.IndirectExtension.repeatedSimple"][i]); if (error) return ".jspb.test.IndirectExtension.repeatedSimple." + error; } } if (message[".jspb.test.simple1"] != null && message.hasOwnProperty(".jspb.test.simple1")) { - error = $root.jspb.test.Simple1.verify(message[".jspb.test.simple1"]); + var error = $root.jspb.test.Simple1.verify(message[".jspb.test.simple1"]); if (error) return ".jspb.test.simple1." + error; } @@ -2063,6 +2072,7 @@ $root.jspb = (function() { * Constructs a new Complex. * @memberof jspb.test * @classdesc Represents a Complex. + * @implements IComplex * @constructor * @param {jspb.test.IComplex=} [properties] Properties to set */ @@ -2254,7 +2264,7 @@ $root.jspb = (function() { if (!Array.isArray(message.aRepeatedMessage)) return "aRepeatedMessage: array expected"; for (var i = 0; i < message.aRepeatedMessage.length; ++i) { - error = $root.jspb.test.Complex.Nested.verify(message.aRepeatedMessage[i]); + var error = $root.jspb.test.Complex.Nested.verify(message.aRepeatedMessage[i]); if (error) return "aRepeatedMessage." + error; } @@ -2375,6 +2385,7 @@ $root.jspb = (function() { * Constructs a new Nested. * @memberof jspb.test.Complex * @classdesc Represents a Nested. + * @implements INested * @constructor * @param {jspb.test.Complex.INested=} [properties] Properties to set */ @@ -2563,6 +2574,7 @@ $root.jspb = (function() { * Constructs a new OuterMessage. * @memberof jspb.test * @classdesc Represents an OuterMessage. + * @implements IOuterMessage * @constructor * @param {jspb.test.IOuterMessage=} [properties] Properties to set */ @@ -2720,6 +2732,7 @@ $root.jspb = (function() { * Constructs a new Complex. * @memberof jspb.test.OuterMessage * @classdesc Represents a Complex. + * @implements IComplex * @constructor * @param {jspb.test.OuterMessage.IComplex=} [properties] Properties to set */ @@ -2909,6 +2922,7 @@ $root.jspb = (function() { * Constructs a new IsExtension. * @memberof jspb.test * @classdesc Represents an IsExtension. + * @implements IIsExtension * @constructor * @param {jspb.test.IIsExtension=} [properties] Properties to set */ @@ -3094,6 +3108,7 @@ $root.jspb = (function() { * Constructs a new IndirectExtension. * @memberof jspb.test * @classdesc Represents an IndirectExtension. + * @implements IIndirectExtension * @constructor * @param {jspb.test.IIndirectExtension=} [properties] Properties to set */ @@ -3259,6 +3274,7 @@ $root.jspb = (function() { * Constructs a new DefaultValues. * @memberof jspb.test * @classdesc Represents a DefaultValues. + * @implements IDefaultValues * @constructor * @param {jspb.test.IDefaultValues=} [properties] Properties to set */ @@ -3571,6 +3587,7 @@ $root.jspb = (function() { /** * Enum enum. + * @name jspb.test.DefaultValues.Enum * @enum {string} * @property {number} E1=13 E1 value * @property {number} E2=77 E2 value @@ -3605,6 +3622,7 @@ $root.jspb = (function() { * Constructs a new FloatingPointFields. * @memberof jspb.test * @classdesc Represents a FloatingPointFields. + * @implements IFloatingPointFields * @constructor * @param {jspb.test.IFloatingPointFields=} [properties] Properties to set */ @@ -3988,6 +4006,7 @@ $root.jspb = (function() { * Constructs a new TestClone. * @memberof jspb.test * @classdesc Represents a TestClone. + * @implements ITestClone * @constructor * @param {jspb.test.ITestClone=} [properties] Properties to set */ @@ -4185,7 +4204,7 @@ $root.jspb = (function() { if (!Array.isArray(message.simple2)) return "simple2: array expected"; for (var i = 0; i < message.simple2.length; ++i) { - error = $root.jspb.test.Simple1.verify(message.simple2[i]); + var error = $root.jspb.test.Simple1.verify(message.simple2[i]); if (error) return "simple2." + error; } @@ -4197,7 +4216,7 @@ $root.jspb = (function() { if (!$util.isString(message.unused)) return "unused: string expected"; if (message[".jspb.test.CloneExtension.extField"] != null && message.hasOwnProperty(".jspb.test.CloneExtension.extField")) { - error = $root.jspb.test.CloneExtension.verify(message[".jspb.test.CloneExtension.extField"]); + var error = $root.jspb.test.CloneExtension.verify(message[".jspb.test.CloneExtension.extField"]); if (error) return ".jspb.test.CloneExtension.extField." + error; } @@ -4315,6 +4334,7 @@ $root.jspb = (function() { * Constructs a new CloneExtension. * @memberof jspb.test * @classdesc Represents a CloneExtension. + * @implements ICloneExtension * @constructor * @param {jspb.test.ICloneExtension=} [properties] Properties to set */ @@ -4506,6 +4526,7 @@ $root.jspb = (function() { * Constructs a new TestGroup. * @memberof jspb.test * @classdesc Represents a TestGroup. + * @implements ITestGroup * @constructor * @param {jspb.test.ITestGroup=} [properties] Properties to set */ @@ -4702,22 +4723,26 @@ $root.jspb = (function() { return "repeatedGroup." + error; } } - error = $root.jspb.test.TestGroup.RequiredGroup.verify(message.requiredGroup); - if (error) - return "requiredGroup." + error; + { + var error = $root.jspb.test.TestGroup.RequiredGroup.verify(message.requiredGroup); + if (error) + return "requiredGroup." + error; + } if (message.optionalGroup != null && message.hasOwnProperty("optionalGroup")) { - error = $root.jspb.test.TestGroup.OptionalGroup.verify(message.optionalGroup); + var error = $root.jspb.test.TestGroup.OptionalGroup.verify(message.optionalGroup); if (error) return "optionalGroup." + error; } if (message.id != null && message.hasOwnProperty("id")) if (!$util.isString(message.id)) return "id: string expected"; - error = $root.jspb.test.Simple2.verify(message.requiredSimple); - if (error) - return "requiredSimple." + error; + { + var error = $root.jspb.test.Simple2.verify(message.requiredSimple); + if (error) + return "requiredSimple." + error; + } if (message.optionalSimple != null && message.hasOwnProperty("optionalSimple")) { - error = $root.jspb.test.Simple2.verify(message.optionalSimple); + var error = $root.jspb.test.Simple2.verify(message.optionalSimple); if (error) return "optionalSimple." + error; } @@ -4836,6 +4861,7 @@ $root.jspb = (function() { * Constructs a new RepeatedGroup. * @memberof jspb.test.TestGroup * @classdesc Represents a RepeatedGroup. + * @implements IRepeatedGroup * @constructor * @param {jspb.test.TestGroup.IRepeatedGroup=} [properties] Properties to set */ @@ -5067,6 +5093,7 @@ $root.jspb = (function() { * Constructs a new RequiredGroup. * @memberof jspb.test.TestGroup * @classdesc Represents a RequiredGroup. + * @implements IRequiredGroup * @constructor * @param {jspb.test.TestGroup.IRequiredGroup=} [properties] Properties to set */ @@ -5255,6 +5282,7 @@ $root.jspb = (function() { * Constructs a new OptionalGroup. * @memberof jspb.test.TestGroup * @classdesc Represents an OptionalGroup. + * @implements IOptionalGroup * @constructor * @param {jspb.test.TestGroup.IOptionalGroup=} [properties] Properties to set */ @@ -5446,6 +5474,7 @@ $root.jspb = (function() { * Constructs a new TestGroup1. * @memberof jspb.test * @classdesc Represents a TestGroup1. + * @implements ITestGroup1 * @constructor * @param {jspb.test.ITestGroup1=} [properties] Properties to set */ @@ -5638,6 +5667,7 @@ $root.jspb = (function() { * Constructs a new TestReservedNames. * @memberof jspb.test * @classdesc Represents a TestReservedNames. + * @implements ITestReservedNames * @constructor * @param {jspb.test.ITestReservedNames=} [properties] Properties to set */ @@ -5845,6 +5875,7 @@ $root.jspb = (function() { * Constructs a new TestReservedNamesExtension. * @memberof jspb.test * @classdesc Represents a TestReservedNamesExtension. + * @implements ITestReservedNamesExtension * @constructor * @param {jspb.test.ITestReservedNamesExtension=} [properties] Properties to set */ @@ -6014,6 +6045,7 @@ $root.jspb = (function() { * Constructs a new TestMessageWithOneof. * @memberof jspb.test * @classdesc Represents a TestMessageWithOneof. + * @implements ITestMessageWithOneof * @constructor * @param {jspb.test.ITestMessageWithOneof=} [properties] Properties to set */ @@ -6313,9 +6345,11 @@ $root.jspb = (function() { } if (message.rone != null && message.hasOwnProperty("rone")) { properties.recursiveOneof = 1; - var error = $root.jspb.test.TestMessageWithOneof.verify(message.rone); - if (error) - return "rone." + error; + { + var error = $root.jspb.test.TestMessageWithOneof.verify(message.rone); + if (error) + return "rone." + error; + } } if (message.rtwo != null && message.hasOwnProperty("rtwo")) { if (properties.recursiveOneof === 1) @@ -6499,6 +6533,7 @@ $root.jspb = (function() { * Constructs a new TestEndsWithBytes. * @memberof jspb.test * @classdesc Represents a TestEndsWithBytes. + * @implements ITestEndsWithBytes * @constructor * @param {jspb.test.ITestEndsWithBytes=} [properties] Properties to set */ @@ -6721,6 +6756,7 @@ $root.jspb = (function() { * Constructs a new TestMapFieldsNoBinary. * @memberof jspb.test * @classdesc Represents a TestMapFieldsNoBinary. + * @implements ITestMapFieldsNoBinary * @constructor * @param {jspb.test.ITestMapFieldsNoBinary=} [properties] Properties to set */ @@ -7159,7 +7195,7 @@ $root.jspb = (function() { } } if (message.testMapFields != null && message.hasOwnProperty("testMapFields")) { - error = $root.jspb.test.TestMapFieldsNoBinary.verify(message.testMapFields); + var error = $root.jspb.test.TestMapFieldsNoBinary.verify(message.testMapFields); if (error) return "testMapFields." + error; } @@ -7168,7 +7204,7 @@ $root.jspb = (function() { return "mapStringTestmapfields: object expected"; var key = Object.keys(message.mapStringTestmapfields); for (var i = 0; i < key.length; ++i) { - error = $root.jspb.test.TestMapFieldsNoBinary.verify(message.mapStringTestmapfields[key[i]]); + var error = $root.jspb.test.TestMapFieldsNoBinary.verify(message.mapStringTestmapfields[key[i]]); if (error) return "mapStringTestmapfields." + error; } @@ -7407,6 +7443,7 @@ $root.jspb = (function() { /** * MapValueEnumNoBinary enum. + * @name jspb.test.MapValueEnumNoBinary * @enum {string} * @property {number} MAP_VALUE_FOO_NOBINARY=0 MAP_VALUE_FOO_NOBINARY value * @property {number} MAP_VALUE_BAR_NOBINARY=1 MAP_VALUE_BAR_NOBINARY value @@ -7433,6 +7470,7 @@ $root.jspb = (function() { * Constructs a new MapValueMessageNoBinary. * @memberof jspb.test * @classdesc Represents a MapValueMessageNoBinary. + * @implements IMapValueMessageNoBinary * @constructor * @param {jspb.test.IMapValueMessageNoBinary=} [properties] Properties to set */ @@ -7618,6 +7656,7 @@ $root.jspb = (function() { * Constructs a new Deeply. * @memberof jspb.test * @classdesc Represents a Deeply. + * @implements IDeeply * @constructor * @param {jspb.test.IDeeply=} [properties] Properties to set */ @@ -7774,6 +7813,7 @@ $root.jspb = (function() { * Constructs a new Nested. * @memberof jspb.test.Deeply * @classdesc Represents a Nested. + * @implements INested * @constructor * @param {jspb.test.Deeply.INested=} [properties] Properties to set */ @@ -7931,6 +7971,7 @@ $root.jspb = (function() { * Constructs a new Message. * @memberof jspb.test.Deeply.Nested * @classdesc Represents a Message. + * @implements IMessage * @constructor * @param {jspb.test.Deeply.Nested.IMessage=} [properties] Properties to set */ @@ -8147,6 +8188,7 @@ $root.google = (function() { * Constructs a new FileDescriptorSet. * @memberof google.protobuf * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet * @constructor * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set */ @@ -8365,6 +8407,7 @@ $root.google = (function() { * Constructs a new FileDescriptorProto. * @memberof google.protobuf * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto * @constructor * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set */ @@ -8702,7 +8745,7 @@ $root.google = (function() { if (!Array.isArray(message.enumType)) return "enumType: array expected"; for (var i = 0; i < message.enumType.length; ++i) { - error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); if (error) return "enumType." + error; } @@ -8711,7 +8754,7 @@ $root.google = (function() { if (!Array.isArray(message.service)) return "service: array expected"; for (var i = 0; i < message.service.length; ++i) { - error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); if (error) return "service." + error; } @@ -8720,18 +8763,18 @@ $root.google = (function() { if (!Array.isArray(message.extension)) return "extension: array expected"; for (var i = 0; i < message.extension.length; ++i) { - error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); if (error) return "extension." + error; } } if (message.options != null && message.hasOwnProperty("options")) { - error = $root.google.protobuf.FileOptions.verify(message.options); + var error = $root.google.protobuf.FileOptions.verify(message.options); if (error) return "options." + error; } if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); if (error) return "sourceCodeInfo." + error; } @@ -8946,6 +8989,7 @@ $root.google = (function() { * Constructs a new DescriptorProto. * @memberof google.protobuf * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto * @constructor * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set */ @@ -9227,7 +9271,7 @@ $root.google = (function() { if (!Array.isArray(message.extension)) return "extension: array expected"; for (var i = 0; i < message.extension.length; ++i) { - error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); if (error) return "extension." + error; } @@ -9236,7 +9280,7 @@ $root.google = (function() { if (!Array.isArray(message.nestedType)) return "nestedType: array expected"; for (var i = 0; i < message.nestedType.length; ++i) { - error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); if (error) return "nestedType." + error; } @@ -9245,7 +9289,7 @@ $root.google = (function() { if (!Array.isArray(message.enumType)) return "enumType: array expected"; for (var i = 0; i < message.enumType.length; ++i) { - error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); if (error) return "enumType." + error; } @@ -9254,7 +9298,7 @@ $root.google = (function() { if (!Array.isArray(message.extensionRange)) return "extensionRange: array expected"; for (var i = 0; i < message.extensionRange.length; ++i) { - error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); if (error) return "extensionRange." + error; } @@ -9263,13 +9307,13 @@ $root.google = (function() { if (!Array.isArray(message.oneofDecl)) return "oneofDecl: array expected"; for (var i = 0; i < message.oneofDecl.length; ++i) { - error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); if (error) return "oneofDecl." + error; } } if (message.options != null && message.hasOwnProperty("options")) { - error = $root.google.protobuf.MessageOptions.verify(message.options); + var error = $root.google.protobuf.MessageOptions.verify(message.options); if (error) return "options." + error; } @@ -9277,7 +9321,7 @@ $root.google = (function() { if (!Array.isArray(message.reservedRange)) return "reservedRange: array expected"; for (var i = 0; i < message.reservedRange.length; ++i) { - error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); if (error) return "reservedRange." + error; } @@ -9490,6 +9534,7 @@ $root.google = (function() { * Constructs a new ExtensionRange. * @memberof google.protobuf.DescriptorProto * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange * @constructor * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set */ @@ -9699,6 +9744,7 @@ $root.google = (function() { * Constructs a new ReservedRange. * @memberof google.protobuf.DescriptorProto * @classdesc Represents a ReservedRange. + * @implements IReservedRange * @constructor * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set */ @@ -9919,6 +9965,7 @@ $root.google = (function() { * Constructs a new FieldDescriptorProto. * @memberof google.protobuf * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto * @constructor * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set */ @@ -10397,6 +10444,7 @@ $root.google = (function() { /** * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type * @enum {string} * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value @@ -10442,6 +10490,7 @@ $root.google = (function() { /** * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label * @enum {string} * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value @@ -10472,6 +10521,7 @@ $root.google = (function() { * Constructs a new OneofDescriptorProto. * @memberof google.protobuf * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto * @constructor * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set */ @@ -10687,6 +10737,7 @@ $root.google = (function() { * Constructs a new EnumDescriptorProto. * @memberof google.protobuf * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto * @constructor * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set */ @@ -10846,7 +10897,7 @@ $root.google = (function() { } } if (message.options != null && message.hasOwnProperty("options")) { - error = $root.google.protobuf.EnumOptions.verify(message.options); + var error = $root.google.protobuf.EnumOptions.verify(message.options); if (error) return "options." + error; } @@ -10945,6 +10996,7 @@ $root.google = (function() { * Constructs a new EnumValueDescriptorProto. * @memberof google.protobuf * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto * @constructor * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set */ @@ -11181,6 +11233,7 @@ $root.google = (function() { * Constructs a new ServiceDescriptorProto. * @memberof google.protobuf * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto * @constructor * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set */ @@ -11340,7 +11393,7 @@ $root.google = (function() { } } if (message.options != null && message.hasOwnProperty("options")) { - error = $root.google.protobuf.ServiceOptions.verify(message.options); + var error = $root.google.protobuf.ServiceOptions.verify(message.options); if (error) return "options." + error; } @@ -11442,6 +11495,7 @@ $root.google = (function() { * Constructs a new MethodDescriptorProto. * @memberof google.protobuf * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto * @constructor * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set */ @@ -11753,6 +11807,7 @@ $root.google = (function() { * Constructs a new FileOptions. * @memberof google.protobuf * @classdesc Represents a FileOptions. + * @implements IFileOptions * @constructor * @param {google.protobuf.IFileOptions=} [properties] Properties to set */ @@ -12260,6 +12315,7 @@ $root.google = (function() { /** * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode * @enum {string} * @property {number} SPEED=1 SPEED value * @property {number} CODE_SIZE=2 CODE_SIZE value @@ -12293,6 +12349,7 @@ $root.google = (function() { * Constructs a new MessageOptions. * @memberof google.protobuf * @classdesc Represents a MessageOptions. + * @implements IMessageOptions * @constructor * @param {google.protobuf.IMessageOptions=} [properties] Properties to set */ @@ -12592,6 +12649,7 @@ $root.google = (function() { * Constructs a new FieldOptions. * @memberof google.protobuf * @classdesc Represents a FieldOptions. + * @implements IFieldOptions * @constructor * @param {google.protobuf.IFieldOptions=} [properties] Properties to set */ @@ -12949,6 +13007,7 @@ $root.google = (function() { /** * CType enum. + * @name google.protobuf.FieldOptions.CType * @enum {string} * @property {number} STRING=0 STRING value * @property {number} CORD=1 CORD value @@ -12964,6 +13023,7 @@ $root.google = (function() { /** * JSType enum. + * @name google.protobuf.FieldOptions.JSType * @enum {string} * @property {number} JS_NORMAL=0 JS_NORMAL value * @property {number} JS_STRING=1 JS_STRING value @@ -12993,6 +13053,7 @@ $root.google = (function() { * Constructs a new OneofOptions. * @memberof google.protobuf * @classdesc Represents an OneofOptions. + * @implements IOneofOptions * @constructor * @param {google.protobuf.IOneofOptions=} [properties] Properties to set */ @@ -13203,6 +13264,7 @@ $root.google = (function() { * Constructs a new EnumOptions. * @memberof google.protobuf * @classdesc Represents an EnumOptions. + * @implements IEnumOptions * @constructor * @param {google.protobuf.IEnumOptions=} [properties] Properties to set */ @@ -13476,6 +13538,7 @@ $root.google = (function() { * Constructs a new EnumValueOptions. * @memberof google.protobuf * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions * @constructor * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set */ @@ -13706,6 +13769,7 @@ $root.google = (function() { * Constructs a new ServiceOptions. * @memberof google.protobuf * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions * @constructor * @param {google.protobuf.IServiceOptions=} [properties] Properties to set */ @@ -13937,6 +14001,7 @@ $root.google = (function() { * Constructs a new MethodOptions. * @memberof google.protobuf * @classdesc Represents a MethodOptions. + * @implements IMethodOptions * @constructor * @param {google.protobuf.IMethodOptions=} [properties] Properties to set */ @@ -14192,6 +14257,7 @@ $root.google = (function() { /** * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel * @enum {string} * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value @@ -14227,6 +14293,7 @@ $root.google = (function() { * Constructs a new UninterpretedOption. * @memberof google.protobuf * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption * @constructor * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set */ @@ -14591,6 +14658,7 @@ $root.google = (function() { * Constructs a new NamePart. * @memberof google.protobuf.UninterpretedOption * @classdesc Represents a NamePart. + * @implements INamePart * @constructor * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set */ @@ -14802,6 +14870,7 @@ $root.google = (function() { * Constructs a new SourceCodeInfo. * @memberof google.protobuf * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo * @constructor * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set */ @@ -15010,6 +15079,7 @@ $root.google = (function() { * Constructs a new Location. * @memberof google.protobuf.SourceCodeInfo * @classdesc Represents a Location. + * @implements ILocation * @constructor * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set */ @@ -15350,6 +15420,7 @@ $root.google = (function() { * Constructs a new GeneratedCodeInfo. * @memberof google.protobuf * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo * @constructor * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set */ @@ -15557,6 +15628,7 @@ $root.google = (function() { * Constructs a new Annotation. * @memberof google.protobuf.GeneratedCodeInfo * @classdesc Represents an Annotation. + * @implements IAnnotation * @constructor * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set */