/** Module Server - serves transformed ESM modules at /_vf_modules/* URLs */ import type { RuntimeAdapter } from "../../platform/adapters/base.js"; import { type DependencyPinningSourceInput } from "../../transforms/esm/package-registry.js"; import type { VeryfrontConfig } from "../../config/index.js"; import { type BrowserModuleBundleLimitOverrides } from "../../server/shared/browser-module-bundler.js"; /** * Embedded polyfills for compiled Deno binaries. * * In compiled binaries, framework source files are not accessible via filesystem * because they're not statically imported (only referenced as path strings). * These inline polyfills ensure browser compatibility without filesystem I/O. * * @see src/platform/polyfills/embedded-polyfills.test.ts - validates completeness * @see getRequiredPolyfillPaths() in node-builtin-strategy.ts - source of truth for required paths */ export declare const EMBEDDED_POLYFILLS: Record; export interface ModuleServerOptions { /** Project identifier (directory path, legacy naming) */ projectId: string; /** Project root directory */ projectDir: string; /** Runtime adapter */ adapter: RuntimeAdapter; /** Development mode. Defaults to `false`: an omitted flag must not serve * unminified modules or leak raw transform errors to a browser. */ dev?: boolean; /** Project UUID for multi-project mode (from domain lookup) */ projectUUID?: string; /** Project slug for multi-project mode (from proxy headers or domain lookup) */ projectSlug?: string; /** Branch name for branch-aware file resolution */ branch?: string | null; /** Release ID for production mode (published files) */ releaseId?: string | null; /** Stable release/branch identity paired with dependency snapshot history. */ contentSourceId?: string; /** Explicitly selects host FS for local projects and adapter FS for proxy projects. */ isLocalProject?: boolean; /** * Whether modules are being served by the shared multi-project runtime. * Production release admission fails closed when this is omitted; only an * explicitly standalone runtime may bypass the hosted release manifest. */ isProxyMode?: boolean; /** * Enables the legacy SSR transform only for an explicitly admitted local * project. Never derive this capability from request headers or query data. */ allowSSRModuleMode?: boolean; /** * Restrict module imports to specific directories (opt-in security). * When not set, users can import from any directory in the project. */ allowedImportDirs?: string[]; /** React version for transforms (from project config) */ reactVersion?: string; /** Project config whose explicit React override wins over dependency detection. */ config?: VeryfrontConfig; /** Canonical request-scoped package source supplied by the server handler. */ dependencyPinningSource?: DependencyPinningSourceInput; /** Request mode ("preview" | "production") for studio features like node positions */ mode?: string; /** Optional operator tightening for request-triggered browser graph compilation. */ browserModuleBundleLimits?: BrowserModuleBundleLimitOverrides; } /** Serve transformed module at /_vf_modules/* path */ export declare function serveModule(req: Request, options: ModuleServerOptions): Promise; /** * Check if request is for a module * * @param req - HTTP request * @returns true if request path starts with /_vf_modules/ */ export declare function isModuleRequest(req: Request): boolean; /** * Content type for a dev module response. * * Exported for testing. */ export declare function getDevModuleContentType(modulePath: string): string; //# sourceMappingURL=module-server.d.ts.map