Add @constructor to all Function classes
Change-Id: I67b90a91b57fbd66363551eafe0cdfc14d5f68e8
This commit is contained in:
@@ -23,11 +23,11 @@
|
||||
* Construct a change comments object, which can be data-bound to child
|
||||
* elements of that which uses the gr-comment-api.
|
||||
*
|
||||
* @constructor
|
||||
* @param {!Object} comments
|
||||
* @param {!Object} robotComments
|
||||
* @param {!Object} drafts
|
||||
* @param {number} changeNum
|
||||
* @constructor
|
||||
*/
|
||||
function ChangeComments(comments, robotComments, drafts, changeNum) {
|
||||
this._comments = comments;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
// Prevent redefinition.
|
||||
if (window.GrDiffBuilderBinary) { return; }
|
||||
|
||||
/** @constructor */
|
||||
function GrDiffBuilderBinary(diff, prefs, outputEl) {
|
||||
GrDiffBuilder.call(this, diff, prefs, outputEl);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
// arbitrary JavaScript.
|
||||
const IMAGE_MIME_PATTERN = /^image\/(bmp|gif|x-icon|jpeg|jpg|png|tiff|webp)$/;
|
||||
|
||||
/** @constructor */
|
||||
function GrDiffBuilderImage(diff, prefs, outputEl, baseImage, revisionImage) {
|
||||
GrDiffBuilderSideBySide.call(this, diff, prefs, outputEl, []);
|
||||
this._baseImage = baseImage;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
// Prevent redefinition.
|
||||
if (window.GrDiffBuilderSideBySide) { return; }
|
||||
|
||||
/** @constructor */
|
||||
function GrDiffBuilderSideBySide(diff, prefs, outputEl, layers) {
|
||||
GrDiffBuilder.call(this, diff, prefs, outputEl, layers);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
(function(window, GrDiffLine) {
|
||||
(function(window) {
|
||||
'use strict';
|
||||
|
||||
// Prevent redefinition.
|
||||
@@ -23,6 +23,7 @@
|
||||
/**
|
||||
* A chunk of the diff that should be rendered together.
|
||||
*
|
||||
* @constructor
|
||||
* @param {!GrDiffGroup.Type} type
|
||||
* @param {!Array<!GrDiffLine>=} opt_lines
|
||||
*/
|
||||
@@ -285,4 +286,4 @@
|
||||
};
|
||||
|
||||
window.GrDiffGroup = GrDiffGroup;
|
||||
})(window, GrDiffLine);
|
||||
})(window);
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
if (window.GrDiffLine) { return; }
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {GrDiffLine.Type} type
|
||||
* @param {number|string=} opt_beforeLine
|
||||
* @param {number|string=} opt_afterLine
|
||||
@@ -46,6 +47,7 @@
|
||||
this.text = '';
|
||||
}
|
||||
|
||||
/** @enum {string} */
|
||||
GrDiffLine.Type = {
|
||||
ADD: 'add',
|
||||
BOTH: 'both',
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
// Prevent redefinition.
|
||||
if (window.GrAdminApi) { return; }
|
||||
|
||||
/** @constructor */
|
||||
function GrAdminApi(plugin) {
|
||||
this.plugin = plugin;
|
||||
plugin.on('admin-menu-links', this);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
(function(window) {
|
||||
'use strict';
|
||||
|
||||
/** @constructor */
|
||||
function GrAttributeHelper(element) {
|
||||
this.element = element;
|
||||
this._promises = {};
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
(function(window) {
|
||||
'use strict';
|
||||
|
||||
/** @constructor */
|
||||
function GrChangeMetadataApi(plugin) {
|
||||
this._hook = null;
|
||||
this.plugin = plugin;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
(function(window) {
|
||||
'use strict';
|
||||
|
||||
/** @constructor */
|
||||
function GrDomHooksManager(plugin) {
|
||||
this._plugin = plugin;
|
||||
this._hooks = {};
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
(function(window) {
|
||||
'use strict';
|
||||
|
||||
/** @constructor */
|
||||
function GrEventHelper(element) {
|
||||
this.element = element;
|
||||
this._unsubscribers = [];
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
* opt_moduleName is a name of custom element that will be automatically
|
||||
* inserted on popup opening.
|
||||
*
|
||||
* @constructor
|
||||
* @param {!Object} plugin
|
||||
* @param {opt_moduleName=} string
|
||||
*/
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
// Prevent redefinition.
|
||||
if (window.GrRepoApi) { return; }
|
||||
|
||||
/** @constructor */
|
||||
function GrRepoApi(plugin) {
|
||||
this._hook = null;
|
||||
this.plugin = plugin;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
(function(window) {
|
||||
'use strict';
|
||||
|
||||
/** @constructor */
|
||||
function GrSettingsApi(plugin) {
|
||||
this._title = '(no title)';
|
||||
// Generate default screen URL token, specific to plugin, and unique(ish).
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
let styleObjectCount = 0;
|
||||
|
||||
/** @constructor */
|
||||
function GrStyleObject(rulesStr) {
|
||||
this._rulesStr = rulesStr;
|
||||
this._className = `__pg_js_api_class_${styleObjectCount}`;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
// Prevent redefinition.
|
||||
if (window.GrThemeApi) { return; }
|
||||
|
||||
/** @constructor */
|
||||
function GrThemeApi(plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
(function(window) {
|
||||
'use strict';
|
||||
|
||||
/** @constructor */
|
||||
function GrAnnotationActionsInterface(plugin) {
|
||||
this.plugin = plugin;
|
||||
// Return this instance when there is an annotatediff event.
|
||||
@@ -168,6 +169,7 @@
|
||||
/**
|
||||
* Used to create an instance of the Annotation Layer interface.
|
||||
*
|
||||
* @constructor
|
||||
* @param {String} path The file path (eg: /COMMIT_MSG').
|
||||
* @param {String} changeNum The Gerrit change number.
|
||||
* @param {String} patchNum The Gerrit patch number.
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @constructor
|
||||
*/
|
||||
function GrChangeReplyInterfaceOld(el) {
|
||||
this._el = el;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
(function(window) {
|
||||
'use strict';
|
||||
|
||||
/** @constructor */
|
||||
function GrPluginEndpoints() {
|
||||
this._endpoints = {};
|
||||
this._callbacks = {};
|
||||
|
||||
@@ -45,13 +45,17 @@
|
||||
STYLE: 'style',
|
||||
};
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {string=} opt_url
|
||||
*/
|
||||
function Plugin(opt_url) {
|
||||
this._domHooks = new GrDomHooksManager(this);
|
||||
|
||||
if (!opt_url) {
|
||||
console.warn('Plugin not being loaded from /plugins base path.',
|
||||
'Unable to determine name.');
|
||||
return;
|
||||
return this;
|
||||
}
|
||||
this.deprecated = {
|
||||
_loadedGwt: deprecatedAPI._loadedGwt.bind(this),
|
||||
@@ -226,7 +230,7 @@
|
||||
* @example
|
||||
* const pluginRestApi = plugin.restApi(plugin.url());
|
||||
*
|
||||
* @param {string} Base url for subsequent .get(), .post() etc requests.
|
||||
* @param {string=} opt_prefix url for subsequent .get(), .post() etc requests.
|
||||
*/
|
||||
Plugin.prototype.restApi = function(opt_prefix) {
|
||||
return new GrPluginRestApi(opt_prefix);
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
* in the text as well as custom links if any are specified in the linkConfig
|
||||
* parameter.
|
||||
*
|
||||
* @constructor
|
||||
* @param {Object|null|undefined} linkConfig Comment links as specified by the
|
||||
* commentlinks field on a project config.
|
||||
* @param {Function} callback The callback to be fired when an intermediate
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
// Limit cache size because /change/detail responses may be large.
|
||||
const MAX_CACHE_SIZE = 30;
|
||||
|
||||
/** @constructor */
|
||||
function GrEtagDecorator() {
|
||||
this._etags = new Map();
|
||||
this._payloadCache = new Map();
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
// Prevent redefinition.
|
||||
if (window.GrReviewerUpdatesParser) { return; }
|
||||
|
||||
/** @constructor */
|
||||
function GrReviewerUpdatesParser(change) {
|
||||
this.result = Object.assign({}, change);
|
||||
this._lastState = {};
|
||||
|
||||
@@ -20,6 +20,7 @@ limitations under the License.
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {Object} change A change object resulting from a change detail
|
||||
* call that includes revision information.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user