Skip to content

Commit

Permalink
Add getTargetRanges() to InputEvent externs.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 676517980
  • Loading branch information
Dustyn Loyda authored and copybara-github committed Sep 19, 2024
1 parent 5d39250 commit 9fa5ddc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
22 changes: 22 additions & 0 deletions externs/browser/html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -3275,6 +3275,28 @@ BroadcastChannel.prototype.onmessage;
*/
BroadcastChannel.prototype.name;

/**
* StaticRange class.
* @constructor
* @see https://developer.mozilla.org/en-US/docs/Web/API/StaticRange
*/
function StaticRange() {}

/** @type {boolean} */
StaticRange.prototype.collapsed;

/** @type {Node} */
StaticRange.prototype.endContainer;

/** @type {number} */
StaticRange.prototype.endOffset;

/** @type {Node} */
StaticRange.prototype.startContainer;

/** @type {number} */
StaticRange.prototype.startOffset;

/**
* HTML5 DataTransfer class.
*
Expand Down
7 changes: 4 additions & 3 deletions externs/browser/w3c_event.js
Original file line number Diff line number Diff line change
Expand Up @@ -549,10 +549,9 @@ InputEventInit.prototype.inputType;
/** @type {undefined|?DataTransfer} */
InputEventInit.prototype.dataTransfer;

/** @type {undefined|function():!Array<!StaticRange>} */
InputEventInit.prototype.getTargetRanges;

// TODO(charleyroy): Add getTargetRanges() once a consensus has been made
// regarding how to structure these values. See
// https://github.com/w3c/input-events/issues/38.
/**
* @constructor
* @extends {UIEvent}
Expand All @@ -575,6 +574,8 @@ InputEvent.prototype.inputType;
/** @type {?DataTransfer} */
InputEvent.prototype.dataTransfer;

/** @type {function():!Array<!StaticRange>} */
InputEvent.prototype.getTargetRanges;

/**
* @record
Expand Down

0 comments on commit 9fa5ddc

Please sign in to comment.