@@ -394,6 +394,8 @@ function buildType(ref, type) {
394
394
jsType = "(" + jsType + "|null)" ;
395
395
pushComment ( [
396
396
field . comment || type . name + " " + field . name + "." ,
397
+ "@memberof " + exportName ( type ) ,
398
+ "@instance" ,
397
399
"@type {" + jsType + "}"
398
400
] ) ;
399
401
} else if ( firstField ) {
@@ -430,7 +432,9 @@ function buildType(ref, type) {
430
432
push ( "" ) ;
431
433
pushComment ( [
432
434
oneof . comment || type . name + " " + oneof . name + "." ,
433
- "@name " + exportName ( type ) + "#" + escapeName ( oneof . name ) ,
435
+ "@property " + escapeName ( oneof . name ) ,
436
+ "@memberof " + exportName ( type ) ,
437
+ "@instance" ,
434
438
"@type {string|undefined}"
435
439
] ) ;
436
440
push ( "Object.defineProperty(" + escapeName ( type . name ) + ".prototype, " + JSON . stringify ( oneof . name ) + ", {" ) ;
@@ -445,6 +449,8 @@ function buildType(ref, type) {
445
449
push ( "" ) ;
446
450
pushComment ( [
447
451
"Creates a new " + type . name + " instance using the specified properties." ,
452
+ "@memberof " + exportName ( type ) ,
453
+ "@static" ,
448
454
"@param {" + exportName ( type , true ) + "=} [properties] Properties to set" ,
449
455
"@returns {" + exportName ( type ) + "} " + type . name + " instance"
450
456
] ) ;
@@ -459,6 +465,8 @@ function buildType(ref, type) {
459
465
push ( "" ) ;
460
466
pushComment ( [
461
467
"Encodes the specified " + type . name + " message. Does not implicitly {@link " + exportName ( type ) + ".verify|verify} messages." ,
468
+ "@memberof " + exportName ( type ) ,
469
+ "@static" ,
462
470
"@param {" + exportName ( type , ! config . forceMessage ) + "} " + ( config . beautify ? "message" : "m" ) + " " + type . name + " message or plain object to encode" ,
463
471
"@param {$protobuf.Writer} [" + ( config . beautify ? "writer" : "w" ) + "] Writer to encode to" ,
464
472
"@returns {$protobuf.Writer} Writer"
@@ -469,6 +477,8 @@ function buildType(ref, type) {
469
477
push ( "" ) ;
470
478
pushComment ( [
471
479
"Encodes the specified " + type . name + " message, length delimited. Does not implicitly {@link " + exportName ( type ) + ".verify|verify} messages." ,
480
+ "@memberof " + exportName ( type ) ,
481
+ "@static" ,
472
482
"@param {" + exportName ( type , ! config . forceMessage ) + "} message " + type . name + " message or plain object to encode" ,
473
483
"@param {$protobuf.Writer} [writer] Writer to encode to" ,
474
484
"@returns {$protobuf.Writer} Writer"
@@ -485,6 +495,8 @@ function buildType(ref, type) {
485
495
push ( "" ) ;
486
496
pushComment ( [
487
497
"Decodes " + aOrAn ( type . name ) + " message from the specified reader or buffer." ,
498
+ "@memberof " + exportName ( type ) ,
499
+ "@static" ,
488
500
"@param {$protobuf.Reader|Uint8Array} " + ( config . beautify ? "reader" : "r" ) + " Reader or buffer to decode from" ,
489
501
"@param {number} [" + ( config . beautify ? "length" : "l" ) + "] Message length if known beforehand" ,
490
502
"@returns {" + exportName ( type ) + "} " + type . name ,
@@ -497,6 +509,8 @@ function buildType(ref, type) {
497
509
push ( "" ) ;
498
510
pushComment ( [
499
511
"Decodes " + aOrAn ( type . name ) + " message from the specified reader or buffer, length delimited." ,
512
+ "@memberof " + exportName ( type ) ,
513
+ "@static" ,
500
514
"@param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from" ,
501
515
"@returns {" + exportName ( type ) + "} " + type . name ,
502
516
"@throws {Error} If the payload is not a reader or valid buffer" ,
@@ -518,6 +532,8 @@ function buildType(ref, type) {
518
532
push ( "" ) ;
519
533
pushComment ( [
520
534
"Verifies " + aOrAn ( type . name ) + " message." ,
535
+ "@memberof " + exportName ( type ) ,
536
+ "@static" ,
521
537
"@param {Object.<string,*>} " + ( config . beautify ? "message" : "m" ) + " Plain object to verify" ,
522
538
"@returns {string|null} `null` if valid, otherwise the reason why it is not"
523
539
] ) ;
@@ -528,6 +544,8 @@ function buildType(ref, type) {
528
544
push ( "" ) ;
529
545
pushComment ( [
530
546
"Creates " + aOrAn ( type . name ) + " message from a plain object. Also converts values to their respective internal types." ,
547
+ "@memberof " + exportName ( type ) ,
548
+ "@static" ,
531
549
"@param {Object.<string,*>} " + ( config . beautify ? "object" : "d" ) + " Plain object" ,
532
550
"@returns {" + exportName ( type ) + "} " + type . name
533
551
] ) ;
@@ -536,6 +554,8 @@ function buildType(ref, type) {
536
554
push ( "" ) ;
537
555
pushComment ( [
538
556
"Creates a plain object from " + aOrAn ( type . name ) + " message. Also converts values to other types if specified." ,
557
+ "@memberof " + exportName ( type ) ,
558
+ "@static" ,
539
559
"@param {" + exportName ( type ) + "} " + ( config . beautify ? "message" : "m" ) + " " + type . name ,
540
560
"@param {$protobuf.IConversionOptions} [" + ( config . beautify ? "options" : "o" ) + "] Conversion options" ,
541
561
"@returns {Object.<string,*>} Plain object"
@@ -545,6 +565,8 @@ function buildType(ref, type) {
545
565
push ( "" ) ;
546
566
pushComment ( [
547
567
"Converts this " + type . name + " to JSON." ,
568
+ "@memberof " + exportName ( type ) ,
569
+ "@instance" ,
548
570
"@returns {Object.<string,*>} JSON object"
549
571
] ) ;
550
572
push ( escapeName ( type . name ) + ".prototype.toJSON = function toJSON() {" ) ;
@@ -580,6 +602,8 @@ function buildService(ref, service) {
580
602
push ( "" ) ;
581
603
pushComment ( [
582
604
"Creates new " + service . name + " service using the specified rpc implementation." ,
605
+ "@memberof " + exportName ( service ) ,
606
+ "@static" ,
583
607
"@param {$protobuf.RPCImpl} rpcImpl RPC implementation" ,
584
608
"@param {boolean} [requestDelimited=false] Whether requests are length-delimited" ,
585
609
"@param {boolean} [responseDelimited=false] Whether responses are length-delimited" ,
@@ -609,9 +633,12 @@ function buildService(ref, service) {
609
633
push ( "" ) ;
610
634
pushComment ( [
611
635
method . comment || "Calls " + method . name + "." ,
636
+ "@memberof " + exportName ( service ) ,
637
+ "@instance" ,
612
638
"@param {" + exportName ( method . resolvedRequestType , ! config . forceMessage ) + "} request " + method . resolvedRequestType . name + " message or plain object" ,
613
639
"@param {" + exportName ( service ) + "." + cbName + "} callback Node-style callback called with the error, if any, and " + method . resolvedResponseType . name ,
614
- "@returns {undefined}"
640
+ "@returns {undefined}" ,
641
+ "@variation 1"
615
642
] ) ;
616
643
push ( escapeName ( service . name ) + ".prototype" + util . safeProp ( lcName ) + " = function " + escapeName ( lcName ) + "(request, callback) {" ) ;
617
644
++ indent ;
@@ -622,8 +649,9 @@ function buildService(ref, service) {
622
649
push ( "" ) ;
623
650
pushComment ( [
624
651
method . comment || "Calls " + method . name + "." ,
625
- "@memberof " + exportName ( service ) + ".prototype" ,
626
652
"@function " + lcName ,
653
+ "@memberof " + exportName ( service ) ,
654
+ "@instance" ,
627
655
"@param {" + exportName ( method . resolvedRequestType , ! config . forceMessage ) + "} request " + method . resolvedRequestType . name + " message or plain object" ,
628
656
"@returns {Promise<" + exportName ( method . resolvedResponseType ) + ">} Promise" ,
629
657
"@variation 2"
0 commit comments