import type { TsConfigSourceFile } from 'typescript';
import ts from 'typescript';
import type { BuildTask } from '@teambit/builder';
import type { Bundler, BundlerContext, DevServer, DevServerContext } from '@teambit/bundler';
import type { PreviewStrategyName } from '@teambit/preview';
import type { PrettierConfigTransformer } from '@teambit/defender.prettier.config-mutator';
import type { CompilerMain } from '@teambit/compiler';
import type { BuilderEnv, CompilerEnv, DependenciesEnv, DevEnv, LinterEnv, PackageEnv, TesterEnv, FormatterEnv, PipeServiceModifier, PipeServiceModifiersMap } from '@teambit/envs';
import type { PackageJsonProps, PkgMain } from '@teambit/pkg';
import type { Tester, TesterMain } from '@teambit/tester';
import type { TsConfigTransformer, TypescriptMain } from '@teambit/typescript';
import type { WebpackConfigTransformer, WebpackMain } from '@teambit/webpack';
import type { Workspace } from '@teambit/workspace';
import type { EslintConfigTransformer } from '@teambit/defender.eslint.config-mutator';
import type { DependencyResolverMain } from '@teambit/dependency-resolver';
import type { Linter, LinterContext } from '@teambit/linter';
import type { Formatter, FormatterContext } from '@teambit/formatter';
import type { SchemaExtractor } from '@teambit/schema';
import type { Logger } from '@teambit/logger';
import type { ConfigWriterEntry } from '@teambit/workspace-config-files';
import type { ReactMainConfig } from './react.main.runtime';
import type { WorkerMain } from '@teambit/worker';
import type { DevFilesMain } from '@teambit/dev-files';
export declare const ReactEnvType = "react";
type CompilerMode = 'build' | 'dev';
type GetBuildPipeModifiers = PipeServiceModifiersMap & {
    tsModifier?: PipeServiceModifier;
    jestModifier?: PipeServiceModifier;
};
/**
 * a component environment built for [React](https://reactjs.org) .
 */
