UNPKG

4.05 kBTypeScriptView Raw
1/// <reference types="node" />
2import { GulpProxy } from './GulpProxy';
3import { IExecutable } from './IExecutable';
4import { IBuildConfig } from './IBuildConfig';
5import { CopyStaticAssetsTask } from './tasks/copyStaticAssets/CopyStaticAssetsTask';
6export { IExecutable } from './IExecutable';
7import * as Gulp from 'gulp';
8import { JestTask } from './tasks/JestTask';
9export * from './IBuildConfig';
10export { addSuppression, coverageData, functionalTestRun, getErrors, getWarnings, TestResultState, warn, verbose, error, fileError, fileLog, fileWarning, reset, log, logSummary } from './logging';
11export * from './tasks/CopyTask';
12export * from './tasks/GenerateShrinkwrapTask';
13export * from './tasks/GulpTask';
14export * from './tasks/CleanTask';
15export * from './tasks/CleanFlagTask';
16export * from './tasks/ValidateShrinkwrapTask';
17export * from './tasks/copyStaticAssets/CopyStaticAssetsTask';
18export * from './tasks/JestTask';
19/**
20 * Merges the given build config settings into existing settings.
21 *
22 * @param config - The build config settings.
23 * @public
24 */
25export declare function setConfig(config: Partial<IBuildConfig>): void;
26/**
27 * Merges the given build config settings into existing settings.
28 *
29 * @param config - The build config settings.
30 * @public
31 */
32export declare function mergeConfig(config: Partial<IBuildConfig>): void;
33/**
34 * Replaces the build config.
35 *
36 * @param config - The build config settings.
37 * @public
38 */
39export declare function replaceConfig(config: IBuildConfig): void;
40/**
41 * Gets the current config.
42 * @returns the current build configuration
43 * @public
44 */
45export declare function getConfig(): IBuildConfig;
46/** @public */
47export declare const cleanFlag: IExecutable;
48/**
49 * Registers an IExecutable to gulp so that it can be called from the command line
50 * @param taskName - the name of the task, can be called from the command line (e.g. "gulp <taskName>")
51 * @param taskExecutable - the executable to execute when the task is invoked
52 * @returns the task parameter
53 * @public
54 */
55export declare function task(taskName: string, taskExecutable: IExecutable): IExecutable;
56/**
57 * The callback interface for a custom task definition.
58 * The task should either return a Promise, a stream, or call the
59 * callback function (passing in an object value if there was an error).
60 * @public
61 */
62export interface ICustomGulpTask {
63 (gulp: typeof Gulp | GulpProxy, buildConfig: IBuildConfig, done?: (failure?: any) => void): Promise<object> | NodeJS.ReadWriteStream | void;
64}
65/**
66 * Creates a new subtask from a function callback. Useful as a shorthand way
67 * of defining tasks directly in a gulpfile.
68 *
69 * @param taskName - the name of the task, appearing in build logs
70 * @param fn - the callback function to execute when this task runs
71 * @returns an IExecutable which can be registered to the command line with task()
72 * @public
73 */
74export declare function subTask(taskName: string, fn: ICustomGulpTask): IExecutable;
75/**
76 * Defines a gulp watch and maps it to a given IExecutable.
77 *
78 * @param watchMatch - the list of files patterns to watch
79 * @param taskExecutable - the task to execute when a file changes
80 * @returns IExecutable
81 * @public
82 */
83export declare function watch(watchMatch: string | string[], taskExecutable: IExecutable): IExecutable;
84/**
85 * Takes in IExecutables as arguments and returns an IExecutable that will execute them in serial.
86 * @public
87 */
88export declare function serial(...tasks: (IExecutable[] | IExecutable)[]): IExecutable;
89/**
90 * Takes in IExecutables as arguments and returns an IExecutable that will execute them in parallel.
91 * @public
92 */
93export declare function parallel(...tasks: (IExecutable[] | IExecutable)[]): IExecutable;
94/**
95 * Initializes the gulp tasks.
96 * @public
97 */
98export declare function initialize(gulp: typeof Gulp): void;
99/** @public */
100export declare const clean: IExecutable;
101/** @public */
102export declare const copyStaticAssets: CopyStaticAssetsTask;
103/** @public */
104export declare const jest: JestTask;
105//# sourceMappingURL=index.d.ts.map
\No newline at end of file