forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulp-changed.d.ts
60 lines (50 loc) · 1.64 KB
/
gulp-changed.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Type definitions for gulp-changed
// Project: https://github.com/sindresorhus/gulp-changed
// Definitions by: Thomas Corbière <https://github.com/tomc974>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts"/>
/// <reference path="../vinyl/vinyl.d.ts"/>
declare module "gulp-changed"
{
import { Transform } from "stream";
import File = require("vinyl");
interface IComparator
{
/**
* @param stream Should be used to queue sourceFile if it passes some comparison
* @param callback Should be called when done
* @param sourceFile File to operate on
* @param destPath Destination for sourceFile as an absolute path
*/
(stream: Transform, callback: Function, sourceFile: File, destPath: string): void;
}
interface IDestination
{
(file: string|Buffer): string;
}
interface IOptions
{
/**
* The working directory the folder is relative to.
* @default process.cwd()
*/
cwd?: string;
/**
* Extension of the destination files.
*/
extension?: string;
/**
* Function that determines whether the source file is different from the destination file.
* @default changed.compareLastModifiedTime
*/
hasChanged?: IComparator;
}
interface IGulpChanged
{
(destination: string|IDestination, options?: IOptions): NodeJS.ReadWriteStream;
compareLastModifiedTime: IComparator;
compareSha1Digest: IComparator;
}
const changed: IGulpChanged;
export = changed;
}