# @types/stale-lru-cache

> TypeScript definitions for stale-lru-cache

Latest version **5.1.6** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/stale-lru-cache
pnpm add @types/stale-lru-cache
yarn add @types/stale-lru-cache
bun add @types/stale-lru-cache
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 5.1.6 |
| Published | 2023-11-07 |
| First published | 2017-05-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51438 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/stale-lru-cache
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/stale-lru-cache
- npm.io page: https://npm.io/package/@types/stale-lru-cache

## Recent versions

- 5.1.6 (latest) — 2023-11-07
- 5.1.3 (ts3.6) — 2021-07-02
- 5.1.2 (ts2.0) — 2017-08-21
- 5.1.5 — 2023-10-18
- 5.1.4 — 2023-09-25
- 5.1.1 — 2017-06-09
- 5.1.0 — 2017-05-19

## README

# Installation
> `npm install --save @types/stale-lru-cache`

# Summary
This package contains type definitions for stale-lru-cache (https://github.com/cyberthom/stale-lru-cache).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/stale-lru-cache.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/stale-lru-cache/index.d.ts)
````ts
declare class Cache<K, V> {
    constructor(options?: Cache.CacheOptions<K, V>);
    delete(key: K): boolean;
    get(key: K): V | undefined;
    set(key: K, value: V, options?: string | Cache.SetOptions<K, V>): boolean;
    has(key: K): boolean;
    isStale(key: K): boolean;
    keys(): K[];
    reset(): void;
    size(): number;
    values(): V[];
    wrap(
        key: K,
        revalidate: Cache.RevalidationCallback<K, V>,
        callback: Cache.OptionsCallback<K, V>,
    ): void;
}

declare namespace Cache {
    type OptionsCallback<K, V> = (error: any, value?: V, options?: string | SetOptions<K, V>) => void;
    type RevalidationCallback<K, V> = (key: K, callback: OptionsCallback<K, V>) => void;

    interface CacheOptions<K, V> {
        maxAge?: number | undefined;
        staleWhileRevalidate?: number | undefined;
        revalidate?: RevalidationCallback<K, V> | undefined;
        maxSize?: number | undefined;
        getSize?(value: V, key: K): number;
    }

    interface SetOptions<K, V> {
        maxAge?: number | undefined;
        staleWhileRevalidate?: number | undefined;
        revalidate?: RevalidationCallback<K, V> | undefined;
    }
}

export = Cache;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: none

# Credits
These definitions were written by [Joona Heikkilä](https://github.com/cxcorp).

---
_Source: https://npm.io/package/@types/stale-lru-cache · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
