# @types/gulp-cache

> TypeScript definitions for gulp-cache

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

## Install

```sh
npm install @types/gulp-cache
pnpm add @types/gulp-cache
yarn add @types/gulp-cache
bun add @types/gulp-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; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.4.9 |
| Published | 2023-11-07 |
| First published | 2016-10-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51442 |
| Maintainers | types |

## Links

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

## Dependencies (3)

- [@types/node](https://npm.io/package/@types/node.md) *
- [@types/vinyl](https://npm.io/package/@types/vinyl.md) *
- [@types/gulp-util](https://npm.io/package/@types/gulp-util.md) *

## Recent versions

- 0.4.9 (latest) — 2023-11-07
- 0.4.6 (ts4.3) — 2023-05-10
- 0.4.5 (ts3.6) — 2021-07-08
- 0.4.4 (ts2.0) — 2017-11-08
- 0.4.8 — 2023-10-18
- 0.4.7 — 2023-09-20
- 0.4.3 — 2017-03-16
- 0.4.2 — 2016-11-04
- 0.4.1 — 2016-10-26

## README

# Installation
> `npm install --save @types/gulp-cache`

# Summary
This package contains type definitions for gulp-cache (https://github.com/jgable/gulp-cache).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gulp-cache.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gulp-cache/index.d.ts)
````ts
/// <reference types="node" />

import File = require("vinyl");
import { PluginError } from "gulp-util";
import { Transform } from "stream";

declare namespace gc {
    type Predicate<T> = (arg: T) => boolean;

    interface IGulpCacheOptions {
        /**
         * The cache instance to use for caching.
         */
        fileCache?: IGulpCache | undefined;

        /**
         * The name of the bucket which stores the cached objects.
         * Default value = 'default'
         */
        name?: string | undefined;

        /**
         * The hash generator to use.
         */
        key?: ((file: File, callback?: (err: any, result: string) => void) => string | Promise<string>) | undefined;

        /**
         * Value representing the success of a task.
         */
        success?: boolean | Predicate<any> | undefined;

        /**
         * Content that is to be cached.
         */
        value?: ((result: any) => Object | Promise<Object> | string) | undefined;
    }

    interface ICacheOptions {
        /**
         * Specifies the name of the directory where the cache
         * is to be stored.
         */
        cacheDirName: string;
    }

    interface IGulpCacheStatic {
        /**
         * Caches the result of a task.
         * @param task The task whose result is to be cached.
         */
        (task: NodeJS.ReadWriteStream): Transform;

        /**
         * Caches the result of a task.
         * @param task Task whose result is to be cached.
         * @param options Override values for available settings.
         */
        (task: NodeJS.ReadWriteStream, options: IGulpCacheOptions): Transform;

        clear(options: IGulpCacheOptions): Transform;

        /**
         * Represents a cache store.
         */
        Cache: IGulpCache;

        /**
         * Purges the cache.
         * @param err PluginError instance in case of a plugin error.
         *            If callback is not specified an exception of type
         *            'PluginError' is thrown.
         */
        clearAll(callback?: (err: PluginError) => void): void;
    }

    /**
     * Represents a cach store.
     */
    interface IGulpCache {
        new(options: ICacheOptions): any;
    }
}

declare const _: gc.IGulpCacheStatic;
export = _;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 03:09:37 GMT
 * Dependencies: [@types/gulp-util](https://npmjs.com/package/@types/gulp-util), [@types/node](https://npmjs.com/package/@types/node), [@types/vinyl](https://npmjs.com/package/@types/vinyl)

# Credits
These definitions were written by [Arun Aravind](https://github.com/aravindarun).

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