Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
Improve type-checking for DragDrop
Browse files Browse the repository at this point in the history
RELNOTES: n/a

PiperOrigin-RevId: 560726180
Change-Id: Ibcde43f2fed173ce3f4b3b10f4a41d2f0be97f51
  • Loading branch information
Closure Team authored and copybara-github committed Aug 28, 2023
1 parent 9cadc89 commit 3148983
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions closure/goog/fx/abstractdragdrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -1323,9 +1323,10 @@ goog.inherits(goog.fx.DragDropEvent, goog.events.Event);
*
* @param {Element|string} element Dom Node, or string representation of node
* id, to be used as drag source/drop target.
* @param {Object=} opt_data Data associated with the source/target.
* @param {DRAG_DROP_DATA=} opt_data Data associated with the source/target.
* @throws Error If no element argument is provided or if the type is invalid
* @extends {goog.events.EventTarget}
* @template DRAG_DROP_DATA
* @constructor
* @struct
*/
Expand All @@ -1341,7 +1342,7 @@ goog.fx.DragDropItem = function(element, opt_data) {

/**
* Data associated with element.
* @type {Object|undefined}
* @type {DRAG_DROP_DATA|undefined}
*/
this.data = opt_data;

Expand Down Expand Up @@ -1379,7 +1380,7 @@ goog.inherits(goog.fx.DragDropItem, goog.events.EventTarget);

/**
* Get the data associated with the source/target.
* @return {Object|null|undefined} Data associated with the source/target.
* @return {DRAG_DROP_DATA|undefined} Data associated with the source/target.
*/
goog.fx.DragDropItem.prototype.getData = function() {
'use strict';
Expand Down
3 changes: 2 additions & 1 deletion closure/goog/fx/dragdrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ goog.require('goog.fx.DragDropItem');
*
* @param {Element|string} element Dom Node, or string representation of node
* id, to be used as drag source/drop target.
* @param {Object=} opt_data Data associated with the source/target.
* @param {DRAG_DROP_DATA=} opt_data Data associated with the source/target.
* @throws Error If no element argument is provided or if the type is invalid
* @extends {goog.fx.AbstractDragDrop}
* @template DRAG_DROP_DATA
* @constructor
* @struct
*/
Expand Down
3 changes: 2 additions & 1 deletion closure/goog/fx/dragdropgroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ goog.inherits(goog.fx.DragDropGroup, goog.fx.AbstractDragDrop);
*
* @param {Element|string} element Dom Node, or string representation of node
* id, to be used as drag source/drop target.
* @param {Object=} opt_data Data associated with the source/target.
* @param {DRAG_DROP_DATA=} opt_data Data associated with the source/target.
* @throws Error If no element argument is provided or if the type is
* invalid
* @template DRAG_DROP_DATA
* @override
*/
goog.fx.DragDropGroup.prototype.addItem = function(element, opt_data) {
Expand Down

0 comments on commit 3148983

Please sign in to comment.