import { IBuildTask } from "./i-build-task";
import { IBuildTaskExecuteOptions } from "./i-build-task-execute-options";
import { IProjectPathUtil } from "../../util/project-path-util/i-project-path-util";
import { IArrayUtil } from "@wessberg/arrayutil";
import { ILoggerService } from "../../service/logger/i-logger-service";
import { IBundlerService } from "../../service/bundler/i-bundler-service";
import { IFileSaver } from "@wessberg/filesaver";
import { IManifestJsonWriterService } from "../../service/writer/manifest-json-writer/i-manifest-json-writer-service";
import { IIndexHtmlWriterService } from "../../service/writer/index-html-writer/i-index-html-writer-service";
import { IFileLoader } from "@wessberg/fileloader";
import { IAssetWriterService } from "../../service/writer/asset-writer/i-asset-writer-service";
import { IBuildConfig } from "../../build-config/i-build-config";
import { IBabelMinifyOptions } from "../../service/minify/i-babel-minify-options";
import { ICompressorService } from "../../service/compression/i-compressor-service";
import { IProjectParserService } from "../../service/parser/project-parser/i-project-parser-service";
import { IStylesParserService } from "../../service/parser/styles-parser/i-styles-parser-service";
import { IIndexHtmlParserService } from "../../service/parser/index-html-parser/i-index-html-parser-service";
import { IManifestJsonParserService } from "../../service/parser/manifest-json-parser/i-manifest-json-parser-service";
import { IAssetOptimizerService } from "../../service/asset-optimizer/i-asset-optimizer-service";
import { IPolyfillService } from "../../service/polyfill/i-polyfill-service";
import { IDevServerService } from "../../service/dev-server/i-dev-server-service";
import { IAssetParserService } from "../../service/parser/asset-parser/i-asset-parser-service";
import { IDiskCacheRegistryService } from "../../service/cache-registry/disk-cache-registry/i-disk-cache-registry-service";
/**
 * A task used for building a Fovea project
 */
export declare class BuildTask implements IBuildTask {
    private readonly logger;
    private readonly config;
    private readonly projectParser;
    private readonly projectPathUtil;
    private readonly stylesParser;
    private readonly manifestJsonParser;
    private readonly indexHtmlParser;
    private readonly assetParser;
    private readonly assetOptimizer;
    private readonly arrayUtil;
    private readonly bundler;
    private readonly fileSaver;
    private readonly fileLoader;
    private readonly manifestJsonWriter;
    private readonly indexHtmlWriter;
    private readonly assetWriter;
    private readonly minifyOptions;
    private readonly compressor;
    private readonly polyfillService;
    private readonly devServer;
    private readonly cacheService;
    /**
     * An EventEmitter that can emit build-related events
     * @type {EventEmitter}
     */
    private readonly buildEventEmitter;
    /**
     * The time of the last time the build status changed
     * @type {number}
     */
    private timeOfLastBuildStatusChange;
    /**
     * The current build status
     * @type {BuildStatusKind}
     */
    private buildStatus;
    constructor(logger: ILoggerService, config: IBuildConfig, projectParser: IProjectParserService, projectPathUtil: IProjectPathUtil, stylesParser: IStylesParserService, manifestJsonParser: IManifestJsonParserService, indexHtmlParser: IIndexHtmlParserService, assetParser: IAssetParserService, assetOptimizer: IAssetOptimizerService, arrayUtil: IArrayUtil, bundler: IBundlerService, fileSaver: IFileSaver, fileLoader: IFileLoader, manifestJsonWriter: IManifestJsonWriterService, indexHtmlWriter: IIndexHtmlWriterService, assetWriter: IAssetWriterService, minifyOptions: IBabelMinifyOptions, compressor: ICompressorService, polyfillService: IPolyfillService, devServer: IDevServerService, cacheService: IDiskCacheRegistryService);
    /**
     * Gets the time that has passed since the last time the build status changed
     * @type {number}
     */
    private readonly timeSinceLastBuildStatusChange;
    /**
     * Executes a 'build' task
     * @param {IBuildTaskExecuteOptions} buildTaskOptions
     * @returns {Promise<void>}
     */
    execute(buildTaskOptions: IBuildTaskExecuteOptions): Promise<void>;
    /**
     * Begins the built
     * @param {IBuildTaskExecuteOptions} options
     * @param {ISubscriber<void>} subscriber
     * @returns {IObserver}
     */
    private build(options, subscriber);
    /**
     * Called each time the project changes
     * @param {IBuildProjectOptions} options
     * @param {ISubscriber<void>} subscriber
     * @returns {IObserver}
     */
    private buildProject(options, subscriber);
    /**
     * Builds assets and proceeds with the rest of the build
     * @param {IBuildAssetsOptions} options
     * @param {ISubscriber<IAssetOptimizerServiceOptimizeDirectoryResult>} subscriber
     * @returns {IObserver}
     */
    private buildAssets({project, buildTaskOptions}, subscriber);
    /**
     * Builds all outputs
     * @param {IBuildProjectOptions} options
     * @param {ISubscriber<void>} subscriber
     * @returns {IObserver}
     */
    private buildOutputs(options, subscriber);
    /**
     * Builds an output from an IFoveaCliConfig
     * @param {IBuildOutputOptions} options
     * @param {ISubscriber<void>} subscriber
     * @returns {IObserver}
     */
    private buildOutput(options, subscriber);
    /**
     * Builds anything but the styles for a bundle
     * @param {IBuildOutputFromStylesOptions} options
     * @param {ISubscriber<void>} subscriber
     * @returns {Promise<IObserver>}
     */
    private buildOutputFromStyles(options, subscriber);
    /**
     * Builds the bundle for an output
     * @param {IBuildOutputBundleOptions} options
     * @param {ISubscriber<void>} subscriber
     * @returns {IObserver}
     */
    private buildOutputBundle(options, subscriber);
    /**
     * Builds all output files that isn't styles and isn't bundles, such as index.html and manifest.json
     * @param {IBuildOutputFilesOptions} options
     * @param {ISubscriber<void>} subscriber
     * @returns {void}
     */
    private buildOutputFiles({project: {foveaCliConfig, root}, buildTaskOptions, outputPaths, sharedRollupOptions, globalStyles, polyfills}, subscriber);
    /**
     * Serves the build
     * @param {IServeOptions} options
     * @returns {Promise<void>}
     */
    private serve({outputPaths, resource, output, buildTaskOptions});
    /**
     * Builds theme variables and global styles
     * @param {IBuildStylesOptions} options
     * @param {ISubscriber<IStylesParserServiceResult>} subscriber
     * @returns {IObserver}
     */
    private buildStyles({output, buildTaskOptions, project: {foveaCliConfig, root}}, subscriber);
    /**
     * Builds a ServiceWorker
     * @param {IBuildServiceWorkerOptions} options
     * @param {ISubscriber<IBundlerServiceBundlingEndedData>} subscriber
     * @returns {IBuildServiceWorkerResult}
     */
    private buildServiceWorker({moduleKind, watch, output, outputPaths, sharedRollupOptions, workerPolyfills, project: {root, hash, foveaCliConfig}}, subscriber);
    /**
     * Clears the given directory unless it has been cleared previously
     * @param {string} directory
     * @param {Set<string>} clearedDirectories
     * @returns {void}
     */
    private clearDestinationDirectory(directory, clearedDirectories);
    /**
     * Prints a status change to the console
     * @param status
     */
    private printStatusChange(status);
    /**
     * Updates the status of the build
     * @param {BuildStatusKind} status
     */
    private updateStatus(status);
}
