@luolapeikko/cache-types
    Preparing search index...

    Type Alias CacheEventsMap<Payload, Key>

    Cache events map.

    class MyCache extends EventEmitter<CacheEventsMap<{name: string}>> {}
    

    v0.0.7

    type CacheEventsMap<Payload, Key = string> = {
        clear: [Map<Key, Payload>];
        delete: [key: Key];
        expires: [key: Key, payload: Payload];
        get: [key: Key];
        has: [key: Key];
        set: [key: Key, payload: Payload, expires: Date | undefined];
    }

    Type Parameters

    • Payload

      The type of the cached value

    • Key = string

      Optional type of the cache key (default is string)

    Index

    Properties

    clear: [Map<Key, Payload>]
    delete: [key: Key]
    expires: [key: Key, payload: Payload]
    get: [key: Key]
    has: [key: Key]
    set: [key: Key, payload: Payload, expires: Date | undefined]