@watergis/maplibre-gl-terradraw
    Preparing search index...

    Class MemoryCache<T>

    Memory cache class

    Type Parameters

    • T

    Implements

    Index

    Constructors

    Accessors

    Methods

    • Get cache statistics.

      Returns { hitRate?: number; maxSize: number; size: number; ttl?: number }

    • set a value in the cache. If the cache size exceeds maxSize, the oldest item will be removed (FIFO). If ttl is set, the item will expire after ttl milliseconds.

      Parameters

      • key: string
      • value: T

      Returns void