sicua
Version:
A tool for analyzing project structure and dependencies
32 lines (31 loc) • 1.37 kB
TypeScript
import { ComponentRelation, PropSignature } from "../../../types";
import { EnhancedComponentRelation } from "../types/deduplication.types";
import ts from "typescript";
/**
* Finds common props between two sets of props
* @param props1 First set of props
* @param props2 Second set of props
* @returns Array of common props
*/
export declare function findCommonProps(props1?: PropSignature[], props2?: PropSignature[]): PropSignature[];
/**
* Extracts prop types from a component node
* @param node The component AST node
* @param sourceFile Source file containing the component
* @returns Array of prop signatures
*/
export declare function extractPropTypes(node: ts.Node, sourceFile: ts.SourceFile): PropSignature[];
/**
* Finds the default value for a prop
* @param propName The name of the prop
* @param components Components to search for default values
* @returns The default value string if found
*/
export declare function findPropDefaultValue(propName: string, components: EnhancedComponentRelation[]): string | undefined;
/**
* Calculates the similarity score for props
* @param commonProps Common props between components
* @param components Components being compared
* @returns Similarity score between 0 and 1
*/
export declare function calculatePropsSimilarity(commonProps: PropSignature[], components: ComponentRelation[]): number;