import type { BundleOptions, Bundler, TypeScriptDecoratorOptions } from "../../../extensions/bundler/index.js"; import type { APIRoute, LoadHostModuleOptions, LoadModuleOptions } from "./types.js"; import { type PreparedWorkerModule } from "../../../security/sandbox/worker-types.js"; export { generateCompiledBinaryRequireShim, getNodeExternalPackagesToResolve, loadVeryfrontExportsMap, resolveEsmUserDependencies, resolveNodePackageToFileUrl, rewriteCompiledBinaryUserDependencyImports, rewriteCompiledBinaryVeryfrontImports, rewriteDenoNodeBuiltinImports, rewriteDenoNpmDependencyImports, rewriteNodeExternalImports, } from "./external-import-rewriter.js"; export { toCjsDestructureBindings } from "./loader-helpers.js"; export declare function loadHandlerModule(options: LoadHostModuleOptions): Promise; /** * Build an API route without importing or evaluating project code in the host * realm. Shared runtimes pass this immutable source snapshot to the project * worker, which rehashes and evaluates it under tenant-scoped permissions. */ export declare function prepareHandlerModule(options: LoadModuleOptions): Promise; /** @internal Exported for the runtime-selection regression test. */ export declare function bundlerForcesTypeScript(bundler: Pick | undefined, options: TypeScriptDecoratorOptions): boolean; /** @internal Exported for the runtime-selection regression test. */ export declare function typeScriptBuildOptions(projectDir: string, options: TypeScriptDecoratorOptions, bundleTypeScript: boolean): Pick & { absWorkingDir?: string; }; /** * True when a module failed to load because Deno could not resolve one of its * import specifiers, rather than because the module itself is broken. */ export declare function isSpecifierResolutionError(error: unknown): boolean; /** Whether the runtime resolves this specifier through an import map or an installed package. */ export declare function isBareModuleSpecifier(specifier: string): boolean; /** Whether a non-relative specifier is independent of Deno import-map remapping. */ export declare function canDirectImportSpecifier(specifier: string): boolean; /** A Deno import map with paths normalized against the file that declared it. */ export interface DenoImportMap { imports: Record; scopes: Record>; } /** * The reading of a project's files the config parser needs. The host * filesystem satisfies it, and so does a project snapshot, whose adapter is the * only place an adapter-backed project's config exists. */ export interface ModuleTextReader { readTextFile(path: string): Promise; } /** * The import map the runtime applies to a directly imported route, or null * when the project has one this loader cannot vet. * * Deno resolves a route's bare specifiers through the project's own config, * which the bundler never reads. A config's `importMap` field is followed to * the file it names, and scope prefixes are preserved so both the graph walk * and the bundler select mappings using the importing file. Null means * "undecidable": a config * this parser cannot read in full, whose every bare specifier then bundles. A * project with no Deno config has no map: bare specifiers can only reach * installed packages. */ export declare function readDenoImportMap(fs: ModuleTextReader, projectDir: string): Promise; /** * The target the import map selects for `specifier`, or null when it leaves it * alone. Matching scope prefixes are tried from longest to shortest; if none * maps the specifier, lookup falls back to the top-level imports. * * An exact key wins over a trailing-slash prefix, and the longest prefix wins * among prefixes, which is how the runtime picks between overlapping entries; * a prefix key carries the remaining specifier onto each of its targets. */ export declare function lookupImportMapEntry(importMap: DenoImportMap, specifier: string, referrer?: string): string | null; export declare function getUserDependencies(allDeps: ReadonlyMap): Map; //# sourceMappingURL=loader.d.ts.map