1 | // Type definitions for gulp-newer 1.4
|
2 | // Project: https://github.com/tschaub/gulp-newer
|
3 | // Definitions by: Thomas Corbière <https://github.com/tomc974>
|
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
5 |
|
6 | /// <reference types="node"/>
|
7 |
|
8 | interface IDestinationOption {
|
9 | /**
|
10 | * Path to destination directory or file.
|
11 | */
|
12 | dest: string;
|
13 | }
|
14 |
|
15 | interface IExtOption {
|
16 | /**
|
17 | * Source files will be matched to destination files with the provided extension.
|
18 | */
|
19 | ext: string;
|
20 | }
|
21 |
|
22 | interface IMapOption {
|
23 | /**
|
24 | * Map relative source paths to relative destination paths.
|
25 | */
|
26 | map: (relativePath: string) => string;
|
27 | }
|
28 |
|
29 | interface IExtraOption {
|
30 | /**
|
31 | * An extra file, file glob, or list of extra files and/or globs, to check for updated time stamp(s).
|
32 | * If any of these files are newer than the destination files, then all source files will be passed into the stream.
|
33 | */
|
34 | extra?: string | string[];
|
35 | }
|
36 |
|
37 | type ValidOptionPermutations =
|
38 | | (IDestinationOption & Partial<IExtOption> & Partial<IMapOption>)
|
39 | | (Partial<IDestinationOption> & Partial<IExtOption> & IMapOption);
|
40 |
|
41 | type IOptions = IExtraOption & ValidOptionPermutations;
|
42 |
|
43 | interface IGulpNewer {
|
44 | /**
|
45 | * Create a transform stream that passes through files whose modification time
|
46 | * is more recent than the corresponding destination file's modification time.
|
47 | * @param dest Path to destination directory or file.
|
48 | */
|
49 | (dest: string): NodeJS.ReadWriteStream;
|
50 |
|
51 | /**
|
52 | * Create a transform stream that passes through files whose modification time
|
53 | * is more recent than the corresponding destination file's modification time.
|
54 | */
|
55 | (options: IOptions): NodeJS.ReadWriteStream;
|
56 | }
|
57 |
|
58 | declare const newer: IGulpNewer;
|
59 | export = newer;
|