mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-03-29 17:08:21 +08:00
Add type definitions for gulp-cached
This commit is contained in:
21
gulp-cached/gulp-cached-tests.ts
Normal file
21
gulp-cached/gulp-cached-tests.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/// <reference path="../gulp/gulp.d.ts" />
|
||||
/// <reference path="./gulp-cached.d.ts" />
|
||||
|
||||
import * as gulp from "gulp";
|
||||
import cached = require("gulp-cached");
|
||||
|
||||
// Usage
|
||||
gulp.src("*.ts")
|
||||
.pipe(cached("ts-cache"));
|
||||
|
||||
gulp.src("*.ts")
|
||||
.pipe(cached("ts-cache", {}));
|
||||
|
||||
gulp.src("*.ts")
|
||||
.pipe(cached("ts-cache", { optimizeMemory: true }));
|
||||
|
||||
// Clearing the whole cache
|
||||
cached.caches = {};
|
||||
|
||||
// Clearing a specific cache entry
|
||||
delete cached.caches["ts-cache"];
|
||||
39
gulp-cached/gulp-cached.d.ts
vendored
Normal file
39
gulp-cached/gulp-cached.d.ts
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
// Type definitions for gulp-cached
|
||||
// Project: https://github.com/wearefractal/gulp-cached
|
||||
// Definitions by: Thomas Corbière <https://github.com/tomc974>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts"/>
|
||||
|
||||
declare module "gulp-cached"
|
||||
{
|
||||
interface ICacheStore
|
||||
{
|
||||
[name: string]: {};
|
||||
}
|
||||
|
||||
interface IOptions
|
||||
{
|
||||
/**
|
||||
* Uses md5 instead of storing the whole file contents.
|
||||
* @default false
|
||||
*/
|
||||
optimizeMemory?: boolean;
|
||||
}
|
||||
|
||||
interface IGulpCached
|
||||
{
|
||||
/**
|
||||
* Creates a new cache hash or uses an existing one.
|
||||
*/
|
||||
(name: string, options?: IOptions): NodeJS.ReadWriteStream;
|
||||
|
||||
/**
|
||||
* Cache store.
|
||||
*/
|
||||
caches: ICacheStore;
|
||||
}
|
||||
|
||||
const cached: IGulpCached;
|
||||
export = cached;
|
||||
}
|
||||
Reference in New Issue
Block a user