import type { NextConfigComplete, NextConfigRuntime } from '../server/config-shared';
import type { ExperimentalPPRConfig } from '../server/lib/experimental/ppr';
import type { ServerRuntime } from '../types';
import type { BuildManifest } from '../server/get-page-files';
import { type CustomRoutes } from '../lib/load-custom-routes';
import type { MiddlewareManifest } from './webpack/plugins/middleware-plugin';
import type { WebpackLayerName } from '../lib/constants';
import '../server/require-hook';
import '../server/node-polyfill-crypto';
import '../server/node-environment';
import type { PageExtensions } from './page-extensions-type';
import type { FallbackMode } from '../lib/fallback';
import type { OutgoingHttpHeaders } from 'http';
import type { AppSegmentConfig } from './segment-config/app/app-segment-config';
import type { AppSegment } from './segment-config/app/app-segments';
import type { PrerenderedRoute } from './static-paths/types';
import type { CacheControl } from '../server/lib/cache-control';
import type { TurbopackResult } from './swc/types';
import type { FunctionsConfigManifest, ManifestRoute } from './index';
export type ROUTER_TYPE = 'pages' | 'app';
export type DynamicManifestRoute = ManifestRoute & {
    /**
     * The source page that this route is based on. This is used to determine the
     * source page for the route and is only relevant for app pages where PPR is
     * enabled and the page differs from the source page.
     */
    sourcePage: string | undefined;
};
export declare function unique<T>(main: ReadonlyArray<T>, sub: ReadonlyArray<T>): T[];
export declare function difference<T>(main: ReadonlyArray<T> | ReadonlySet<T>, sub: ReadonlyArray<T> | ReadonlySet<T>): T[];
export declare function isMiddlewareFilename(file?: string | null): file is "middleware" | "proxy" | "src/middleware" | "src/proxy";
export declare function isInstrumentationHookFilename(file?: string | null): file is "instrumentation" | "src/instrumentation";
export interface PageInfo {
    originalAppPath: string | undefined;
    isStatic: boolean;
    isSSG: boolean;
    /**
     * If true, it means that the route has partial prerendering enabled.
     */
    isRoutePPREnabled: boolean;
    ssgPageRoutes: string[] | null;
    initialCacheControl: CacheControl | undefined;
    pageDuration: number | undefined;
    ssgPageDurations: number[] | undefined;
    runtime: ServerRuntime;
    hasEmptyStaticShell?: boolean;
    hasPostponed?: boolean;
    isDynamicAppRoute?: boolean;
}
export type PageInfos = Map<string, PageInfo>;
export interface RoutesUsingEdgeRuntime {
    [route: string]: 0;
}
export declare function collectRoutesUsingEdgeRuntime(input: PageInfos): RoutesUsingEdgeRuntime;
/**
 * Processes and categorizes build issues, then logs them as warnings, errors, or fatal errors.
 * Stops execution if fatal issues are encountered.
 *
 * @param entrypoints - The result object containing build issues to process.
 * @param isDev - A flag indicating if the build is running in development mode.
 * @return This function does not return a value but logs or throws errors based on the issues.
 * @throws {Error} If a fatal issue is encountered, this function throws an error. In development mode, we only throw on
 *                 'fatal' and 'bug' issues. In production mode, we also throw on 'error' issues.
 */
export declare function printBuildErrors(entrypoints: TurbopackResult, isDev: boolean): void;
export declare function printTreeView(lists: {
    pages: ReadonlyArray<string>;
    app: ReadonlyArray<string> | undefined;
}, pageInfos: Map<string, PageInfo>, { pagesDir, pageExtensions, middlewareManifest, functionsConfigManifest, useStaticPages404, hasGSPAndRevalidateZero, }: {
    pagesDir?: string;
    pageExtensions: PageExtensions;
    buildManifest: BuildManifest;
    middlewareManifest: MiddlewareManifest;
    functionsConfigManifest: FunctionsConfigManifest;
    useStaticPages404: boolean;
    hasGSPAndRevalidateZero: Set<string>;
}): Promise<void>;
export declare function printCustomRoutes({ redirects, rewrites, headers, }: CustomRoutes): void;
type PageIsStaticResult = {
    isRoutePPREnabled?: boolean;
    isStatic?: boolean;
    hasServerProps?: boolean;
    hasStaticProps?: boolean;
    prerenderedRoutes: PrerenderedRoute[] | undefined;
    prerenderFallbackMode: FallbackMode | undefined;
    rootParamKeys: readonly string[] | undefined;
    isNextImageImported?: boolean;
    traceIncludes?: string[];
    traceExcludes?: string[];
    appConfig?: AppSegmentConfig;
};
export declare function isPageStatic({ dir, page, distDir, configFileName, httpAgentOptions, locales, defaultLocale, parentId, pageRuntime, edgeInfo, pageType, cacheComponents, authInterrupts, originalAppPath, isrFlushToDisk, cacheMaxMemorySize, nextConfigOutput, cacheHandler, cacheHandlers, cacheLifeProfiles, pprConfig, buildId, sriEnabled, }: {
    dir: string;
    page: string;
    distDir: string;
    cacheComponents: boolean;
    authInterrupts: boolean;
    configFileName: string;
    httpAgentOptions: NextConfigComplete['httpAgentOptions'];
    locales?: readonly string[];
    defaultLocale?: string;
    parentId?: any;
    edgeInfo?: any;
    pageType?: 'pages' | 'app';
    pageRuntime?: ServerRuntime;
    originalAppPath?: string;
    isrFlushToDisk?: boolean;
    cacheMaxMemorySize: number;
    cacheHandler?: string;
    cacheHandlers?: Record<string, string | undefined>;
    cacheLifeProfiles?: {
        [profile: string]: import('../server/use-cache/cache-life').CacheLife;
    };
    nextConfigOutput: 'standalone' | 'export' | undefined;
    pprConfig: ExperimentalPPRConfig | undefined;
    buildId: string;
    sriEnabled: boolean;
}): Promise<PageIsStaticResult>;
type ReducedAppConfig = Pick<AppSegmentConfig, 'revalidate' | 'dynamic' | 'fetchCache' | 'preferredRegion' | 'runtime' | 'maxDuration'>;
/**
 * Collect the app config from the generate param segments. This only gets a
 * subset of the config options.
 *
 * @param segments the generate param segments
 * @returns the reduced app config
 */
