Merge pull request #12416 from ahocevar/eventtype-generics

Use generics to limit event types in on(), once() and un()
This commit is contained in:
Andreas Hocevar
2021-06-21 09:36:25 +02:00
committed by GitHub
30 changed files with 49 additions and 7 deletions

View File

@@ -76,6 +76,7 @@ export class ImageSourceEvent extends Event {
* Base class for sources providing a single image.
* @abstract
* @fires module:ol/source/Image.ImageSourceEvent
* @extends Source<'imageloadend'|'imageloaderror'|'imageloadstart'>
* @api
*/
class ImageSource extends Source {

View File

@@ -40,6 +40,8 @@ import {get as getProjection} from '../proj.js';
* Base class for {@link module:ol/layer/Layer~Layer} sources.
*
* A generic `change` event is triggered when the state of the source changes.
* @template {string} EventTypes
* @extends BaseObject<EventTypes>
* @abstract
* @api
*/

View File

@@ -36,6 +36,8 @@ import {scale as scaleSize, toSize} from '../size.js';
* Abstract base class; normally only used for creating subclasses and not
* instantiated in apps.
* Base class for sources providing images divided into a tile grid.
* @template {string} EventTypes
* @extends Source<EventTypes>
* @abstract
* @api
*/

View File

@@ -33,6 +33,7 @@ import {getUid} from '../util.js';
* Base class for sources providing tiles divided into a tile grid over http.
*
* @fires import("./Tile.js").TileSourceEvent
* @extends TileSource<'tileloadend'|'tileloaderror'|'tileloadstart'>
*/
class UrlTile extends TileSource {
/**