Files
DefinitelyTyped/types/gulp-newer/index.d.ts
Chris Thompson 68b2d5f13f 🤖 Merge PR #62254 Update gulp-newer to allow using options.map wiithout options.dest. by @cthompson92
* Update gulp-newer to allow using options.map wiithout options.dest.

* Fix for the CI build.

* Add a version to the header comment for gulp-newer.

---------

Co-authored-by: Christopher Thompson <christopher.s.thompson@huntington.com>
2023-03-07 15:23:45 -08:00

60 lines
1.7 KiB
TypeScript

// Type definitions for gulp-newer 1.4
// Project: https://github.com/tschaub/gulp-newer
// Definitions by: Thomas Corbière <https://github.com/tomc974>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node"/>
interface IDestinationOption {
/**
* Path to destination directory or file.
*/
dest: string;
}
interface IExtOption {
/**
* Source files will be matched to destination files with the provided extension.
*/
ext: string;
}
interface IMapOption {
/**
* Map relative source paths to relative destination paths.
*/
map: (relativePath: string) => string;
}
interface IExtraOption {
/**
* An extra file, file glob, or list of extra files and/or globs, to check for updated time stamp(s).
* If any of these files are newer than the destination files, then all source files will be passed into the stream.
*/
extra?: string | string[];
}
type ValidOptionPermutations =
| (IDestinationOption & Partial<IExtOption> & Partial<IMapOption>)
| (Partial<IDestinationOption> & Partial<IExtOption> & IMapOption);
type IOptions = IExtraOption & ValidOptionPermutations;
interface IGulpNewer {
/**
* Create a transform stream that passes through files whose modification time
* is more recent than the corresponding destination file's modification time.
* @param dest Path to destination directory or file.
*/
(dest: string): NodeJS.ReadWriteStream;
/**
* Create a transform stream that passes through files whose modification time
* is more recent than the corresponding destination file's modification time.
*/
(options: IOptions): NodeJS.ReadWriteStream;
}
declare const newer: IGulpNewer;
export = newer;