export declare class ReactEnv implements TesterEnv, CompilerEnv, LinterEnv, DevEnv, BuilderEnv, DependenciesEnv, PackageEnv, FormatterEnv {
    /**
     * typescript extension.
     */
    protected tsAspect: TypescriptMain;
    /**
     * compiler extension.
     */
    private compiler;
    /**
     * webpack extension.
     */
    private webpack;
    /**
     * workspace extension.
     */
    private workspace;
    /**
     * worker extension.
     */
    private worker;
    /**
     * pkg extension.
     */
    private pkg;
    /**
     * tester extension
     */
    private tester;
    private config;
    private dependencyResolver;
    private devFiles;
    private logger;
    private compilerAspectId;
    constructor(
    /**
     * typescript extension.
     */
    tsAspect: TypescriptMain, 
    /**
     * compiler extension.
     */
    compiler: CompilerMain, 
    /**
     * webpack extension.
     */
    webpack: WebpackMain, 
    /**
     * workspace extension.
     */
    workspace: Workspace, 
    /**
     * worker extension.
     */
    worker: WorkerMain, 
    /**
     * pkg extension.
     */
    pkg: PkgMain, 
    /**
     * tester extension
     */
    tester: TesterMain, config: ReactMainConfig, dependencyResolver: DependencyResolverMain, devFiles: DevFilesMain, logger: Logger, compilerAspectId: string);
    getTsConfig(targetTsConfig?: TsConfigSourceFile): TsConfigSourceFile;
    getBuildTsConfig(targetTsConfig?: TsConfigSourceFile): TsConfigSourceFile;
    /**
     * @deprecated use createCjsJestTester()
     */
    getCjsJestTester(jestConfigPath?: string, jestModulePath?: string): Tester;
    /**
     * Get a jest tester instance with react config and cjs configs
     * @param jestConfigPath
     * @param jestModulePath
     * @returns
     */
    createCjsJestTester(jestConfigPath?: string, jestModulePath?: string): Tester;
    private getJestWorker;
    /**
     * @deprecated use createEsmJestTester()
     */
    getEsmJestTester(jestConfigPath?: string, jestModulePath?: string): Tester;
    /**
     * Get a jest tester instance with react config and esm configs
     * @param jestConfigPath
     * @param jestModulePath
     * @returns
     */
    createEsmJestTester(jestConfigPath?: string, jestModulePath?: string): Tester;
    /**
     * returns a component tester.
     */
    getTester(jestConfigPath: string, jestModulePath?: string): Tester;
    private createTsCompilerOptions;
    /**
     * @deprecated use createTsCjsCompiler()
     */
    getTsCjsCompiler(mode?: CompilerMode, transformers?: TsConfigTransformer[], tsModule?: typeof ts): import("@teambit/compiler").Compiler;
    /**
     * Get a compiler instance with react config and set it to cjs module
     * @param mode
     * @param transformers
     * @param tsModule
     * @returns
     */
    createTsCjsCompiler(mode?: CompilerMode, transformers?: TsConfigTransformer[], tsModule?: typeof ts): import("@teambit/compiler").Compiler;
    /**
     * @deprecated use createTsEsmCompiler()
     */
    getTsEsmCompiler(mode?: CompilerMode, transformers?: TsConfigTransformer[], tsModule?: typeof ts): void;
    /**
     * Get a compiler instance with react config and set it to esm module
     * @param mode
     * @param transformers
     * @param tsModule
     * @returns
     */
    createTsEsmCompiler(mode?: CompilerMode, transformers?: TsConfigTransformer[], tsModule?: typeof ts): import("@teambit/compiler").Compiler;
    getCompiler(transformers?: TsConfigTransformer[], tsModule?: typeof ts): import("@teambit/compiler").Compiler;
    private getEslintOptions;
    /**
     * returns and configures the component linter.
     */
    getLinter(context: LinterContext, transformers?: EslintConfigTransformer[]): Linter;
    /**
     * returns and configures the component formatter.
     */
    getFormatter(context: FormatterContext, transformers?: PrettierConfigTransformer[]): Formatter;
    private getFileMap;
    private writeFileMap;
    /**
     * required for `bit start`
     */
    getDevEnvId(id?: string): string;
    /**
     * get a schema generator instance configured with the correct tsconfig.
     */
    getSchemaExtractor(tsconfig: TsConfigSourceFile, tsserverPath?: string, contextPath?: string): SchemaExtractor;
    /**
     * returns and configures the React component dev server.
     * required for `bit start`
     */
    getDevServer(context: DevServerContext, transformers?: WebpackConfigTransformer[], webpackModulePath?: string, webpackDevServerModulePath?: string): DevServer;
    getBundler(context: BundlerContext, transformers?: WebpackConfigTransformer[], webpackModulePath?: string): Promise<Bundler>;
    createComponentsWebpackBundler(context: BundlerContext, transformers?: WebpackConfigTransformer[], webpackModulePath?: string): Promise<Bundler>;
    createTemplateWebpackBundler(context: BundlerContext, transformers?: WebpackConfigTransformer[], webpackModulePath?: string): Promise<Bundler>;
    private createWebpackBundler;
    getAdditionalHostDependencies(): string[];
    /**
     * returns a path to a docs template.
     */
    getDocsTemplate(): string;
    icon: string;
    /**
     * returns the path to the compositions template
     */
    getMounter(): string;
    getPreviewConfig(): {
        strategyName: PreviewStrategyName;
        splitComponentBundle: boolean;
        isScaling: boolean;
    };
    /**
     * define the package json properties to add to each component.
     */
    getPackageJsonProps(): PackageJsonProps;
    /**
     * @deprecated use createCjsPackageJsonProps()
     */
    getCjsPackageJsonProps(): PackageJsonProps;
    /**
     * Get the default package.json props for a cjs component
     * @returns
     */
    createCjsPackageJsonProps(): PackageJsonProps;
    /**
     * @deprecated use createEsmPackageJsonProps()
     */
    getEsmPackageJsonProps(): PackageJsonProps;
    /**
     * Get the default package.json props for an esm component
     * @returns
     */
    createEsmPackageJsonProps(): PackageJsonProps;
    getNpmIgnore(): string[];
    /**
     * adds dependencies to all configured components.
     */
    getDependencies(): {
        dependencies: {
            react: string;
            'react-dom': string;
            'core-js': string;
        };
        devDependencies: {
            react: string;
            'react-dom': string;
            '@types/mocha': string;
            '@types/node': string;
            '@types/react': string;
            '@types/react-dom': string;
            '@types/jest': string;
            '@babel/runtime': string;
            '@types/testing-library__jest-dom': string;
        };
        peerDependencies: {
            react: string;
            'react-dom': string;
        };
    };
    /**
     * returns the component build pipeline.
     */
    getBuildPipe(modifiers?: GetBuildPipeModifiers): BuildTask[];
    /**
     * @deprecated use createBuildPipeWithoutCompiler()
     */
    getBuildPipeWithoutCompiler(): BuildTask[];
    /**
     * Get the react build pipeline without the compilation task.
     * This help in cases you want to only replace the compilation task with something else
     * @returns
     */
    createBuildPipeWithoutCompiler(): BuildTask[];
    /**
     * @deprecated use createEsmCompilerTask()
     */
    getEsmCompilerTask(transformers?: TsConfigTransformer[], tsModule?: typeof ts): import("@teambit/compiler").CompilerTask;
    /**
     * Get a compiler task with react config and set to esm module
     * @param transformers
     * @param tsModule
     * @returns
     */
    createEsmCompilerTask(transformers?: Function[], tsModule?: typeof ts): import("@teambit/compiler").CompilerTask;
    /**
     * @deprecated use createCjsCompilerTask()
     * */
    getCjsCompilerTask(transformers?: TsConfigTransformer[], tsModule?: typeof ts): import("@teambit/compiler").CompilerTask;
    /**
     * Get a compiler task with react config and set to cjs module
     * @param transformers
     * @param tsModule
     * @returns
     */
    createCjsCompilerTask(transformers?: Function[], tsModule?: typeof ts): import("@teambit/compiler").CompilerTask;
    workspaceConfig(): ConfigWriterEntry[];
    __getDescriptor(): Promise<{
        type: string;
    }>;
}
export declare function runTransformersWithContext<P, T extends Function, C>(config: P, transformers: T[] | undefined, context: C): P;
export {};
