import type { TSESTree } from '@typescript-eslint/utils'; export type ComponentInfo = { functionNode: TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression; name: string; }; /** * Collects component function information from the program body. It scans top-level statements to find uppercase-named * component declarations and assignments. It returns metadata for each component that matches these criteria. * * @param body The program body statements to analyze. * @returns A list of discovered component info objects. * * @example * ```tsx * const components = getComponentInfos(program.body); * ``` */ export declare const getComponentInfos: (body: TSESTree.Program["body"]) => ComponentInfo[]; /** * Determines whether a statement contains a React hook call expression. It inspects expression statements and * single-variable declarations to detect calls whose callee matches hook naming rules. It returns the hook call * node when found and otherwise returns null. * * @param statement The statement to analyze for a hook call. * @returns The hook call node when present, or null when no hook call is found. * * @example * ```tsx * const hookCall = getHookCallFromStatement(statement); * ``` */ export declare const getHookCallFromStatement: (statement: TSESTree.Statement) => TSESTree.Node | null; /** * Determines whether the provided statement represents a guard clause in a control flow. * It only considers `if` statements without an `else` branch and treats immediate returns as guard clauses. * It also supports a single-statement block that returns as a guard clause. * * @param statement The statement node to evaluate for guard clause structure. * @returns A boolean indicating whether the statement is a guard clause. * * @example * ```tsx * const isGuard = isGuardClause(statement); * ``` */ export declare const isGuardClause: (statement: TSESTree.Statement) => boolean; /** * Determines whether a statement or its immediate branches include a return statement. * It checks direct return statements and inspects simple if statements for returns in their consequent. * It does not traverse deeper nested structures beyond the immediate consequent block. This keeps the check focused * on top-level guard-like returns. * * @param statement The statement node to inspect for a return statement. * @returns True when a return statement is found in the inspected statement, otherwise false. * * @example * ```tsx * const hasReturn = hasReturnStatement(statement); * ``` */ export declare const hasReturnStatement: (statement: TSESTree.Statement) => boolean;