@@ -394,6 +394,8 @@ function buildType(ref, type) {
394394 jsType = "(" + jsType + "|null)" ;
395395 pushComment ( [
396396 field . comment || type . name + " " + field . name + "." ,
397+ "@memberof " + exportName ( type ) ,
398+ "@instance" ,
397399 "@type {" + jsType + "}"
398400 ] ) ;
399401 } else if ( firstField ) {
@@ -430,7 +432,9 @@ function buildType(ref, type) {
430432 push ( "" ) ;
431433 pushComment ( [
432434 oneof . comment || type . name + " " + oneof . name + "." ,
433- "@name " + exportName ( type ) + "#" + escapeName ( oneof . name ) ,
435+ "@property " + escapeName ( oneof . name ) ,
436+ "@memberof " + exportName ( type ) ,
437+ "@instance" ,
434438 "@type {string|undefined}"
435439 ] ) ;
436440 push ( "Object.defineProperty(" + escapeName ( type . name ) + ".prototype, " + JSON . stringify ( oneof . name ) + ", {" ) ;
@@ -445,6 +449,8 @@ function buildType(ref, type) {
445449 push ( "" ) ;
446450 pushComment ( [
447451 "Creates a new " + type . name + " instance using the specified properties." ,
452+ "@memberof " + exportName ( type ) ,
453+ "@static" ,
448454 "@param {" + exportName ( type , true ) + "=} [properties] Properties to set" ,
449455 "@returns {" + exportName ( type ) + "} " + type . name + " instance"
450456 ] ) ;
@@ -459,6 +465,8 @@ function buildType(ref, type) {
459465 push ( "" ) ;
460466 pushComment ( [
461467 "Encodes the specified " + type . name + " message. Does not implicitly {@link " + exportName ( type ) + ".verify|verify} messages." ,
468+ "@memberof " + exportName ( type ) ,
469+ "@static" ,
462470 "@param {" + exportName ( type , ! config . forceMessage ) + "} " + ( config . beautify ? "message" : "m" ) + " " + type . name + " message or plain object to encode" ,
463471 "@param {$protobuf.Writer} [" + ( config . beautify ? "writer" : "w" ) + "] Writer to encode to" ,
464472 "@returns {$protobuf.Writer} Writer"
@@ -469,6 +477,8 @@ function buildType(ref, type) {
469477 push ( "" ) ;
470478 pushComment ( [
471479 "Encodes the specified " + type . name + " message, length delimited. Does not implicitly {@link " + exportName ( type ) + ".verify|verify} messages." ,
480+ "@memberof " + exportName ( type ) ,
481+ "@static" ,
472482 "@param {" + exportName ( type , ! config . forceMessage ) + "} message " + type . name + " message or plain object to encode" ,
473483 "@param {$protobuf.Writer} [writer] Writer to encode to" ,
474484 "@returns {$protobuf.Writer} Writer"
@@ -485,6 +495,8 @@ function buildType(ref, type) {
485495 push ( "" ) ;
486496 pushComment ( [
487497 "Decodes " + aOrAn ( type . name ) + " message from the specified reader or buffer." ,
498+ "@memberof " + exportName ( type ) ,
499+ "@static" ,
488500 "@param {$protobuf.Reader|Uint8Array} " + ( config . beautify ? "reader" : "r" ) + " Reader or buffer to decode from" ,
489501 "@param {number} [" + ( config . beautify ? "length" : "l" ) + "] Message length if known beforehand" ,
490502 "@returns {" + exportName ( type ) + "} " + type . name ,
@@ -497,6 +509,8 @@ function buildType(ref, type) {
497509 push ( "" ) ;
498510 pushComment ( [
499511 "Decodes " + aOrAn ( type . name ) + " message from the specified reader or buffer, length delimited." ,
512+ "@memberof " + exportName ( type ) ,
513+ "@static" ,
500514 "@param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from" ,
501515 "@returns {" + exportName ( type ) + "} " + type . name ,
502516 "@throws {Error} If the payload is not a reader or valid buffer" ,
@@ -518,6 +532,8 @@ function buildType(ref, type) {
518532 push ( "" ) ;
519533 pushComment ( [
520534 "Verifies " + aOrAn ( type . name ) + " message." ,
535+ "@memberof " + exportName ( type ) ,
536+ "@static" ,
521537 "@param {Object.<string,*>} " + ( config . beautify ? "message" : "m" ) + " Plain object to verify" ,
522538 "@returns {string|null} `null` if valid, otherwise the reason why it is not"
523539 ] ) ;
@@ -528,6 +544,8 @@ function buildType(ref, type) {
528544 push ( "" ) ;
529545 pushComment ( [
530546 "Creates " + aOrAn ( type . name ) + " message from a plain object. Also converts values to their respective internal types." ,
547+ "@memberof " + exportName ( type ) ,
548+ "@static" ,
531549 "@param {Object.<string,*>} " + ( config . beautify ? "object" : "d" ) + " Plain object" ,
532550 "@returns {" + exportName ( type ) + "} " + type . name
533551 ] ) ;
@@ -536,6 +554,8 @@ function buildType(ref, type) {
536554 push ( "" ) ;
537555 pushComment ( [
538556 "Creates a plain object from " + aOrAn ( type . name ) + " message. Also converts values to other types if specified." ,
557+ "@memberof " + exportName ( type ) ,
558+ "@static" ,
539559 "@param {" + exportName ( type ) + "} " + ( config . beautify ? "message" : "m" ) + " " + type . name ,
540560 "@param {$protobuf.IConversionOptions} [" + ( config . beautify ? "options" : "o" ) + "] Conversion options" ,
541561 "@returns {Object.<string,*>} Plain object"
@@ -545,6 +565,8 @@ function buildType(ref, type) {
545565 push ( "" ) ;
546566 pushComment ( [
547567 "Converts this " + type . name + " to JSON." ,
568+ "@memberof " + exportName ( type ) ,
569+ "@instance" ,
548570 "@returns {Object.<string,*>} JSON object"
549571 ] ) ;
550572 push ( escapeName ( type . name ) + ".prototype.toJSON = function toJSON() {" ) ;
@@ -580,6 +602,8 @@ function buildService(ref, service) {
580602 push ( "" ) ;
581603 pushComment ( [
582604 "Creates new " + service . name + " service using the specified rpc implementation." ,
605+ "@memberof " + exportName ( service ) ,
606+ "@static" ,
583607 "@param {$protobuf.RPCImpl} rpcImpl RPC implementation" ,
584608 "@param {boolean} [requestDelimited=false] Whether requests are length-delimited" ,
585609 "@param {boolean} [responseDelimited=false] Whether responses are length-delimited" ,
@@ -609,9 +633,12 @@ function buildService(ref, service) {
609633 push ( "" ) ;
610634 pushComment ( [
611635 method . comment || "Calls " + method . name + "." ,
636+ "@memberof " + exportName ( service ) ,
637+ "@instance" ,
612638 "@param {" + exportName ( method . resolvedRequestType , ! config . forceMessage ) + "} request " + method . resolvedRequestType . name + " message or plain object" ,
613639 "@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"
615642 ] ) ;
616643 push ( escapeName ( service . name ) + ".prototype" + util . safeProp ( lcName ) + " = function " + escapeName ( lcName ) + "(request, callback) {" ) ;
617644 ++ indent ;
@@ -622,8 +649,9 @@ function buildService(ref, service) {
622649 push ( "" ) ;
623650 pushComment ( [
624651 method . comment || "Calls " + method . name + "." ,
625- "@memberof " + exportName ( service ) + ".prototype" ,
626652 "@function " + lcName ,
653+ "@memberof " + exportName ( service ) ,
654+ "@instance" ,
627655 "@param {" + exportName ( method . resolvedRequestType , ! config . forceMessage ) + "} request " + method . resolvedRequestType . name + " message or plain object" ,
628656 "@returns {Promise<" + exportName ( method . resolvedResponseType ) + ">} Promise" ,
629657 "@variation 2"
0 commit comments