/**
 * `react-views` adapter — surfaces React components from `.tsx` / `.jsx`
 * files as candidate views.
 *
 * Why this exists: codebases with React/React Native UI (idle-meta's
 * editor, mythology-mobile, idle-clicker-mobile) declare their views as
 * top-level component functions or classes. None of the prior adapters
 * (typescript-decorators, typescript-interfaces, express-routes,
 * typescript-prisma) read JSX — so all view declarations were silently
 * dropped from analyse output.
 *
 * Each detected component becomes one entry in `prepassFacts.views[]`,
 * keyed by component name. Skeleton-emitter then emits a `views:` block
 * per detected SpecVerse component, populated with the views that fall
 * under that source-tree subtree.
 *
 * Detection criteria (any one matches):
 *   - `export function Name(...)` returning JSX (heuristic: contains `<...>`)
 *   - `export const Name = (...) => <...>` or `export const Name: FC<...> = ...`
 *   - `export default function Name(...)` or `export default class Name`
 *   - `class Name extends React.Component` / `extends Component`
 *
 * Naming gates:
 *   - PascalCase identifier required (lowercase-first names = helpers, skip)
 *   - Length ≥ 2 (single-letter names = generic placeholders, skip)
 *
 * Out of scope for v1:
 *   - JSX render-tree analysis (which other components does this view render?)
 *   - Hook detection (`useFoo`, `useBar`)
 *   - Prop type extraction
 *   - State/store consumer detection
 *   These can be added incrementally without breaking the v1 contract.
 */
export interface ReactViewDeclaration {
    /** Component name in PascalCase (suitable as a yaml key). */
    name: string;
    /** Source file path (absolute). */
    filePath: string;
    /** Line range of the declaration (1-indexed). Best-effort, may be approximate. */
    sourceLineRange: [number, number];
    /** Detection mechanism — useful for forward-logged provenance. */
    kind: 'function-component' | 'arrow-component' | 'class-component' | 'default-export';
    /** True when the component name ends with `Screen` (React Native convention). */
    isScreen: boolean;
    /** Engines 6.30.3+. Cleaned JSDoc / leading-comment text from immediately
     *  above the component declaration, when present. Stripped of comment
     *  markers and reformatted as a single line. */
    docstring?: string;
    /** Engines 6.31.0+. Classified view type from JSX shape — one of the
     *  standard SpecVerse view types (`list`, `form`, `detail`, `dashboard`,
     *  `modal`, `provider`, `screen`, `layout`, `widget`, `page`).
     *  See `classifyViewType` for the full pattern table. */
    viewType?: string;
    /** Engines 6.31.0+. Sub-component names rendered inside this view's
     *  JSX. Captures composition graph deterministically without resolving
     *  imports — the consumer (skeleton-emitter) cross-references against
     *  detected views to filter to known names. */
    usesComponents?: string[];
    /** Engines 6.31.0+. Action handles extracted from `<button onClick={X}>`
     *  patterns. The label is captured from the button's text content
     *  when present. The handler ref is the function name (used to resolve
     *  CURVED-op binding later). */
    actions?: Array<{
        name: string;
        label?: string;
        variant?: 'primary' | 'destructive' | 'secondary';
    }>;
    /** Engines 6.31.0+. True when the JSX has a "no items" / "empty list"
     *  branch (detected via `length === 0` / `isEmpty` / `!items.length`
     *  conditional rendering). */
    emptyState?: boolean;
}
export interface ReactViewFile {
    filePath: string;
    views: ReactViewDeclaration[];
}
/** True when the file path looks like a React/JSX source file. */
export declare function isReactViewFile(filePath: string): boolean;
/** True when the source contains content that looks like JSX or React Native imports. */
export declare function looksLikeReactSource(source: string): boolean;
/**
 * Parse a single React/JSX file and extract candidate view declarations.
 * Returns at most one entry per name (per-file dedup).
 */
export declare function parseReactViews(filePath: string, source: string): ReactViewFile;
/**
 * Engines 6.31.0+. Classify a React component into one of SpecVerse's
 * standard view types from JSX shape + filename hints. Returns the
 * canonical type string. Falls back to `page` (the catch-all
 * top-level type) when no specific pattern matches.
 *
 * Detection table (first match wins, ordered most-specific first):
 *
 *   `provider`  — Renders `Context.Provider` or `<XContext.Provider>` and
 *                 little else. Distinguished from generic wrappers by
 *                 being focused on the Provider alone.
 *   `layout`    — Filename ends `Layout` AND component renders children
 *                 via `{children}` or `<Outlet/>` (Next.js / RR shapes).
 *   `screen`    — Filename ends `Screen` OR uses `SafeAreaView` /
 *                 `<Screen>` wrapper (RN convention).
 *   `modal`     — Renders `<Modal>` / `<Dialog>` / `createPortal` /
 *                 `<dialog>`.
 *   `wizard`    — Multi-step flow detected by `step` state + numeric
 *                 progression (heuristic).
 *   `dashboard` — Multiple grid/panel children at top level.
 *   `form`      — Renders a `<form>` with submit handler, or has
 *                 `onSubmit` / `useForm` patterns.
 *   `list`      — Renders `<table>`, `.map(item =>`, or `<ul>`/`<ol>`
 *                 with iteration.
 *   `widget`    — Tiny render — single root element, no state, ≤2 JSX
 *                 nodes deep. Pills, badges, icons, status chips.
 *   `detail`    — Single-entity readonly render (h1 + dl/dt/dd or
 *                 similar information-display shape).
 *   `page`      — Default catch-all when nothing more specific matches.
 */
export declare function classifyViewType(input: {
    name: string;
    kind: ReactViewDeclaration['kind'];
    filePath: string;
    body: string;
}): string;
/**
 * Engines 6.31.0+. Extract sub-component names rendered in this view.
 * Captures `<UpperCaseTag` patterns; consumer (skeleton-emitter) can
 * filter against detected views to keep only known refs. PascalCase-
 * gated to skip HTML tags (`<div>`, `<span>`, etc.).
 */
export declare function extractUsesComponents(body: string): string[];
/**
 * Engines 6.31.0+. Extract action declarations from button/link click
 * handlers. Each action gets a name (the handler reference), an
 * optional label (the button's visible text), and an optional variant
 * inferred from context (destructive / primary / secondary).
 *
 * Patterns recognised:
 *   <button onClick={handler}>Label</button>
 *   <Button onClick={handler} variant="destructive">Label</Button>
 *   <Pressable onPress={handler}>Label</Pressable>      (RN)
 *   <Link onClick={handler}>Label</Link>
 */
export declare function extractActions(body: string): NonNullable<ReactViewDeclaration['actions']>;
/**
 * Engines 6.31.0+. Detect a "no items" / empty-state branch in the JSX.
 * Returns true when the body has a conditional render path for the
 * zero-data case.
 */
export declare function detectEmptyState(body: string): boolean;
//# sourceMappingURL=react-views.d.ts.map