import type { ModuleIr } from "./ir.js"; import { type CompilerModuleContext } from "./compiler-module-context.js"; export { transformCompilerModuleContext } from "./transform.js"; export { stripTypeScriptWithOxc } from "./oxc-transform.js"; export type { CompilerModuleContext } from "./compiler-module-context.js"; import type { AnalyzeModuleOptions, CompileTarget, Diagnostic } from "./types.js"; /** Configures source code, filename, target, and analysis options for IR generation. */ export interface AnalyzeToIrInput { code: string; filename: string; target: CompileTarget; options?: AnalyzeModuleOptions; } /** Contains the module IR and diagnostics produced by compiler analysis. */ export interface AnalyzeToIrOutput { ir: ModuleIr; diagnostics: Diagnostic[]; usedTypescriptFallback?: boolean; } /** Describes a static import declaration and the local names it introduces. */ export interface StaticImportReference { localNames: string[]; sideEffect: boolean; source: string; } /** Describes one specifier inside a static import declaration. */ export interface StaticImportSpecifierReference { importedName: string; kind: "default" | "named" | "namespace"; localName: string; } /** Describes a static import declaration with its individual specifiers. */ export interface ClientRouteStaticImportReference extends StaticImportReference { specifiers: StaticImportSpecifierReference[]; } /** Describes a static export declaration and the names it exports. */ export interface StaticExportReference { exportedNames: string[]; exportAll: boolean; specifiers: StaticExportSpecifierReference[]; source: string; } /** Describes one specifier inside a static export declaration. */ export interface StaticExportSpecifierReference { exportedName: string; localName: string; } /** Describes render and client-runtime reachability for one top-level export. */ export interface TopLevelExportRenderInfo { calledComponentRoots: string[]; clientRuntime: boolean; localName?: string | undefined; name: string; renderedComponentRoots: string[]; } /** Summarizes route-module imports, exports, directives, references, and reachable render roots. */ export interface ClientRouteModuleAnalysis { clientRuntime: boolean; defaultExportIdentifier: string | undefined; hasUseClientDirective: boolean; hasUseServerDirective: boolean; componentCallRoots: string[]; identifierReferences: string[]; jsxComponentRoots: string[]; reachableExportRenderedComponentNames: Record; reachableExportRenderedComponentRoots: Record; reachableRenderedComponentNames: string[]; reachableRenderedComponentRoots: string[]; staticExports: StaticExportReference[]; staticImports: ClientRouteStaticImportReference[]; topLevelExportRenderInfo: TopLevelExportRenderInfo[]; } /** Describes a named form action reference and its source span. */ export interface FormActionReference { end: number; name: string; start: number; } /** Describes a form action expression reference and both wrapper and expression source spans. */ export interface FormActionExpressionReference { end: number; expression: string; expressionEnd: number; expressionStart: number; start: number; } /** Analyzes source code into compiler IR with diagnostics. */ export declare function analyzeToIr(input: AnalyzeToIrInput): AnalyzeToIrOutput; /** Analyzes a pre-parsed compiler module context into compiler IR with diagnostics. */ export declare function analyzeCompilerModuleContextToIr(context: CompilerModuleContext, input: Omit): AnalyzeToIrOutput; /** Creates a compiler module context from source code and an optional filename. */ export declare function createCompilerModuleContext(input: { code: string; filename?: string | undefined; }): CompilerModuleContext; /** Checks whether a module declares any of the given names as top-level exports. */ export declare function hasTopLevelExportDeclaration(input: { code: string; filename?: string | undefined; names: readonly string[]; }): boolean; /** Reads a top-level exported boolean literal by name, ignoring comments and non-literal values. */ export declare function readTopLevelBooleanExport(input: { code: string; filename?: string | undefined; name: string; }): boolean | undefined; /** Reads a top-level exported boolean literal from a cached compiler module context. */ export declare function readTopLevelBooleanExportFromContext(context: CompilerModuleContext, name: string): boolean | undefined; /** Removes top-level export declarations for selected names while preserving their values where possible. */ export declare function stripTopLevelExportDeclarations(input: { code: string; filename?: string | undefined; names: readonly string[]; }): string; /** Converts selected top-level export declarations into non-exported declarations. */ export declare function demoteTopLevelExportDeclarations(input: { code: string; filename?: string | undefined; names: readonly string[]; }): string; /** Removes unused static value imports while preserving side-effect and type-only imports. */ export declare function stripUnusedStaticValueImports(input: { code: string; filename?: string | undefined; }): string; /** Collects module specifier strings from static import and export declarations. */ export declare function collectStaticModuleSpecifiers(input: { code: string; filename?: string | undefined; }): string[]; /** Collects static import declarations and their local binding names. */ export declare function collectStaticImportReferences(input: { code: string; filename?: string | undefined; }): StaticImportReference[]; /** Collects static export declarations and their exported names. */ export declare function collectStaticExportReferences(input: { code: string; filename?: string | undefined; }): StaticExportReference[]; /** Collects root component names referenced by JSX elements in a module. */ export declare function collectJsxComponentRootNames(input: { code: string; filename?: string | undefined; }): string[]; /** Collects identifier reference names from a module, excluding declarations. */ export declare function collectIdentifierReferenceNames(input: { code: string; filename?: string | undefined; }): string[]; /** Checks whether browser globals may execute during server rendering without a guard. */ export declare function hasUnguardedBrowserGlobalReference(input: { code: string; filename?: string | undefined; }): boolean; /** Collects unique named form action references from a module. */ export declare function collectFormActionReferenceNames(input: { code: string; filename?: string | undefined; }): string[]; /** Collects named form action references and their source spans from a module. */ export declare function collectFormActionReferences(input: { code: string; filename?: string | undefined; }): FormActionReference[]; /** Collects form action expression references and their source spans from a module. */ export declare function collectFormActionExpressionReferences(input: { code: string; filename?: string | undefined; }): FormActionExpressionReference[]; /** Collects value export names declared at the top level of a module. */ export declare function collectTopLevelValueExportNames(input: { code: string; filename?: string | undefined; }): string[]; /** Collects render reachability information for top-level exports in a module. */ export declare function collectTopLevelExportRenderInfo(input: { code: string; filename?: string | undefined; }): TopLevelExportRenderInfo[]; /** Analyzes a route module for directives, static imports, exports, references, and render reachability. */ export declare function collectClientRouteModuleAnalysis(input: { code: string; filename?: string | undefined; }): ClientRouteModuleAnalysis; /** Analyzes a cached compiler module context for route-module metadata. */ export declare function collectClientRouteModuleAnalysisFromContext(context: CompilerModuleContext): ClientRouteModuleAnalysis; /** Checks whether a module begins with a specific directive string. */ export declare function hasModuleDirective(input: { code: string; directive: string; filename?: string | undefined; }): boolean; /** Checks whether a module contains syntax that requires client runtime execution. */ export declare function hasClientRuntimeSyntax(input: { code: string; filename?: string | undefined; }): boolean; export type { AsyncBoundaryIr, AttributeIr, CompiledSingleNodeListIr, CompilerKeyedEventProgramIr, CompilerSelectedClassIr, ComponentIr, ComponentPropIr, ComponentRefIr, ConditionalIr, DomRefAttributeIr, DynamicAttributeIr, EventAttributeIr, ExprIr, JsxElementIr, JsxFragmentIr, JsxNodeIr, ListIr, ModuleIr, SpreadAttributeIr, StaticAttributeIr, TextIr, } from "./ir.js"; //# sourceMappingURL=internal.d.ts.map