We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We should add type information to returned elements where possible using goog.dom.TagName. For example, this might look like:
goog.dom.TagName
/** * @param {!goog.dom.TagName<T>|string} tagName * @return R * @template T * @template R := cond(isUnknown(T), 'Element', T) =: */ function open(tagName) { }
This is may be more useful if we create bound element functions, where we can return the typed element in the callback. For example:
const TagName = goog.dom.TagName; const div = function(config, cb) { open(TagName.DIV); cb(currentParent()); close(TagName.DIV); }
The usage would be:
div({...}, (el) => { // compiler knows el is an HTMLDivElement });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
We should add type information to returned elements where possible using
goog.dom.TagName
. For example, this might look like:This is may be more useful if we create bound element functions, where we can return the typed element in the callback. For example:
The usage would be:
The text was updated successfully, but these errors were encountered: