Skip to content

Commit

Permalink
more jsdoc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
or-else committed Mar 21, 2023
1 parent 949b370 commit 0aea4c1
Showing 1 changed file with 13 additions and 29 deletions.
42 changes: 13 additions & 29 deletions src/topic.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,20 @@ import {
normalizeArray
} from './utils.js';

/**
* Topic is a class representing a logical communication channel.
*/
export class Topic {
/**
* @callback Tinode.Topic.onData
* @callback onData
* @param {Data} data - Data packet
*/

/**
* Topic is a class representing a logical communication channel.
* @class Topic
* @memberof Tinode
*
* Create topic.
* @param {string} name - Name of the topic to create.
* @param {Object=} callbacks - Object with various event callbacks.
* @param {Tinode.Topic.onData} callbacks.onData - Callback which receives a <code>{data}</code> message.
* @param {onData} callbacks.onData - Callback which receives a <code>{data}</code> message.
* @param {callback} callbacks.onMeta - Callback which receives a <code>{meta}</code> message.
* @param {callback} callbacks.onPres - Callback which receives a <code>{pres}</code> message.
* @param {callback} callbacks.onInfo - Callback which receives an <code>{info}</code> message.
Expand Down Expand Up @@ -127,8 +128,6 @@ export class Topic {

/**
* Determine topic type from topic's name: grp, p2p, me, fnd, sys.
* @memberof Tinode.Topic#
* @static
*
* @param {string} name - Name of the topic to test.
* @returns {string} One of <code>"me"</code>, <code>"fnd"</code>, <code>"sys"</code>, <code>"grp"</code>,
Expand All @@ -150,8 +149,6 @@ export class Topic {

/**
* Check if the given topic name is a name of a 'me' topic.
* @memberof Tinode.Topic#
* @static
*
* @param {string} name - Name of the topic to test.
* @returns {boolean} <code>true</code> if the name is a name of a 'me' topic, <code>false</code> otherwise.
Expand All @@ -162,7 +159,6 @@ export class Topic {

/**
* Check if the given topic name is a name of a group topic.
* @memberof Tinode.Topic#
* @static
*
* @param {string} name - Name of the topic to test.
Expand All @@ -174,7 +170,6 @@ export class Topic {

/**
* Check if the given topic name is a name of a p2p topic.
* @memberof Tinode.Topic#
* @static
*
* @param {string} name - Name of the topic to test.
Expand All @@ -186,7 +181,6 @@ export class Topic {

/**
* Check if the given topic name is a name of a communication topic, i.e. P2P or group.
* @memberof Tinode.Topic#
* @static
*
* @param {string} name - Name of the topic to test.
Expand All @@ -198,7 +192,6 @@ export class Topic {

/**
* Check if the topic name is a name of a new topic.
* @memberof Tinode.Topic#
* @static
*
* @param {string} name - topic name to check.
Expand All @@ -211,7 +204,6 @@ export class Topic {

/**
* Check if the topic name is a name of a channel.
* @memberof Tinode.Topic#
* @static
*
* @param {string} name - topic name to check.
Expand All @@ -224,7 +216,6 @@ export class Topic {

/**
* Check if the topic is subscribed.
* @memberof Tinode.Topic#
* @returns {boolean} True is topic is attached/subscribed, false otherwise.
*/
isSubscribed() {
Expand All @@ -233,7 +224,6 @@ export class Topic {

/**
* Request topic to subscribe. Wrapper for {@link Tinode#subscribe}.
* @memberof Tinode.Topic#
*
* @param {Tinode.GetQuery=} getParams - get query parameters.
* @param {Tinode.SetParams=} setParams - set parameters.
Expand Down Expand Up @@ -1928,14 +1918,6 @@ export class Topic {
}
}

/**
* @class TopicMe - special case of {@link Tinode.Topic} for
* managing data of the current user, including contact list.
* @extends Tinode.Topic
* @memberof Tinode
*
* @param {TopicMe.Callbacks} callbacks - Callbacks to receive various events.
*/
/**
* @class TopicMe - special case of {@link Tinode.Topic} for
* managing data of the current user, including contact list.
Expand Down Expand Up @@ -2332,17 +2314,19 @@ export class TopicMe extends Topic {
}

/**
* @class TopicFnd - special case of {@link Tinode.Topic} for searching for
* contacts and group topics.
* Special case of {@link Tinode.Topic} for searching for contacts and group topics
* @extends Tinode.Topic
* @memberof Tinode
*
* @param {TopicFnd.Callbacks} callbacks - Callbacks to receive various events.
*/
export class TopicFnd extends Topic {
// List of users and topics uid or topic_name -> Contact object)
_contacts = {};

/**
* Create TopicFnd.
*
* @param {TopicFnd.Callbacks} callbacks - Callbacks to receive various events.
*/
constructor(callbacks) {
super(Const.TOPIC_FND, callbacks);
}
Expand Down

0 comments on commit 0aea4c1

Please sign in to comment.