1 | /// <reference types="node"/>
|
2 | /// <reference types="vinyl" />
|
3 |
|
4 | import { Transform } from "stream";
|
5 | import File = require("vinyl");
|
6 |
|
7 | interface IComparator {
|
8 | /**
|
9 | * @param stream Should be used to queue sourceFile if it passes some comparison
|
10 | * @param sourceFile File to operate on
|
11 | * @param destPath Destination for sourceFile as an absolute path
|
12 | */
|
13 | (stream: Transform, sourceFile: File, destPath: string): void;
|
14 | }
|
15 |
|
16 | interface IDestination {
|
17 | (file: string | Buffer): string;
|
18 | }
|
19 |
|
20 | interface IOptions {
|
21 | /**
|
22 | * The working directory the folder is relative to.
|
23 | * @default process.cwd()
|
24 | */
|
25 | cwd?: string | undefined;
|
26 |
|
27 | /**
|
28 | * Extension of the destination files.
|
29 | */
|
30 | extension?: string | undefined;
|
31 |
|
32 | /**
|
33 | * Function that determines whether the source file is different from the destination file.
|
34 | * @default changed.compareLastModifiedTime
|
35 | */
|
36 | hasChanged?: IComparator | undefined;
|
37 |
|
38 | /**
|
39 | * Function to transform the path to the destination file. Should return the absolute path to the (renamed) destination file.
|
40 | */
|
41 | transformPath?: ((destPath: string) => string) | undefined;
|
42 | }
|
43 |
|
44 | interface IGulpChanged {
|
45 | (destination: string | IDestination, options?: IOptions): NodeJS.ReadWriteStream;
|
46 |
|
47 | compareLastModifiedTime: IComparator;
|
48 | compareContents: IComparator;
|
49 | }
|
50 |
|
51 | declare const changed: IGulpChanged;
|
52 | export = changed;
|
53 |
|
\ | No newline at end of file |