# @types/lscache

> TypeScript definitions for lscache

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

## Install

```sh
npm install @types/lscache
pnpm add @types/lscache
yarn add @types/lscache
bun add @types/lscache
```

## 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 | 1.3.4 |
| Published | 2023-11-07 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51439 |
| Maintainers | types |

## Links

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

## Recent versions

- 1.3.4 (latest) — 2023-11-07
- 1.3.2 (ts4.3) — 2023-08-30
- 1.3.1 (ts3.8) — 2021-12-24
- 1.3.0 (ts2.0) — 2019-08-07
- 1.3.3 — 2023-10-18
- 1.0.29 — 2016-11-01
- 1.0.28 — 2016-09-19
- 1.0.27 — 2016-07-14
- 1.0.26-alpha — 2016-07-08
- 1.0.25-alpha — 2016-07-04
- 1.0.24-alpha — 2016-07-02
- 1.0.23-alpha — 2016-07-01
- 1.0.22-alpha — 2016-07-01
- 1.0.21-alpha — 2016-05-25
- 1.0.20-alpha — 2016-05-20
- … 2 more at https://npm.io/package/@types/lscache/versions

## README

# Installation
> `npm install --save @types/lscache`

# Summary
This package contains type definitions for lscache (https://github.com/pamelafox/lscache).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lscache.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lscache/index.d.ts)
````ts
interface LSCache {
    /**
     * Stores the value in localStorage. Expires after specified number of minutes.
     * @param {string} key
     * @param {Object|string} value
     * @param {number} time
     * @return true if the value was inserted successfully
     */
    set(key: string, value: any, time?: number): boolean;
    /**
     * Retrieves specified value from localStorage, if not expired.
     * @param {string} key
     * @return {string|Object}
     */
    get(key: string): any;
    /**
     * Removes a value from localStorage.
     * Equivalent to 'delete' in memcache, but that's a keyword in JS.
     * @param {string} key
     */
    remove(key: string): void;
    /**
     * Returns whether local storage is supported.
     * Currently exposed for testing purposes.
     * @return {boolean}
     */
    supported(): boolean;
    /**
     * Flushes all lscache items and expiry markers without affecting rest of localStorage
     */
    flush(): void;
    /**
     * Flushes expired lscache items and expiry markers without affecting rest of localStorage
     */
    flushExpired(): void;
    /**
     * Appends CACHE_PREFIX so lscache will partition data in to different buckets.
     * @param {string} bucket
     */
    setBucket(bucket: string): void;
    /**
     * Resets the string being appended to CACHE_PREFIX so lscache will use the default storage behavior.
     */
    resetBucket(): void;
    /**
     * @returns {number} The currently set number of milliseconds each time unit represents in
     *   the set() function's "time" argument.
     */
    getExpiryMilliseconds(): number;
    /**
     * Sets the number of milliseconds each time unit represents in the set() function's
     *   "time" argument.
     * Sample values:
     *  1: each time unit = 1 millisecond
     *  1000: each time unit = 1 second
     *  60000: each time unit = 1 minute (Default value)
     *  360000: each time unit = 1 hour
     * @param {number} milliseconds
     */
    setExpiryMilliseconds(milliseconds: number): void;
    /**
     * Sets whether to display warnings when an item is removed from the cache or not.
     */
    enableWarnings(enabled: boolean): void;
}
declare var lscache: LSCache;
declare module "lscache" {
    var lscache: LSCache;
    export = lscache;
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: none

# Credits
These definitions were written by [c-py](https://github.com/c-py).

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