import type { RuntimeAdapter } from "../../platform/adapters/base.js"; import type { VeryfrontConfig } from "../../config/index.js"; import type { DependencyPinningSourceInput } from "../../transforms/esm/package-registry.js"; export interface BrowserModuleBundleLimits { maxDependencies: number; maxAggregateInputBytes: number; maxOutputBytes: number; maxResolutionProbes: number; maxDurationMs: number; maxConcurrentPerIdentity: number; maxQueuedPerIdentity: number; } export type BrowserModuleBundleLimitOverrides = Partial>; /** Hard production ceilings for request-triggered browser compilation. */ export declare const DEFAULT_BROWSER_MODULE_BUNDLE_LIMITS: Readonly; /** Isolate-wide ceiling that cannot be raised by a project or caller. */ export declare const MAX_CONCURRENT_BROWSER_MODULE_BUNDLES = 8; /** Isolate-wide queue ceiling that cannot be raised by a project or caller. */ export declare const MAX_QUEUED_BROWSER_MODULE_BUNDLES = 32; export type BrowserModuleBundleFailureKind = "capacity" | "deadline" | "limit"; export declare class BrowserModuleBundleError extends Error { readonly kind: BrowserModuleBundleFailureKind; constructor(kind: BrowserModuleBundleFailureKind, message: string); } /** Server-only syntax found while validating an otherwise admitted browser entry. */ export declare class BrowserModuleBoundaryError extends Error { constructor(message: string); } /** Browser endpoint entry rejection that is safe to surface as not-found. */ export declare class BrowserModuleEntryRejectedError extends Error { constructor(cause?: unknown); } /** Requested dependency snapshot rejection that callers surface as a conflict. */ export declare class BrowserModuleDependencySnapshotError extends Error { constructor(); } export interface BrowserModuleBundlerOptions { adapter: RuntimeAdapter; projectDir: string; projectId?: string; config?: VeryfrontConfig; projectSlug?: string; importMapJson?: string; /** Absolute request origin used to identify same-origin module-map targets. */ moduleServerOrigin?: string; dependencyPinningCacheKey?: string; dependencyPinningDependencies?: Readonly>; dependencyPinningSource?: DependencyPinningSourceInput; /** Resolve this request token only after browser-bundle admission is held. */ requestedDependencyPinningCacheKey?: string; /** Caller cancellation is propagated into the bundler implementation. */ signal?: AbortSignal; /** Stable request identity used to coalesce equivalent concurrent bundles. */ singleflightKey?: string; /** Already-admitted entry snapshot. Avoids a second mutable filesystem read. */ entrySource?: string; /** Content-derived identity required whenever entrySource is supplied. */ entrySourceKey?: string; /** Require an explicit directive or `.client` filename on the entry source. */ requireClientBoundary?: boolean; /** Optional tightening of the hard limits. Values above the defaults are rejected. */ limits?: BrowserModuleBundleLimitOverrides; } export declare function getSafeBrowserModuleIdentity(absPath: string, projectDir: string): string; type ResolutionProbeState = "file" | "directory" | "other" | "missing"; export interface BrowserModuleBundle { source: string; contentHash: string; importMapHash: string; dependencyPinningCacheKey?: string; dependencyPinningDependencies?: Readonly>; dependencies: ReadonlyArray<{ path: string; contentHash: string; byteLength: number; }>; resolutionProbes: ReadonlyArray<{ path: string; state: ResolutionProbeState; }>; } export type BrowserModuleImportMapValidationOptions = Pick; export interface BrowserModuleBundleValidationOptions extends Pick { /** Rebuild and compare the effective import map through the same bounded reader. */ importMap?: BrowserModuleImportMapValidationOptions; } export declare function bundleBrowserModule(absPath: string, options: BrowserModuleBundlerOptions): Promise; export declare function bundleBrowserModuleWithMetadata(absPath: string, options: BrowserModuleBundlerOptions): Promise; export declare function validateBrowserModuleBundle(bundle: BrowserModuleBundle, options: BrowserModuleBundleValidationOptions): Promise; export {}; //# sourceMappingURL=browser-module-bundler.d.ts.map