/**
 * HonoExtractor — AST-based extractor for Hono framework applications.
 *
 * Parses a Hono entry file using tree-sitter TypeScript grammar and produces
 * a HonoAppModel that describes routes, middleware, context flow, OpenAPI
 * schemas, and RPC exports.
 *
 * Spec: docs/specs/2026-04-10-hono-framework-intelligence-spec.md
 * Plan: docs/specs/2026-04-10-hono-framework-intelligence-plan.md (Task 2-3)
 */
import type { HonoAppModel } from "./hono-model.js";
export declare class HonoExtractor {
    private inlineAnalyzer;
    parse(entryFile: string): Promise<HonoAppModel>;
    /**
     * Post-parse runtime upgrade. Scans each file in files_used (excluding the
     * entry file, which was already checked) for Cloudflare Worker type
     * references. Returns "cloudflare" on first match, "unknown" otherwise.
     */
    private upgradeRuntimeFromImports;
    /**
     * Parse a single file and merge results into the model.
     * @param file Absolute canonicalized path
     * @param prefix Path prefix to apply to all routes (from parent app.route())
     * @param inFlight In-flight stack for cycle detection (pushed/popped per call)
     * @param parsedCache Memoized child models keyed by canonical path
     * @param model Accumulated model being built
     */
    private parseFile;
    /**
     * Build a map of { variableName → absoluteFilePath } from import statements.
     */
    private extractImportMap;
    private walkAppVariables;
    private walkHttpRoutes;
    /**
     * Run InlineHandlerAnalyzer on the handler AST node when buildHandler
     * classified the handler as inline. Returns undefined for named-identifier
     * handlers — those are defined elsewhere and analyzed via their symbol.
     * The caller must pass the SAME node used by buildHandler so the two
     * decisions cannot disagree.
     */
    private analyzeHandlerIfInline;
    /** Handle app.on(methods, path, handler) — fan out into per-method routes. */
    private handleOnMethod;
    /**
     * Walk for app.use(scope, mw1, mw2, ...) calls.
     * Handles: identifiers, inline arrows, some()/every() from hono/combine,
     * spread arrays, call expressions like cors().
     */
    private walkMiddleware;
    /**
     * T4: walk an inline middleware arrow body and surface any conditional
     * calls of the form `if (cond) return mw(c, next)` or `if (cond) await mw(c, next)`.
     *
     * We only inspect the DIRECT `if` statements at the top of the body (one level
     * of `statement_block` / `return_statement`). Deep nesting is out of scope to
     * keep false positives low.
     *
     * Returns an entry per conditional call found, with name + condition info.
     */
    private detectConditionalMiddlewareCalls;
    private extractMiddlewareName;
    private buildMiddlewareEntry;
    /**
     * Walk for `export type X = typeof varName` declarations.
     * Classifies as "full_app" if varName is the root app (has mounts/middleware on it),
     * or "route_group" if it's a sub-router without child mounts.
     */
    private walkRPCExports;
    /**
     * Walk for createRoute() definitions and app.openapi(route, handler) registrations.
     * - createRoute({method, path, ...}) → tracked in a local map by variable name
     * - app.openapi(routeVar, handler) → emits OpenAPIRoute + adds to model.routes
     */
    private walkOpenAPI;
    /**
     * Lightweight scan of an imported file (e.g., middleware) for context flow only.
     * Does not extract routes or mounts — just c.set/c.get/c.var patterns.
     */
    private scanFileForContextFlow;
    /**
     * Walk for context variable flow: c.set("key", val), c.get("key"), c.var.key, c.env.KEY.
     * Detects conditional sets (inside if/try/switch blocks).
     */
    private walkContextFlow;
    /** Collect local array variable declarations: const adminChain = [authMw, tenantMw] */
    private collectArrayVars;
    /** Collect import source mapping: variableName → packageSpecifier */
    private collectImportSources;
    /**
     * Walk for app.route("/prefix", subApp) calls.
     * Resolves subApp import, recursively parses the file.
     */
    private walkRouteMounts;
    /** Detect Hono runtime from project files and source patterns. */
    private detectRuntime;
    /**
     * Fallback runtime detection. Runs after detectRuntime's primary signals
     * miss — additive by design so Phase 1 tests remain stable.
     *
     * Signal precedence (first match wins):
     *   1. Cloudflare Bindings type using KVNamespace/D1Database/R2Bucket/Queue
     *   2. vercel.json at project root
     *   3. netlify.toml OR netlify/functions/ dir at project root
     *   4. fly.toml at project root
     *   5. unknown
     */
    private detectRuntimeAdvanced;
    /**
     * Extract env bindings from:
     * 1. c.env.IDENTIFIER member accesses
     * 2. Destructuring: const { A, B } = c.env
     * 3. Bindings type literal from Hono<{ Bindings: {...} }> or createFactory<{ Bindings: {...} }>
     */
    private extractEnvBindings;
}
//# sourceMappingURL=hono.d.ts.map