Move template type at the class level

This removes the TS1092 error from TypeScript: Type parameters cannot appear on a constructor declaration.
This commit is contained in:
Frederic Junod
2018-07-19 08:36:54 +02:00
parent 8f7b52f266
commit c1ffb0a2a9
4 changed files with 27 additions and 20 deletions
+8 -6
View File
@@ -16,15 +16,17 @@ import EventType from '../events/EventType.js';
*/
/**
* Implements a Least-Recently-Used cache where the keys do not conflict with
* Object's properties (e.g. 'hasOwnProperty' is not allowed as a key). Expiring
* items from the cache is the responsibility of the user.
*
* @fires module:ol/events/Event~Event
* @template T
*/
class LRUCache extends EventTarget {
/**
* Implements a Least-Recently-Used cache where the keys do not conflict with
* Object's properties (e.g. 'hasOwnProperty' is not allowed as a key). Expiring
* items from the cache is the responsibility of the user.
*
* @fires module:ol/events/Event~Event
* @template T
* @param {number=} opt_highWaterMark High water mark.
*/
constructor(opt_highWaterMark) {