mediawiki-extensions-Discus.../modules/ThreadItem.js
Ed Sanders d5376e28fc Improve ThreadItem documentation
Change-Id: Ia266fc22b02af0edbb32f356b4e0d92fe3a4da5f
2020-06-26 14:56:19 +02:00

36 lines
979 B
JavaScript

/**
* @external CommentItem
*/
/**
* A thread item, either a heading or a comment
*
* @class ThreadItem
* @constructor
* @param {string} type `heading` or `comment`
* @param {number} level Item level in the thread tree
* @param {Object} range Object describing the extent of the comment, including the
* signature and timestamp. It has the same properties as a Range object: `startContainer`,
* `startOffset`, `endContainer`, `endOffset` (we don't use a real Range because they change
* magically when the DOM structure changes).
*/
function ThreadItem( type, level, range ) {
this.type = type;
this.level = level;
this.range = range;
/**
* @member {string} Unique ID (within the page) for this comment, intended to be used to
* find this comment in other revisions of the same page
*/
this.id = null;
/**
* @member {CommentItem[]} Replies to this thread item
*/
this.replies = [];
}
OO.initClass( ThreadItem );
module.exports = ThreadItem;