UNPKG

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