UNPKG

1.91 kBTypeScriptView Raw
1// Type definitions for gulp-load-plugins
2// Project: https://github.com/jackfranklin/gulp-load-plugins
3// Definitions by: Joe Skeen <https://github.com/joeskeen>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6/// <reference types="node" />
7
8/** Loads in any gulp plugins and attaches them to an object, freeing you up from having to manually require each gulp plugin. */
9declare module 'gulp-load-plugins' {
10
11 interface IOptions {
12 /** the glob(s) to search for, default ['gulp-*', 'gulp.*'] */
13 pattern?: string[] | undefined;
14 /** where to find the plugins, searched up from process.cwd(), default 'package.json' */
15 config?: string | undefined;
16 /** which keys in the config to look within, default ['dependencies', 'devDependencies', 'peerDependencies'] */
17 scope?: string[] | undefined;
18 /** what to remove from the name of the module when adding it to the context, default /^gulp(-|\.)/ */
19 replaceString?: RegExp | undefined;
20 /** if true, transforms hyphenated plugin names to camel case, default true */
21 camelize?: boolean | undefined;
22 /** whether the plugins should be lazy loaded on demand, default true */
23 lazy?: boolean | undefined;
24 /** a mapping of plugins to rename, the key being the NPM name of the package, and the value being an alias you define */
25 rename?: IPluginNameMappings | undefined;
26 }
27
28 interface IPluginNameMappings {
29 [npmPackageName: string]: string
30 }
31
32 /** Loads in any gulp plugins and attaches them to an object, freeing you up from having to manually require each gulp plugin. */
33 function gulpLoadPlugins<T extends IGulpPlugins>(options?: IOptions): T;
34
35 namespace gulpLoadPlugins {}
36
37 export = gulpLoadPlugins;
38}
39
40/**
41 * Extend this interface to use Gulp plugins in your gulpfile.js
42 */
43interface IGulpPlugins {
44}