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

    Interface CacheInterface<T>

    Cache interface

    interface CacheInterface<T> {
        size: number;
        clear(): void;
        delete(key: string): boolean;
        get(key: string): undefined | T;
        has(key: string): boolean;
        set(key: string, value: T): void;
    }

    Type Parameters

    • T

    Implemented by

    Index

    Properties

    Methods

    Properties

    size: number

    Get the current size of the cache.

    Methods

    • Get a value from the cache. If the item has expired, it will be removed from the cache.

      Parameters

      • key: string

      Returns undefined | T

    • 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