export declare function reduceAppConfig(segments: Pick<AppSegment, 'config'>[]): ReducedAppConfig;
export declare function hasCustomGetInitialProps({ page, distDir, checkingApp, sriEnabled, }: {
    page: string;
    distDir: string;
    checkingApp: boolean;
    sriEnabled: boolean;
}): Promise<boolean>;
export declare function getDefinedNamedExports({ page, distDir, sriEnabled, }: {
    page: string;
    distDir: string;
    sriEnabled: boolean;
}): Promise<ReadonlyArray<string>>;
export declare function detectConflictingPaths(combinedPages: string[], ssgPages: Set<string>, additionalGeneratedSSGPaths: Map<string, string[]>): void;
export declare function copyTracedFiles(dir: string, distDir: string, pageKeys: readonly string[], appPageKeys: readonly string[] | undefined, tracingRoot: string, serverConfig: NextConfigRuntime, middlewareManifest: MiddlewareManifest, hasNodeMiddleware: boolean, hasInstrumentationHook: boolean, staticPages: Set<string>): Promise<void>;
export declare function isReservedPage(page: string): boolean;
export declare function isAppBuiltinPage(page: string): boolean;
export declare function isCustomErrorPage(page: string): page is "/500" | "/404";
export declare function isMiddlewareFile(file: string): file is "/middleware" | "/src/middleware" | "/proxy" | "/src/proxy";
export declare function isProxyFile(file: string): file is "/proxy" | "/src/proxy";
export declare function isInstrumentationHookFile(file: string): file is "/instrumentation" | "/src/instrumentation";
export declare function getPossibleInstrumentationHookFilenames(folder: string, extensions: string[]): string[];
export declare function getPossibleMiddlewareFilenames(folder: string, extensions: string[]): string[];
export declare class NestedMiddlewareError extends Error {
    constructor(nestedFileNames: string[], mainDir: string, pagesOrAppDir: string);
}
export declare function getSupportedBrowsers(dir: string, isDevelopment: boolean): string[];
export declare function shouldUseReactServerCondition(layer: WebpackLayerName | null | undefined): boolean;
export declare function isWebpackClientOnlyLayer(layer: WebpackLayerName | null | undefined): boolean;
export declare function isWebpackDefaultLayer(layer: WebpackLayerName | null | undefined): boolean;
export declare function isWebpackBundledLayer(layer: WebpackLayerName | null | undefined): boolean;
export declare function isWebpackAppPagesLayer(layer: WebpackLayerName | null | undefined): boolean;
export declare function collectMeta({ status, headers, }: {
    status?: number;
    headers?: OutgoingHttpHeaders;
}): {
    status?: number;
    headers?: Record<string, string>;
};
export declare const RSPACK_DEFAULT_LAYERS_REGEX: RegExp;
/**
 * Converts a page to a manifest route.
 *
 * @param page The page to convert to a route.
 * @returns A route object.
 */
export declare function pageToRoute(page: string): ManifestRoute;
/**
 * Converts a page to a dynamic manifest route.
 *
 * @param page The page to convert to a route.
 * @param sourcePage The source page that this route is based on. This is used
 * to determine the source page for the route and is only relevant for app
 * pages when PPR is enabled on them.
 * @returns A route object.
 */
export declare function pageToRoute(page: string, sourcePage: string | undefined): DynamicManifestRoute;
export {};
