mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 11:02:11 +08:00
Add definitions for gulp-size (https://github.com/sindresorhus/gulp-size)
This commit is contained in:
27
gulp-size/gulp-size-tests.ts
Normal file
27
gulp-size/gulp-size-tests.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/// <reference path="gulp-size.d.ts" />
|
||||
/// <reference path="../gulp/gulp.d.ts" />
|
||||
/// <reference path="../gulp-debug/gulp-debug.d.ts" />
|
||||
|
||||
import gulp = require('gulp');
|
||||
import size = require('gulp-size');
|
||||
import debug = require('gulp-debug');
|
||||
|
||||
gulp.task('default', () =>
|
||||
gulp.src('fixture.js')
|
||||
.pipe(size())
|
||||
.pipe(gulp.dest('dist'))
|
||||
);
|
||||
|
||||
|
||||
gulp.task('default', () => {
|
||||
var s = size();
|
||||
|
||||
return gulp.src('fixture.js')
|
||||
.pipe(s)
|
||||
.pipe(gulp.dest('dist'))
|
||||
.pipe(debug({title: 'Total size ' + s.prettySize}));
|
||||
});
|
||||
|
||||
|
||||
size();
|
||||
size({showFiles: true, gzip: true});
|
||||
23
gulp-size/gulp-size.d.ts
vendored
Normal file
23
gulp-size/gulp-size.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
// Type definitions for gulp-size v1.2.3
|
||||
// Project: https://github.com/sindresorhus/gulp-size
|
||||
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module 'gulp-size' {
|
||||
interface IOptions {
|
||||
showFiles?: boolean;
|
||||
gzip?: boolean;
|
||||
title?: string;
|
||||
}
|
||||
|
||||
interface ISizeStream extends NodeJS.ReadWriteStream {
|
||||
size: number;
|
||||
prettySize: string;
|
||||
}
|
||||
|
||||
function size(options?: IOptions): ISizeStream;
|
||||
|
||||
export = size;
|
||||
}
|
||||
Reference in New Issue
Block a user