UNPKG

sicua

Version:

A tool for analyzing project structure and dependencies

33 lines (32 loc) 1.86 kB
import ts from "typescript"; import { FallbackElement, ErrorBoundary, ErrorBoundaryLibraryInfo } from "../../types/errorHandling.types"; import { ComponentRelation } from "../../types"; export declare function isNodeCommented(sourceFile: ts.SourceFile, node: ts.Node): boolean; export declare function isLikelyFrontendFunction(fileName: string, functionName: string): boolean; export declare function isLikelyEventHandler(functionName: string): boolean; export declare function extractDependencies(node: ts.Node): string[]; export declare function extractCalledFunctions(node: ts.Node): string[]; export declare function hasJsxReturn(node: ts.Node): boolean; export declare function safeNodeText(node: ts.Node | undefined): string; export declare function serializeJsxElement(node: ts.JsxElement | ts.JsxSelfClosingElement): string; export interface SerializableFallbackElement extends Omit<FallbackElement, "element" | "condition"> { element: string; condition?: string; } export interface SerializableErrorBoundary extends Omit<ErrorBoundary, "library"> { library: Omit<ErrorBoundaryLibraryInfo, "features"> & { features: string[]; }; } export declare const replacer: (key: string, value: any) => any; export declare function isSimpleSetter(node: ts.Node): boolean; export declare function usesReactHooks(node: ts.Node): boolean; export declare function usesFrontendAPIs(node: ts.Node): boolean; export declare function usesThisKeyword(node: ts.Node): boolean; export declare function hasReactSpecificOperations(node: ts.Node): boolean; export declare function hasReducerPattern(node: ts.Node): boolean; export declare function hasStateSpreadPattern(node: ts.Node): boolean; /** * Generate unique component ID combining file path and component name */ export declare function generateComponentId(component: ComponentRelation): string;