Skip to content

Commit

Permalink
Adds externs for ElementInternals: states property.
Browse files Browse the repository at this point in the history
  • Loading branch information
Closure Team authored and copybara-github committed Oct 22, 2024
1 parent 8ffc89f commit 7055bf3
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions externs/browser/html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -6369,6 +6369,9 @@ ElementInternals.prototype.checkValidity =
/** @type {!NodeList<!HTMLLabelElement>} */
ElementInternals.prototype.labels;

/** @type {!CustomStateSet} */
ElementInternals.prototype.states;

/**
* @see https://html.spec.whatwg.org/multipage/custom-elements.html#the-elementinternals-interface
* @record
Expand Down Expand Up @@ -6405,6 +6408,73 @@ ValidityStateFlags.prototype.badInput;
/** @type {boolean|undefined} */
ValidityStateFlags.prototype.customError;

/**
* @see https://html.spec.whatwg.org/multipage/custom-elements.html#the-elementinternals-interface
* @constructor
*/
function CustomStateSet() {}

/**
* @param {string} value
* @return {void}
*/
CustomStateSet.prototype.add = function(value) {};

/**
* @return {void}
*/
CustomStateSet.prototype.clear = function() {};

/**
* @param {string} value
* @return {boolean}
*/
CustomStateSet.prototype.delete = function(value) {};

/**
* @return {!IteratorIterable<!Array<string>>} Where each array has two entries:
* [value, value]
* @nosideeffects
*/
CustomStateSet.prototype.entries = function() {};

/**
* @param {function(this: THIS, string, string, CustomStateSet)} callback
* @param {THIS=} opt_thisArg
* @this {THIS}
* @template THIS
*/
CustomStateSet.prototype.forEach = function(callback, opt_thisArg) {};

/**
* @param {string} value
* @return {boolean}
* @nosideeffects
*/
CustomStateSet.prototype.has = function(value) {};

/**
* @type {number} (readonly)
*/
CustomStateSet.prototype.size;

/**
* @return {!IteratorIterable<string>}
* @nosideeffects
*/
CustomStateSet.prototype.keys = function() {};

/**
* @return {!IteratorIterable<string>}
* @nosideeffects
*/
CustomStateSet.prototype.values = function() {};

/**
* @return {!Iterator<string>}
*/
CustomStateSet.prototype[Symbol.iterator] = function() {};

/**
* @see https://drafts.csswg.org/css-view-transitions/#dom-document-startviewtransition
* @param {function(): (undefined|!Promise<undefined>)} updateCallback
Expand Down

0 comments on commit 7055bf3

Please sign in to comment.