turbo-gulp
Version:
Gulp tasks to boost high-quality projects.
100 lines (99 loc) • 3.31 kB
TypeScript
import * as ts from "typescript";
import { CompilerOptionsJson } from "./tsc";
export declare enum OutModules {
Js = 0,
Mjs = 1,
Both = 2,
}
/**
* Typescript options, can be applied both to the project or for specific targets.
*/
export interface TypescriptOptions {
/**
* Typescript instance to use for compilation.
*
* Merge rule: Last write win.
*/
typescript?: typeof ts;
/**
* Exit with non-null return code on any error when building the scripts.
* In watch mode, the errors are reported but the process does not stop (`strict: false`).
*
* Default: `true`.
* Merge rule: Last write win.
*/
strict?: boolean;
/**
* Override the default compiler options.
* These options are passed to `gulp-typescript` and used when emiting `tsconfig.json` files.
*
* Merge rule: Shallow merge (`actual = {...default, ...project, ...target}`).
*/
compilerOptions?: CompilerOptionsJson;
/**
* A list of paths where you should generate a `tsconfig.json` file.
*
* If used in a project: relative to `project.root`
* If used in a target: relative to `project.src`.
*
* Merge rule: Last write win (no array merge).
*/
tsconfigJson?: string[];
/**
* Output modules.
*
* - `Default`: Use the compiler options to emit `*.js` files.
* - `Mjs`: Enforce `es2015` modules and emit `*.mjs` files.
* - `Both`: Emit both `*.js` files using the compiler options and `*.mjs` using `es2015`.
*
* Default: `Js`
*/
outModules?: OutModules;
}
/**
* Typescript options, can be applied both to the project or for specific targets.
*/
export interface CompleteTypescriptOptions extends TypescriptOptions {
/**
* Typescript instance to use for compilation.
*
* Merge rule: Last write win.
*/
typescript: typeof ts;
/**
* Exit with non-null return code on any error when building the scripts.
* In watch mode, the errors are reported but the process does not stop (`strict: false`).
*
* Default: `true`.
* Merge rule: Last write win.
*/
strict?: boolean;
/**
* Override the default compiler options.
* These options are passed to `gulp-typescript` and used when emiting `tsconfig.json` files.
*
* Merge rule: Shallow merge (`actual = {...default, ...project, ...target}`).
*/
compilerOptions: CompilerOptionsJson;
/**
* A list of paths where you should generate a `tsconfig.json` file.
*
* If used in a project: relative to `project.root`
* If used in a target: relative to `project.src`.
*
* Merge rule: Last write win (no array merge).
*/
tsconfigJson: string[];
/**
* Output modules.
*
* - `Default`: Use the compiler options to emit `*.js` files.
* - `Mjs`: Enforce `es2015` modules and emit `*.mjs` files.
* - `Both`: Emit both `*.js` files using the compiler options and `*.mjs` using `es2015`.
*
* Merge rule: Last write win
*/
outModules: OutModules;
}
export declare const DEFAULT_PROJECT_TS_OPTIONS: TypescriptOptions;
export declare function mergeTypescriptOptions(base: TypescriptOptions, extra?: TypescriptOptions): TypescriptOptions;