import type { TSESTree } from '@typescript-eslint/utils'; export type ComponentInfo = { componentTypeNode?: TSESTree.Node | null; name: string; propsTypeNode?: TSESTree.Node | null; statement: TSESTree.Node; }; export type TypeDeclarationInfo = { name: string; statement: TSESTree.Node; }; /** * Determines whether a given AST node tree contains any JSX elements or fragments. It performs a depth-first traversal * using an explicit stack to avoid recursion and scans all child nodes except parent links. It returns true as soon as * a JSXElement or JSXFragment node is found and otherwise returns false after fully traversing the tree. * * @param node The AST node to scan for JSX content. * @returns True when the tree contains JSX elements or fragments, otherwise false. * * @remarks * This helper is used to detect component-like render bodies that include JSX. * * @example * ```tsx * const hasJsx = containsJsx(node); * ``` */ export declare const containsJsx: (node: TSESTree.Node | null | undefined) => boolean; /** * Determines whether a statement declares a component-like function and returns structured details when it does. * It checks for uppercase-named function declarations and variable declarations initialized with arrow functions or * function expressions. It returns null when the statement does not match the expected component patterns. * * @param node The statement node to analyze for component declarations. * @returns The component information when a match is found, or null when no component is detected. * * @remarks * This helper relies on naming conventions and initializer inspection to infer component declarations. * * @example * ```tsx * const info = getComponentInfoFromStatement(statement); * ``` */ export declare const getComponentInfoFromStatement: (node: TSESTree.Statement) => ComponentInfo | null; /** * Determines whether a statement assigns a display name to a component identifier. It narrows the statement to an * expression statement that performs an assignment and validates the left-hand side member access. It returns a boolean * indicating whether the assignment targets the specified component's displayName property. * * @param node The statement node to inspect. * @param componentName The expected component identifier name. * @returns True when the statement assigns to the component's displayName property. * * @remarks * This helper is used to recognize explicit displayName assignments. * * @example * ```tsx * const ok = isDisplayNameAssignment(statement, 'Header'); * ``` */ export declare const isDisplayNameAssignment: (node: TSESTree.Statement, componentName: string) => boolean; /** * Determines whether a statement is an export that re-exports a component identifier with the same name. * It inspects named export specifiers and verifies that both the local and exported names match the provided component * name. It returns false for non-named exports or when no matching specifier is found. * * @param node The statement node to inspect. * @param componentName The expected component identifier name. * @returns True when the statement exports the component identifier by name. * * @remarks * This helper is used to detect explicit named exports of component identifiers. * * @example * ```tsx * const ok = isComponentExport(statement, 'Header'); * ``` */ export declare const isComponentExport: (node: TSESTree.Statement, componentName: string) => boolean; /** * Determines whether a statement is a default export that targets a component identifier. * It supports `export default Identifier` and `export default class/function` declarations * with matching names. * * @param node The statement node to inspect. * @param componentName The expected component identifier name. * @returns True when the statement default-exports the component. * * @example * ```tsx * const ok = isDefaultComponentExport(statement, 'App'); * ``` */ export declare const isDefaultComponentExport: (node: TSESTree.Statement, componentName: string) => boolean; /** * Determines whether a statement declares a styled component variable using the styled tag factory. It inspects variable * declarations and checks tagged template expressions for identifiers, member expressions, or call expressions that * resolve to `styled`. It returns a boolean that indicates whether any declarator matches the styled component pattern. * * @param node The statement node to inspect for a styled component declaration. * @returns True when the statement contains a styled tagged template declaration. * * @remarks * This helper recognizes multiple `styled` invocation forms used in styled-components. * * @example * ```tsx * const ok = isStyledDeclaration(statement); * ``` */ export declare const isStyledDeclaration: (node: TSESTree.Statement) => boolean; /** * Determines whether a statement declares a component factory call (motion(H1)). * These are treated similarly to styled components for ordering purposes. * * @param node The statement node to inspect. * @returns True when the statement contains a supported factory call declaration. * * @example * ```tsx * const ok = isStyledFactoryDeclaration(statement); * ``` */ export declare const isStyledFactoryDeclaration: (node: TSESTree.Statement) => boolean; /** * Extracts type declaration details from a statement when it represents a TypeScript interface or type alias. * It supports both direct declarations and named exports that wrap those declarations. It returns structured metadata * so callers can quickly access the declared name and statement node. * * @param node The statement node to inspect for a type declaration. * @returns The type declaration info when found, or null when the statement does not declare a type. * * @remarks * This helper simplifies handling exported and non-exported type declarations in AST traversal. * * @example * ```tsx * const info = getTypeDeclarationInfo(statement); * ``` */ export declare const getTypeDeclarationInfo: (node: TSESTree.Statement) => TypeDeclarationInfo | null; /** * Collects type reference identifiers from a TypeScript AST node and records them in a provided set. It walks the node * recursively, skipping parent links to avoid cycles, and handles both singular child nodes and arrays of nodes. It * updates the provided set in place and does not return a value. * * @param typeNode The AST node to scan for type references. * @param names The set that receives discovered type reference names. * * @remarks * This helper is intended for internal traversal of TypeScript type nodes. * * @example * ```tsx * const names = new Set(); * collectTypeReferences(typeNode, names); * ``` */ export declare const collectTypeReferences: (typeNode: TSESTree.Node, names: Set) => void;