import type { RouteManifest } from '../manifest/types';
import type { NextConfigObject, SentryBuildOptions, TurbopackOptions } from '../types';
import type { VercelCronsConfigResult } from './getFinalConfigObjectUtils';
/**
 * Information about the active bundler and feature support based on Next.js version.
 */
export type BundlerInfo = {
    isTurbopack: boolean;
    isWebpack: boolean;
    isTurbopackSupported: boolean;
};
/**
 * Detects which bundler is active (webpack vs turbopack) and whether turbopack features are supported.
 */
export declare function getBundlerInfo(nextJsVersion: string | undefined): BundlerInfo;
/**
 * Warns if turbopack is in use but the detected Next.js version is unsupported.
 */
export declare function maybeWarnAboutUnsupportedTurbopack(nextJsVersion: string | undefined, bundlerInfo: BundlerInfo, silent?: boolean): void;
/**
 * Warns if `moduleMetadata` is set on a Turbopack build, where it currently has no effect.
 *
 * The Turbopack metadata loader only injects `applicationKey`; arbitrary `moduleMetadata` is
 * webpack-only for now. Without this warning the option would be a silent no-op on Next.js 16+,
 * where Turbopack is the default.
 */
export declare function maybeWarnAboutTurbopackModuleMetadata(userSentryOptions: SentryBuildOptions, bundlerInfo: BundlerInfo): void;
/**
 * Warns if `useRunAfterProductionCompileHook` is enabled in webpack mode but the Next.js version is unsupported.
 */
export declare function maybeWarnAboutUnsupportedRunAfterProductionCompileHook(nextJsVersion: string | undefined, userSentryOptions: SentryBuildOptions, bundlerInfo: BundlerInfo): void;
/**
 * Constructs turbopack config when turbopack is active.
 */
export declare function maybeConstructTurbopackConfig(incomingUserNextConfigObject: NextConfigObject, userSentryOptions: SentryBuildOptions, routeManifest: RouteManifest | undefined, nextJsVersion: string | undefined, bundlerInfo: BundlerInfo, vercelCronsConfigResult: VercelCronsConfigResult): TurbopackOptions | undefined;
/**
 * Resolves whether to wire up orchestrion build-time instrumentation.
 *
 * Only on when the transform can actually run: Turbopack needs rule `condition`s (Next.js 16+), and
 * webpack needs Sentry's config. Otherwise un-externalizing the bundle-safe packages would leave
 * them bundled *and* uninstrumented, so keep the feature off.
 */
export declare function resolveBuildTimeInstrumentationOption(userSentryOptions: SentryBuildOptions, bundlerInfo: BundlerInfo, nextJsVersion: string | undefined): boolean;
/**
 * Resolves whether to use the `runAfterProductionCompile` hook based on options and bundler.
 */
export declare function resolveUseRunAfterProductionCompileHookOption(userSentryOptions: SentryBuildOptions, bundlerInfo: BundlerInfo): boolean;
/**
 * Hooks into Next.js' `compiler.runAfterProductionCompile` to run Sentry release/sourcemap handling.
 *
 * Note: this mutates `incomingUserNextConfigObject`.
 */
export declare function maybeSetUpRunAfterProductionCompileHook({ incomingUserNextConfigObject, userSentryOptions, releaseName, nextJsVersion, bundlerInfo, turboPackConfig, shouldUseRunAfterProductionCompileHook, }: {
    incomingUserNextConfigObject: NextConfigObject;
    userSentryOptions: SentryBuildOptions;
    releaseName: string | undefined;
    nextJsVersion: string | undefined;
    bundlerInfo: BundlerInfo;
    turboPackConfig: TurbopackOptions | undefined;
    shouldUseRunAfterProductionCompileHook: boolean;
}): void;
/**
 * For supported turbopack builds, auto-enables browser sourcemaps and defaults to deleting them after upload.
 *
 * Note: this mutates both `incomingUserNextConfigObject` and `userSentryOptions`.
 */
export declare function maybeEnableTurbopackSourcemaps(incomingUserNextConfigObject: NextConfigObject, userSentryOptions: SentryBuildOptions, bundlerInfo: BundlerInfo): void;
/**
 * Returns the patch which ensures server-side auto-instrumented packages are externalized.
 */
export declare function getServerExternalPackagesPatch(incomingUserNextConfigObject: NextConfigObject, nextMajor: number | undefined, buildTimeInstrumentation?: boolean): Partial<NextConfigObject>;
/**
 * Returns the patch for injecting Sentry's webpack config function (if enabled and applicable).
 */
export declare function getWebpackPatch({ incomingUserNextConfigObject, userSentryOptions, releaseName, routeManifest, nextJsVersion, shouldUseRunAfterProductionCompileHook, bundlerInfo, vercelCronsConfigResult, }: {
    incomingUserNextConfigObject: NextConfigObject;
    userSentryOptions: SentryBuildOptions;
    releaseName: string | undefined;
    routeManifest: RouteManifest | undefined;
    nextJsVersion: string | undefined;
    shouldUseRunAfterProductionCompileHook: boolean;
    bundlerInfo: BundlerInfo;
    vercelCronsConfigResult: VercelCronsConfigResult;
}): Partial<NextConfigObject>;
/**
 * Applies the `bundleSizeOptimizations` flags to Turbopack builds through `compiler.define`.
 *
 * Note: this mutates `incomingUserNextConfigObject`.
 */
export declare function maybeSetTurbopackTreeshakeDefines(incomingUserNextConfigObject: NextConfigObject, userSentryOptions: SentryBuildOptions, bundlerInfo: BundlerInfo): void;
/**
 * Returns the patch for adding turbopack config (if enabled and supported).
 */
export declare function getTurbopackPatch(bundlerInfo: BundlerInfo, turboPackConfig: TurbopackOptions | undefined): Partial<NextConfigObject>;
//# sourceMappingURL=getFinalConfigObjectBundlerUtils.d.ts.map