import type { ASTNode } from "../../../extensions/parser/index.js"; export type WorkerUrlClassification = { kind: "remote" | "dynamic"; } | { kind: "file"; specifier: null; } | { kind: "local"; specifier: string | null; requiresUnqualifiedWorkerShim: boolean; resolutionBase: "module" | "route"; }; export interface SourceCapabilityAnalysis { readonly hasDynamicCodeGeneration: boolean; readonly workers: readonly WorkerUrlClassification[]; readonly moduleSpecifiers: readonly string[]; readonly hasUnconstrainedDynamicImport: boolean; } export interface ParseOnlyParser { parse(options: { code: string; filePath?: string; }): Promise; } export declare function __setSourceCapabilityParserLoaderForTests(loader?: (() => Promise) | undefined): void; export type ImportMetaSpecifierResolver = (specifier: string, moduleUrl: string) => string | null | Promise; export type ImportMetaResolveCallRewriter = (specifier: string, moduleUrl: string) => string | Promise; export type ImportMetaResolveArgumentRewriter = (argumentSource: string, moduleUrl: string) => string | Promise; export type ImportMetaResolveReferenceRewriter = (moduleUrl: string) => string | Promise; /** Identify a real unbound CommonJS `module` reference without matching inert text. */ export declare function usesUnboundCommonJsModule(source: string): Promise; /** * Rebind CommonJS require value references to a caller-provided module-local * require. Static direct calls remain intact so the bundler can still * traverse them. */ export declare function rewriteUnboundCommonJsDynamicRequire(source: string, replacementIdentifier: string, staticRequireRecorderIdentifier?: string): Promise; /** * Bind location-sensitive import metadata to its declaring module before * bundling, without touching inert source text. */ export declare function rewriteImportMetaLocations(source: string, moduleUrl: string, resolveSpecifier?: ImportMetaSpecifierResolver, rewriteResolveCall?: ImportMetaResolveCallRewriter, rewriteResolveArgument?: ImportMetaResolveArgumentRewriter, rewriteResolveReference?: ImportMetaResolveReferenceRewriter): Promise; /** * Parse executable JavaScript/TypeScript and classify capabilities that a raw * text scan cannot distinguish from inert strings, comments, types, or local * bindings. A null result means the parser could not read the source; callers * must retain their conservative fail-closed fallback in that case. */ export declare function analyzeSourceCapabilities(source: string): Promise; //# sourceMappingURL=source-capability-analyzer.d.ts.map