Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

AgedCompareFunc

AgedCompareFunc: (ageA: number, ageB: number) => number

Type declaration

    • (ageA: number, ageB: number): number
    • Parameters

      • ageA: number

        The first age to compare

      • ageB: number

        The second age to compare

      Returns number

      0 if same order, positive if ageA after ageB, negative if ageA before ageB

DeserializeFunction

DeserializeFunction<T>: (data: string) => T

Type parameters

  • T

Type declaration

    • (data: string): T
    • Parameters

      • data: string

        The data to convert

      Returns T

      The input data as an object

SerializeFunction

SerializeFunction<T>: (data: T) => string

Type parameters

  • T

Type declaration

    • (data: T): string
    • Parameters

      • data: T

        The data to convert

      Returns string

      The input data as a string

StorageProviderUpdateHandler

StorageProviderUpdateHandler<TKey, TValue>: (key: TKey, value?: IAgedValue<TValue>) => void

Type parameters

  • TKey

  • TValue

Type declaration

    • A function to execute when a IStorageProvider key/value changes. Used with subscribe/unsubscribe

      Parameters

      • key: TKey

        The key that was set/delete

      • Optional value: IAgedValue<TValue>

        The value that was set or undefined if it was a delete

      Returns void

Functions

createAgingCache

  • Create a new instance of IAgingCache. This function is a factory that will construct the corrent implementation based on the provided options.

    Type parameters

    • TKey

    • TValue

    Parameters

    • hierarchy: IStorageHierarchy<TKey, TValue>

      The storage hierarchy with the level index 0 being the lowest level

    • Optional options: IAgingCacheOptions

      Options for the behavior of the cache, if undefined use getDefaultAgingCacheOptions

    Returns IAgingCache<TKey, TValue>

getDefaultAgingCacheOptions

Generated using TypeDoc