import type { CodeIndex } from "../types.js";
export interface ImportEdge {
    from: string;
    to: string;
    type_only?: boolean;
    star_import?: boolean;
    raw?: string;
}
/**
 * Extract import paths from a source string.
 * Returns relative paths only (skips node_modules / bare specifiers).
 */
export declare function extractImports(source: string): string[];
/**
 * Extract bare-specifier imports (e.g. `@org/shared`, `@/utils`).
 * Only used by the workspace-alias / tsconfig-paths resolvers when
 * `index.workspaces` is present. Skips relative paths and skips imports
 * that look like absolute file URLs.
 *
 * Task 6 of monorepo workspace intelligence plan.
 */
export declare function extractBareImports(source: string): string[];
/**
 * Normalize an import path relative to the importing file.
 * Resolves "./foo" and "../bar" relative to the importer's directory.
 */
export declare function resolveImportPath(importerFile: string, importPath: string): string;
/**
 * Extract PHP `use` statements (FQCN imports).
 * Returns fully-qualified class/namespace names without the leading backslash.
 * These are NOT file paths — they require PSR-4 resolution against composer.json.
 *
 * Handles both single-FQCN and grouped forms:
 *   `use App\Models\User;`
 *   `use App\Models\User as U;`
 *   `use App\Models\{User, Post, Comment};`
 *   `use App\{Models\User, Services\Auth as A};`
 */
export declare function extractPhpUseStatements(source: string): string[];
/**
 * Extract Kotlin `import` statements (fully-qualified names).
 * Returns dot-separated package + class names. Wildcards (`com.example.*`) are
 * preserved as-is. These are NOT file paths — they require heuristic resolution
 * against the source root (usually `src/main/kotlin`, `src/commonMain/kotlin`, etc.).
 */
export declare function extractKotlinImports(source: string): string[];
/**
 * Heuristically resolve a Kotlin fully-qualified import to an indexed file.
 * Strategy: match the last segment of the FQN (the simple class name) against
 * file basenames. For `com.example.service.UserService`, tries to find a file
 * whose basename (without .kt/.kts) is `UserService` AND whose path contains
 * the package path `com/example/service`.
 *
 * Returns the matched file path or null if no match.
 *
 * Limitations: single-repo heuristic. Doesn't handle wildcard imports
 * (`com.example.*`) or multi-module setups with complex source roots.
 */
export declare function resolveKotlinImport(fqName: string, kotlinFilesByBasename: Map<string, string[]>): string | null;
/**
 * Build a lookup map from Kotlin file basenames (without extension) to file paths.
 * Used by resolveKotlinImport for heuristic FQN resolution.
 */
export declare function buildKotlinFilesByBasename(index: CodeIndex): Map<string, string[]>;
interface WorkspaceAliasResolver {
    resolve: (importPath: string, importerFile: string) => string | null;
}
/** Build a workspace-alias resolver for the given index. Reads each
 *  workspace's package.json once at construction time to discover entry
 *  points; never reads disk afterwards. Returns a no-op resolver on flat
 *  repos. */
export declare function buildWorkspaceAliasResolver(index: CodeIndex): WorkspaceAliasResolver;
/**
 * Build normalized path map for matching imports to indexed files.
 */
export declare function buildNormalizedPathMap(index: CodeIndex): Map<string, string>;
/**
 * Collect all import edges between files in the index.
 * Reads file source from disk to extract import statements.
 * Handles JS/TS/PHP relative imports AND Kotlin fully-qualified imports
 * (via heuristic basename + package-path matching).
 */
export declare function collectImportEdges(index: CodeIndex, fileFilter?: Set<string>): Promise<ImportEdge[]>;
/**
 * Compute file-level PageRank from import edges.
 *
 * Returns a Map of file path → PageRank score (sums to ~1). Isolated nodes
 * (files with neither incoming nor outgoing edges) are pre-filtered. On
 * empty input or a graphology/pagerank failure, returns an empty Map.
 * Used by wiki-hub-ranker (spec D4 Layer 2).
 */
export declare function buildFilePageRank(edges: ImportEdge[]): Map<string, number>;
/**
 * Build adjacency lists (bidirectional) from import edges.
 */
export declare function buildImportAdjacency(edges: ImportEdge[]): Map<string, Set<string>>;
export {};
//# sourceMappingURL=import-graph.d.ts.map