/**
 * Next.js component classifier readers: directive detection, signal walking,
 * per-file classification logic, and the decision table.
 *
 * These readers are pure helpers with no orchestration logic. They are used by
 * `nextjs-component-tools.ts` (orchestrator) and re-exported from it for
 * backward compatibility with existing consumers and tests. Split follows the
 * T2/T3 reader + orchestrator precedent.
 */
import type Parser from "web-tree-sitter";
export type ComponentClassification = "server" | "client_explicit" | "client_inferred" | "ambiguous";
export interface SignalLocation {
    name: string;
    line: number;
    column: number;
}
export interface ComponentSignals {
    hooks: string[];
    event_handlers: string[];
    browser_globals: string[];
    dynamic_ssr_false: boolean;
    /**
     * Precise source locations for each detected signal. Agents use this to
     * jump directly to the fix site without re-parsing the file. Populated
     * for hooks, event_handlers, and browser_globals. dynamic_ssr_false is
     * file-level so no location is tracked.
     */
    signal_locations: SignalLocation[];
}
export interface NextjsComponentEntry {
    path: string;
    classification: ComponentClassification;
    directive: "use client" | "use server" | null;
    signals: ComponentSignals;
    violations: string[];
    /**
     * Actionable remediation text for classification violations.
     * Set when the entry has `unnecessary_use_client` violation or
     * `client_inferred` classification; omitted otherwise.
     */
    suggested_fix?: string;
}
export interface NextjsComponentsCounts {
    total: number;
    server: number;
    client_explicit: number;
    client_inferred: number;
    ambiguous: number;
    unnecessary_use_client: number;
}
export declare const MAX_FILE_SIZE_BYTES = 2097152;
export declare const DEFAULT_MAX_FILES = 2000;
export declare const PARSE_CONCURRENCY = 10;
/** Hooks that are server-safe (or SSR-safe) and don't imply client component. */
export declare const CLIENT_HOOKS_EXCLUDE: Set<string>;
/** JSX event attributes that imply client component. */
export declare const EVENT_HANDLER_ATTRS: Set<string>;
/** Browser-only globals (detected in MemberExpressions like `window.foo`). */
export declare const BROWSER_GLOBALS: Set<string>;
export declare const HOOK_NAME_RE: RegExp;
/**
 * Pure decision table for component classification. No I/O, no AST access.
 *
 * Rules (in priority order):
 *   - directive === "use client":
 *       has any signal     -> client_explicit
 *       no signals         -> client_explicit + violation "unnecessary_use_client"
 *   - directive === "use server" -> server
 *   - directive === null:
 *       has any signal     -> client_inferred
 *       no signals         -> server
 */
export declare function applyClassificationTable(directive: "use client" | "use server" | null, signals: ComponentSignals): {
    classification: ComponentClassification;
    violations: string[];
};
/**
 * Walk the AST to collect client-component signals:
 *   - hooks    — call_expression whose callee identifier matches /^use[A-Z]/
 *   - events   — jsx_attribute property_identifier in EVENT_HANDLER_ATTRS
 *   - globals  — member_expression object identifier in BROWSER_GLOBALS
 *   - next/dynamic({ ssr: false }) — import from "next/dynamic" + call with ssr:false
 */
export declare function detectSignals(tree: Parser.Tree, _source: string): ComponentSignals;
/**
 * Confirm a file-level directive by inspecting `Program.body[0]`.
 *
 * Tree-sitter's tsx/typescript grammars expose top-level directive strings as
 * an `expression_statement` whose first named child is a `string` literal
 * (a `"use client"` or `"use server"` token). Any other shape — including a
 * nested block, inline comment, or non-first statement — must return `null`.
 */
export declare function confirmDirectiveFromTree(tree: Parser.Tree): "use client" | "use server" | null;
/**
 * Classify a single file. Returns a partial entry with the directive field
 * populated. Signal detection + final classification are added by the
 * orchestrator (Task 23) via `detectSignals` (Task 21) and
 * `applyClassificationTable` (Task 22).
 */
export declare function classifyFile(filePath: string, repoRoot: string): Promise<NextjsComponentEntry>;
//# sourceMappingURL=nextjs-component-readers.d.ts.map