import { SiteAssetsManager } from './SiteAssetsManager';
import { SitePagesManager, AddressablePage } from './SitePagesManager';
import { SiteConfig } from './SiteConfig';
import { Page } from '../Page';
import { VariableProcessor } from '../variables/VariableProcessor';
import { ExternalManager } from '../External/ExternalManager';
import { SiteLinkManager } from '../html/SiteLinkManager';
import { PluginManager } from '../plugins/PluginManager';
import { LayoutManager } from '../Layout';
import { ProgressBar } from '../lib/progress';
type PageGenerationTask = {
    mode: string;
    pages: Page[];
};
type PageGenerationContext = {
    startTime: Date;
    numPagesGenerated: number;
    numPagesToGenerate: number;
    isCompleted: boolean;
};
/**
 * Orchestrates the site generation process.
 * Manages the build lifecycle, variable processing, plugin management,
 * and rebuilding strategies (lazy/background).
 */
export declare class SiteGenerationManager {
    rootPath: string;
    outputPath: string;
    tempPath: string;
    siteConfig: SiteConfig;
    siteConfigPath: string;
    variableProcessor: VariableProcessor;
    pluginManager: PluginManager;
    siteLinkManager: SiteLinkManager;
    externalManager: ExternalManager;
    layoutManager: LayoutManager;
    sitePages: SitePagesManager;
    siteAssets: SiteAssetsManager;
    forceReload: boolean;
    backgroundBuildMode: string | boolean;
    stopGenerationTimeThreshold: Date;
    postBackgroundBuildFunc: () => void;
    onePagePath: string;
    currentPageViewed: string;
    currentOpenedPages: string[];
    toRebuild: Set<string>;
    constructor(rootPath: string, outputPath: string, onePagePath: string, forceReload: boolean | undefined, siteConfigPath: string | undefined, isDevMode: any, backgroundBuildMode: boolean, postBackgroundBuildFunc: () => void);
    configure(siteAssets: SiteAssetsManager, sitePages: SitePagesManager): void;
    static rejectHandler(error: unknown, removeFolders: string[]): Promise<void>;
    beforeSiteGenerate(): void;
    /**
     * Changes the site variable of the current page being viewed, building it if necessary.
     * @param normalizedUrl BaseUrl-less and extension-less url of the page
     * @return Boolean of whether the page needed to be rebuilt
     */
    changeCurrentPage(normalizedUrl: string): boolean;
    /**
     * Changes the list of current opened pages
     * @param normalizedUrls Collection of normalized url of pages taken from the clients
     * ordered from most-to-least recently opened
     */
    changeCurrentOpenedPages(normalizedUrls: string[]): void;
    /**
     * Read and stores the site config from site.json, in Site, SitePages and SiteAssets.
     * Overwrite the default base URL if it's specified by the user.
     * @param baseUrl user defined base URL (if exists)
     */
    readSiteConfig(baseUrl?: string): Promise<SiteConfig>;
    /**
     * Collects the base url map in the site/subsites
     */
    collectBaseUrl(): void;
    /**
     * Set up the managers used with the configurations.
     */
    buildManagers(baseUrlMap: Set<string>): void;
    /**
     * Collects the user defined variables map in the site/subsites
     */
    collectUserDefinedVariablesMap(): void;
    /**
     * Collects the user defined variables map in the site/subsites
     * if there is a change in the variables file
     * @param filePaths array of paths corresponding to files that have changed
     */
    collectUserDefinedVariablesMapIfNeeded(filePaths: string[]): boolean;
    /**
     * Generate the website.
     * @param baseUrl user defined base URL (if exists)
     */
    generate(baseUrl: string | undefined): Promise<any>;
    /**
     * Helper function for generate().
     */
    calculateBuildTimeForGenerate(startTime: Date, lazyWebsiteGenerationString: string): void;
    /**
     * Build all pages of the site
     */
    buildSourceFiles(): Promise<void>;
    /**
     * Adds all pages except the viewed pages to toRebuild, flagging them for lazy building later.
     */
    lazyBuildAllPagesNotViewed(viewedPages: string | string[]): Promise<void>;
    /**
     * Only build landing page of the site, building more as the author goes to different links.
     */
    lazyBuildSourceFiles(): Promise<void>;
    /**
     * Helper function for lazyBuildSourceFiles().
     */
    copyLazySourceFiles(): Promise<void>;
    _rebuildAffectedSourceFiles(filePaths: string | string[]): Promise<void>;
    _rebuildPagesBeingViewed(normalizedUrls: string[]): Promise<void>;
    /**
     * Helper function for _rebuildPagesBeingViewed().
     */
    static calculateBuildTimeForRebuildPagesBeingViewed(startTime: Date): void;
    _backgroundBuildNotViewedFiles(): Promise<void>;
    /**
     * Generates pages that are marked to be built/rebuilt.
     * @returns A Promise that resolves once all pages are generated.
     */
    generatePagesMarkedToRebuild(): Promise<boolean>;
    _rebuildSourceFiles(): Promise<void>;
    /**
     * Helper function for _rebuildSourceFiles().
     */
    rebuildRequiredPages(): Promise<void>;
    /**
     * Writes the site data to siteData.json
     * @param verbose Flag to emit logs of the operation
     */
    writeSiteData(verbose?: boolean): Promise<void>;
    stopOngoingBuilds(): void;
    /**
     * Runs the supplied page generation tasks according to the specified mode of each task.
     * A page generation task can be a sequential generation or an asynchronous generation.
     * @param pageGenerationTasks Array of page generation tasks
     * @returns A Promise that resolves to a boolean which indicates whether the generation
     * ran to completion
     */
    runPageGenerationTasks(pageGenerationTasks: PageGenerationTask[]): Promise<boolean>;
    /**
     * Generate pages sequentially. That is, the pages are generated
     * one-by-one in order.
     * @param pages Pages to be generated
     * @param progressBar Progress bar of the overall generation process
     * @returns A Promise that resolves to a boolean which indicates whether the generation
     * ran to completion
     */
    generatePagesSequential(pages: Page[], progressBar: ProgressBar): Promise<boolean>;
    /**
     * Creates the supplied pages' page generation promises at a throttled rate.
     * This is done to avoid pushing too many callbacks into the event loop at once. (#1245)
     * @param pages Pages to be generated
     * @param progressBar Progress bar of the overall generation process
     * @returns A Promise that resolves to a boolean which indicates whether the generation
     * ran to completion
     */
    generatePagesAsyncThrottled(pages: Page[], progressBar: ProgressBar): Promise<boolean>;
    /**
     * Helper function for generatePagesAsyncThrottled().
     */
    generateProgressBarStatus(progressBar: ProgressBar, context: PageGenerationContext, pageGenerationQueue: (() => Promise<void>)[], resolve: ((arg0: boolean) => any)): void;
    /**
     * Renders all pages specified in site configuration file to the output folder
     */
    generatePages(): Promise<boolean>;
    /**
     * Renders only the starting page for lazy loading to the output folder.
     */
    generateLandingPage(): Promise<void>;
    regenerateAffectedPages(filePaths: string[]): Promise<void>;
    /**
     * Helper function for regenerateAffectedPages().
     */
    calculateBuildTimeForRegenerateAffectedPages(startTime: Date): void;
    private _setTimestampVariable;
    rebuildPagesBeingViewed: (this: any, newItem?: string | string[] | undefined) => Promise<unknown>;
    /**
     * Rebuild pages that are affected by changes in filePaths
     * @param filePaths a single path or an array of paths corresponding to the files that have changed
     */
    rebuildAffectedSourceFiles: (this: any, newItem?: string | string[] | undefined) => Promise<unknown>;
    /**
     * Rebuild all pages
     */
    rebuildSourceFiles: (this: any, newItem?: string | string[] | undefined) => Promise<unknown>;
    /**
     * Builds pages that are yet to build/rebuild in the background
     */
    backgroundBuildNotViewedFiles: (this: any, newItem?: string | string[] | undefined) => Promise<unknown>;
    reloadSiteConfig(): Promise<void>;
    /**
     * Handles the rebuilding of modified pages
     */
    handlePageReload(oldAddressablePages: AddressablePage[], oldPagesSrc: string[], oldSiteConfig: SiteConfig): Promise<void>;
}
export {};
//# sourceMappingURL=SiteGenerationManager.d.ts.map