Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Cache<Item>

Type parameters

  • Item = unknown

Hierarchy

  • Cache

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

Static defaultOptions

defaultOptions: CacheOptions = ...

Accessors

capacity

  • get capacity(): number

empty

  • get empty(): boolean

full

  • get full(): boolean

now

  • get now(): number

percent

  • get percent(): number

size

  • get size(): number

Methods

clear

  • clear(): void

delete

  • delete(key: string): void
  • Parameters

    • key: string

    Returns void

get

  • get<GetItem>(key: string): GetItem
  • Type parameters

    • GetItem

    Parameters

    • key: string

    Returns GetItem

has

  • has(key: string): boolean
  • Parameters

    • key: string

    Returns boolean

prune

  • prune(amount?: number): void
  • Parameters

    • amount: number = 1

    Returns void

set

  • set(key: string, value: Item, ttl?: number): CacheData<Item>
  • Parameters

    • key: string
    • value: Item
    • Optional ttl: number

    Returns CacheData<Item>

Generated using TypeDoc