Don't define functions in the prototype
If `VOID` is used, TypeScript is not able to figure out what the function parameters are.
Before:
```
$ npx tsc | wc -l
1188
```
After:
```
$ npx tsc | wc -l
1169
```
This commit is contained in:
@@ -7,7 +7,6 @@ import Observable from '../Observable.js';
|
||||
import TileState from '../TileState.js';
|
||||
import {listen} from '../events.js';
|
||||
import EventType from '../events/EventType.js';
|
||||
import {FALSE, VOID} from '../functions.js';
|
||||
import SourceState from '../source/State.js';
|
||||
|
||||
class LayerRenderer extends Observable {
|
||||
@@ -55,6 +54,18 @@ class LayerRenderer extends Observable {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {number} hitTolerance Hit tolerance in pixels.
|
||||
* @param {function(this: S, (import("../Feature.js").default|import("../render/Feature.js").default), import("../layer/Layer.js").default): T} callback Feature callback.
|
||||
* @param {S} thisArg Value to use as `this` when executing `callback`.
|
||||
* @return {T|void} Callback result.
|
||||
* @template S,T
|
||||
*/
|
||||
forEachFeatureAtCoordinate(coordinate, frameState, hitTolerance, callback) {}
|
||||
|
||||
/**
|
||||
* @return {import("../layer/Layer.js").default} Layer.
|
||||
*/
|
||||
@@ -74,6 +85,15 @@ class LayerRenderer extends Observable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @return {boolean} Is there a feature at the given coordinate?
|
||||
*/
|
||||
hasFeatureAtCoordinate(coordinate, frameState) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the image if not already loaded, and register the image change
|
||||
* listener if needed.
|
||||
@@ -218,25 +238,4 @@ class LayerRenderer extends Observable {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {number} hitTolerance Hit tolerance in pixels.
|
||||
* @param {function(this: S, (import("../Feature.js").default|import("../render/Feature.js").default), import("../layer/Layer.js").default): T} callback Feature callback.
|
||||
* @param {S} thisArg Value to use as `this` when executing `callback`.
|
||||
* @return {T|void} Callback result.
|
||||
* @template S,T
|
||||
*/
|
||||
LayerRenderer.prototype.forEachFeatureAtCoordinate = VOID;
|
||||
|
||||
|
||||
/**
|
||||
* @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @return {boolean} Is there a feature at the given coordinate?
|
||||
*/
|
||||
LayerRenderer.prototype.hasFeatureAtCoordinate = FALSE;
|
||||
|
||||
|
||||
export default LayerRenderer;
|
||||
|
||||
Reference in New Issue
Block a user