Files
polymer/externs/polymer-iconset-externs.js
Alexander Marks b8e3002162 Hybrid compatibility for PolymerDomApi and Polymer.Iconset types.
Polymer V1 applications are compiled with hand-written externs at
https://github.com/google/closure-compiler/blob/master/contrib/externs/polymer-1.0.js.
These externs contain some types that do not exist in the V2 code.

PolymerDomApi is the type returned by the V1 Polymer.dom API, but in V2
it returns Polymer.DomApi. This adds the PolymerDomApi interface to the
V2 externs, and annotates that Polymer.DomApi implements it. This allows
both V1 and V2 code to use the PolymerDomApi type. Similar story for
PolymerDomApi.ObserveCallback.

Polymer.Iconset would ideally live in the iron-iconset repo, but many
packages reference the type without actually depending on that library,
so its simpler to just include it here, similar to how it worked for
Polymer V1.
2018-10-31 14:55:54 -07:00

37 lines
1.2 KiB
JavaScript

/**
* @externs
* @fileoverview Externs for Polymer.Iconset.
*/
/**
* The interface that iconsets should obey. Iconsets are registered by setting
* their name in the IronMeta 'iconset' db, and a value of type Polymer.Iconset.
*
* Used by iron-icon but needs to live here since iron-icon, iron-iconset, etc don't
* depend on each other at all and talk only through iron-meta.
*
* @interface
*/
Polymer.Iconset = function() {};
/**
* Applies an icon to the given element as a css background image. This
* method does not size the element, and it's usually necessary to set
* the element's height and width so that the background image is visible.
*
* @param {Element} element The element to which the icon is applied.
* @param {string} icon The name of the icon to apply.
* @param {string=} theme (optional) The name or index of the icon to apply.
* @param {number=} scale (optional, defaults to 1) Icon scaling factor.
*/
Polymer.Iconset.prototype.applyIcon = function(
element, icon, theme, scale) {};
/**
* Remove an icon from the given element by undoing the changes effected
* by `applyIcon`.
*
* @param {Element} element The element from which the icon is removed.
*/
Polymer.Iconset.prototype.removeIcon = function(element) {};