openlayers/ol3 — pull request #2773 by elemoine (2014-09-30 11:09:03+00:00)
Title: Type-related changes to ol.style.Image

This PR includes a number of type-related changes to `ol.style.Image`, `ol.style.Icon` and `ol.style.Circle`.

1. Mark `ol.style.Image` an `@api` annotation. This makes `ol.style.Image` exportable, making it possible to do `imageStyle instanceof ol.style.Image` in the application code.

2. Mark `ol.style.Image#getImage` with an `@api` annotation. This makes this method show up in the `ol-externs.js` externs file, which is necessary for application code that looks like this:

```js
/**
* @param {ol.style.Image} imageStyle Image style.
*/
function function1(imageStyle) {
var image = imageStyle.getImage();
function2(image);
}

/**
* @param {HTMLCanvasElement|HTMLVideoElement|Image} image Image element.
*/
function function2(image) {
…
}
```
We have to have the signature of `ol.style.Image#getImage` in the externs file.

3. Give `ol.style.Circle#getImage` and `ol.style.Icon#getImage` more specific return types.

Please review.