@paulohenriquevn/m2js
Version:
Transform TypeScript/JavaScript code into LLM-friendly Markdown summaries + Smart Dead Code Detection + Graph-Deep Diff Analysis. Extract exported functions, classes, and JSDoc comments for better AI context with 60%+ token reduction. Intelligent dead cod
72 lines (71 loc) • 1.85 kB
TypeScript
/**
* Diagram system types for M2JS
* Extends existing types for diagram generation
*/
export type DiagramType = 'dependency' | 'class' | 'sequence' | 'component';
export type DiagramTheme = 'neutral' | 'dark' | 'forest' | 'base';
export type DiagramFormat = 'markdown' | 'svg' | 'png';
export interface DiagramOptions {
type: DiagramType;
theme: DiagramTheme;
format: DiagramFormat;
includeExternal: boolean;
interactive: boolean;
title?: string;
description?: string;
}
export interface NodeClassification {
type: 'cli' | 'parser' | 'generator' | 'analyzer' | 'types' | 'utils' | 'test' | 'core';
icon: string;
color: string;
description: string;
}
export interface MermaidConfig {
theme: DiagramTheme;
flowchart?: {
curve: 'basis' | 'linear' | 'step';
padding: number;
useMaxWidth: boolean;
};
themeVariables?: {
primaryColor: string;
primaryTextColor: string;
primaryBorderColor: string;
lineColor: string;
};
}
export interface ClassDiagramNode {
name: string;
methods: {
name: string;
visibility: '+' | '-' | '#';
params: string;
returnType: string;
}[];
properties?: {
name: string;
type: string;
visibility: '+' | '-' | '#';
}[];
}
export interface SequenceDiagramStep {
from: string;
to: string;
message: string;
type: '->' | '->>' | '-x' | '-->';
note?: string;
}
export interface DiagramResult {
content: string;
metadata: {
type: DiagramType;
theme: DiagramTheme;
nodeCount: number;
edgeCount: number;
generatedAt: Date;
};
}
export interface DiagramGenerator {
generate(data: any, options: DiagramOptions): DiagramResult;
supports(type: DiagramType): boolean;
}