import { type InterpolationMode } from "../vite/interpolation-plugin.js"; export interface ClientBuildOptions { /** Project root (absolute). */ root: string; /** Absolute path to the user's Vite client config (e.g. vite.client.config.ts). */ userConfigPath: string; /** Absolute path to the app directory (used by the interpolation plugin). */ appDir: string; /** Absolute path to the islands directory (used by the interpolation plugin). */ islandsDir: string; /** Output directory for the client bundle (absolute). */ outDir: string; /** Optional base path. */ base?: string; /** Optional log prefix. */ logPrefix?: string; /** * How the legacy interpolation transform is handled (default: "auto"). * With a Nix.js core that supports partial attribute interpolation natively * the transform is not applied; use "legacy" for migrations against older * cores and "off" to never transform. */ interpolation?: InterpolationMode; } export interface ClientBuildResult { /** Output directory (same as `outDir` input). */ outDir: string; /** Number of chunks/assets emitted, if reported by Vite. */ outputCount: number; } /** * Build the client hydration bundle using the Vite JavaScript API. * * The user's config is loaded programmatically and the nix-js interpolation * plugin is injected so partial attribute interpolations inside islands are * transformed before reaching the browser. */ export declare function buildClientBundle(options: ClientBuildOptions): Promise; export interface AtomicStageOptions { /** Final destination directory (absolute). */ outDir: string; /** Build into this temp directory first, then rename to `outDir`. */ tempDir?: string; /** Whether to preserve existing content in `outDir` during the swap. */ keepExisting?: boolean; } export interface AtomicStage { tempDir: string; /** Call after the build succeeds to atomically swap temp → outDir. */ commit: () => Promise; /** Call on failure to clean up the temp directory. */ rollback: () => Promise; } /** * Prepare an atomic staging directory for build output. * * Usage: * const stage = await beginAtomicStage({ outDir }); * try { * await buildInto(stage.tempDir); * await stage.commit(); * } catch (err) { * await stage.rollback(); * throw err; * } */ export declare function beginAtomicStage(options: AtomicStageOptions): Promise; export interface CopyPublicAssetsOptions { /** Absolute path to the public directory. */ publicDir: string; /** Absolute path to the output directory. */ outDir: string; } /** * Copy the public directory into the output directory. * Returns the number of files copied. */ export declare function copyPublicAssets(options: CopyPublicAssetsOptions): Promise;