UNPKG

1.57 kBTypeScriptView Raw
1export declare type Transform = "jsx" | "typescript" | "flow" | "imports" | "react-hot-loader";
2export interface SourceMapOptions {
3 /**
4 * The name to use in the "file" field of the source map. This should be the name of the compiled
5 * file.
6 */
7 compiledFilename: string;
8}
9export interface Options {
10 transforms: Array<Transform>;
11 /**
12 * If specified, function name to use in place of React.createClass when compiling JSX.
13 */
14 jsxPragma?: string;
15 /**
16 * If specified, function name to use in place of React.Fragment when compiling JSX.
17 */
18 jsxFragmentPragma?: string;
19 /**
20 * If true, replicate the import behavior of TypeScript's esModuleInterop: false.
21 */
22 enableLegacyTypeScriptModuleInterop?: boolean;
23 /**
24 * If true, replicate the import behavior Babel 5 and babel-plugin-add-module-exports.
25 */
26 enableLegacyBabel5ModuleInterop?: boolean;
27 /**
28 * If specified, we also return a RawSourceMap object alongside the code. Currently, source maps
29 * simply map each line to the original line without any mappings within lines, since Sucrase
30 * preserves line numbers. filePath must be specified if this option is enabled.
31 */
32 sourceMapOptions?: SourceMapOptions;
33 /**
34 * File path to use in error messages, React display names, and source maps.
35 */
36 filePath?: string;
37 /**
38 * If specified, omit any development-specific code in the output.
39 */
40 production?: boolean;
41}
42export declare function validateOptions(options: Options): void;