Skip to content

Commit

Permalink
Add definitions and tests for gulp-concat
Browse files Browse the repository at this point in the history
  • Loading branch information
k-kagurazaka committed Mar 4, 2015
1 parent bb465f2 commit 4837e53
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
23 changes: 23 additions & 0 deletions gulp-concat/gulp-concat-tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/// <reference path="./gulp-concat.d.ts" />
/// <reference path="../gulp/gulp.d.ts" />

import gulp = require("gulp");
import concat = require("gulp-concat");

gulp.task("concat:simple", () => {
gulp.src(["file*.txt"])
.pipe(concat("file.txt"))
.pipe(gulp.dest("build"));
});

gulp.task("concat:newLine", () => {
gulp.src(["file*.txt"])
.pipe(concat("file.txt", { newLine: ";" }))
.pipe(gulp.dest("build"));
});

gulp.task("concat:vinyl", () => {
gulp.src(["file*.txt"])
.pipe(concat({ path: "file.txt", stat: { mode: 0666 } }))
.pipe(gulp.dest("build"));
});
42 changes: 42 additions & 0 deletions gulp-concat/gulp-concat.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Type definitions for gulp-concat
// Project: http://github.com/wearefractal/gulp-concat
// Definitions by: Keita Kagurazaka <https://github.com/k-kagurazaka>
// Definitions: https://github.com/borisyankov/DefinitelyTyped

/// <reference path="../node/node.d.ts" />

declare module "gulp-concat" {

interface IOptions {
newLine: string;
}

interface IFsStats {
dev?: number;
ino?: number;
mode?: number;
nlink?: number;
uid?: number;
gid?: number;
rdev?: number;
size?: number;
blksize?: number;
blocks?: number;
atime?: Date;
mtime?: Date;
ctime?: Date;
}

interface IVinylOptions {
cwd?: string;
base?: string;
path?: string;
stat?: IFsStats;
contents?: NodeJS.ReadableStream | Buffer;
}

function concat(filename: string, options?: IOptions): NodeJS.ReadWriteStream;
function concat(options: IVinylOptions): NodeJS.ReadWriteStream;

export = concat;
}

0 comments on commit 4837e53

Please sign in to comment.