Improve layer typings

This commit is contained in:
Simon Seyock
2021-01-26 15:49:39 +01:00
parent 125d0d62a8
commit 419578a96c
9 changed files with 16 additions and 3 deletions

View File

@@ -37,7 +37,8 @@ import Layer from './Layer.js';
* property on the layer object; for example, setting `title: 'My Title'` in the
* options means that `title` is observable, and has get/set accessors.
*
* @extends {Layer<import("../source/Image.js").default>}
* @template {import("../source/Image.js").default} ImageSourceType
* @extends {Layer<ImageSourceType>}
* @api
*/
class BaseImageLayer extends Layer {

View File

@@ -42,7 +42,8 @@ import {assign} from '../obj.js';
* property on the layer object; for example, setting `title: 'My Title'` in the
* options means that `title` is observable, and has get/set accessors.
*
* @extends {Layer<import("../source/Tile.js").default>}
* @template {import("../source/Tile.js").default} TileSourceType
* @extends {Layer<TileSourceType>}
* @api
*/
class BaseTileLayer extends Layer {

View File

@@ -172,6 +172,7 @@ const INTERVALS = [
* Note that the view projection must define both extent and worldExtent.
*
* @fires import("../render/Event.js").RenderEvent
* @extends {VectorLayer<import("../source/Vector.js").default>}
* @api
*/
class Graticule extends VectorLayer {

View File

@@ -61,6 +61,7 @@ const DEFAULT_GRADIENT = ['#00f', '#0ff', '#0f0', '#ff0', '#f00'];
* options means that `title` is observable, and has get/set accessors.
*
* @fires import("../render/Event.js").RenderEvent
* @extends {VectorLayer<import("../source/Vector.js").default>}
* @api
*/
class Heatmap extends VectorLayer {

View File

@@ -12,6 +12,8 @@ import CanvasImageLayerRenderer from '../renderer/canvas/ImageLayer.js';
* property on the layer object; for example, setting `title: 'My Title'` in the
* options means that `title` is observable, and has get/set accessors.
*
* @template {import("../source/Image.js").default} ImageSourceType
* @extends {BaseImageLayer<ImageSourceType>}
* @api
*/
class ImageLayer extends BaseImageLayer {

View File

@@ -12,6 +12,8 @@ import CanvasTileLayerRenderer from '../renderer/canvas/TileLayer.js';
* property on the layer object; for example, setting `title: 'My Title'` in the
* options means that `title` is observable, and has get/set accessors.
*
* @template {import("../source/Tile.js").default} TileSourceType
* @extends {BaseTileLayer<TileSourceType>}
* @api
*/
class TileLayer extends BaseTileLayer {

View File

@@ -11,7 +11,8 @@ import CanvasVectorLayerRenderer from '../renderer/canvas/VectorLayer.js';
* property on the layer object; for example, setting `title: 'My Title'` in the
* options means that `title` is observable, and has get/set accessors.
*
* @extends {BaseVectorLayer<import("../source/Vector.js").default>}
* @template {import("../source/Vector.js").default} VectorSourceType
* @extends {BaseVectorLayer<VectorSourceType>}
* @api
*/
class VectorLayer extends BaseVectorLayer {

View File

@@ -51,6 +51,8 @@ import {assign} from '../obj.js';
* property on the layer object; for example, setting `title: 'My Title'` in the
* options means that `title` is observable, and has get/set accessors.
*
* @template {import("../source/Vector.js").default} VectorSourceType
* @extends {BaseVectorLayer<VectorSourceType>}
* @api
*/
class VectorImageLayer extends BaseVectorLayer {

View File

@@ -66,6 +66,8 @@ import {parseLiteralStyle} from '../webgl/ShaderBuilder.js';
* property on the layer object; for example, setting `title: 'My Title'` in the
* options means that `title` is observable, and has get/set accessors.
*
* @template {import("../source/Vector.js").default} VectorSourceType
* @extends {Layer<VectorSourceType>}
* @fires import("../render/Event.js").RenderEvent
*/
class WebGLPointsLayer extends Layer {