mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Add type definitions for lazypipe
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
/// <reference path="../gulp/gulp.d.ts" />
|
||||
/// <reference path="../gulp-minify-html/gulp-minify-html.d.ts" />
|
||||
/// <reference path="../gulp-size/gulp-size.d.ts" />
|
||||
/// <reference path="./lazypipe.d.ts" />
|
||||
|
||||
import * as gulp from "gulp";
|
||||
import minifyHtml = require("gulp-minify-html");
|
||||
import size = require("gulp-size");
|
||||
import lazypipe = require("lazypipe");
|
||||
|
||||
const pipeline = lazypipe()
|
||||
.pipe(size)
|
||||
.pipe(minifyHtml, {})
|
||||
.pipe(size);
|
||||
|
||||
gulp.src("*.html")
|
||||
.pipe(pipeline())
|
||||
.pipe(gulp.dest("build"));
|
||||
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
// Type definitions for lazypipe
|
||||
// Project: https://github.com/OverZealous/lazypipe
|
||||
// Definitions by: Thomas Corbière <https://github.com/tomc974>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts"/>
|
||||
|
||||
declare module "lazypipe"
|
||||
{
|
||||
interface IPipelineBuilder
|
||||
{
|
||||
/**
|
||||
* Returns a stream where all the internal steps are processed sequentially
|
||||
* and the final result is passed on.
|
||||
*/
|
||||
(): NodeJS.ReadWriteStream;
|
||||
|
||||
/**
|
||||
* Creates a new lazy pipeline with all the previous steps, and the new step added to the end.
|
||||
* @param fn A stream creation function to call when the pipeline is created later.
|
||||
* @param args Any remaining arguments are saved and passed into fn when the pipeline is created.
|
||||
*/
|
||||
pipe(fn: Function, ...args: any[]): IPipelineBuilder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes a lazypipe.
|
||||
*/
|
||||
function lazypipe(): IPipelineBuilder;
|
||||
export = lazypipe;
|
||||
}
|
||||
Reference in New Issue
Block a user