UNPKG

userpravah

Version:

UserPravah is an extensible, framework-agnostic tool for analyzing user flows and navigation patterns in web applications. It supports multiple frameworks (Angular, React) and output formats (DOT/Graphviz, JSON) with a plugin-based architecture for easy e

23 lines (22 loc) 1.14 kB
import { Project } from 'ts-morph'; import { AnalysisResult } from './types.js'; import { PatternInfo } from './pattern-collector.interface.js'; export interface FrameworkAdapter { project: Project; readonly frameworkName: string; /** * Analyzes the given project path and returns structured data about routes, flows, etc. * The adapter is responsible for initializing its ts-morph project instance if not already done. * @param projectPath Absolute path to the root of the framework project. * @returns A promise that resolves to an AnalysisResult. */ analyzeProject(projectPath: string): Promise<AnalysisResult>; /** * Retrieves all patterns discovered during the last analysis run by this adapter. * This relies on the adapter using a PatternCollector (either its own or one passed to it). * The structure is a record where keys are pattern types (e.g., "LazyLoading") * and values are arrays of PatternInfo objects. * @returns A record of discovered patterns or undefined if not supported. */ getDiscoveredPatterns?(): Record<string, PatternInfo[]>; }