@context-sync/server
Version:
MCP server for AI context sync with persistent memory, workspace file access, and intelligent code operations
129 lines • 3.12 kB
TypeScript
export interface TypeDefinition {
name: string;
kind: 'interface' | 'type' | 'class' | 'enum';
filePath: string;
line: number;
isExported: boolean;
raw: string;
}
export interface InterfaceInfo extends TypeDefinition {
kind: 'interface';
properties: PropertyInfo[];
methods: MethodInfo[];
extends?: string[];
}
export interface TypeAliasInfo extends TypeDefinition {
kind: 'type';
definition: string;
}
export interface ClassInfo extends TypeDefinition {
kind: 'class';
properties: PropertyInfo[];
methods: MethodInfo[];
constructor?: MethodInfo;
extends?: string;
implements?: string[];
}
export interface EnumInfo extends TypeDefinition {
kind: 'enum';
members: EnumMember[];
}
export interface PropertyInfo {
name: string;
type: string;
optional: boolean;
readonly: boolean;
line: number;
}
export interface MethodInfo {
name: string;
params: ParameterInfo[];
returnType?: string;
isAsync: boolean;
isStatic: boolean;
visibility?: 'public' | 'private' | 'protected';
line: number;
}
export interface ParameterInfo {
name: string;
type?: string;
optional: boolean;
defaultValue?: string;
}
export interface EnumMember {
name: string;
value?: string | number;
line: number;
}
export interface TypeUsage {
filePath: string;
line: number;
context: string;
usageType: 'variable' | 'parameter' | 'return' | 'generic' | 'implements' | 'extends';
}
export interface TypeInfo {
definition: TypeDefinition;
details: InterfaceInfo | TypeAliasInfo | ClassInfo | EnumInfo;
usages: TypeUsage[];
relatedTypes: string[];
}
export declare class TypeAnalyzer {
private workspacePath;
private fileCache;
private typeCache;
private readonly MAX_FILE_SIZE;
private readonly WARN_FILE_SIZE;
constructor(workspacePath: string);
/**
* Find type definition by name
*/
findTypeDefinition(typeName: string): Promise<TypeDefinition | null>;
/**
* Get complete information about a type
*/
getTypeInfo(typeName: string): Promise<TypeInfo | null>;
/**
* Get detailed information based on type kind
*/
private getTypeDetails;
/**
* Parse interface details
*/
private parseInterface;
/**
* Parse type alias details
*/
private parseTypeAlias;
/**
* Parse class details
*/
private parseClass;
/**
* Parse enum details
*/
private parseEnum;
/**
* Find all usages of a type
*/
findTypeUsages(typeName: string): Promise<TypeUsage[]>;
/**
* Extract all type definitions from a file
*/
private extractTypes;
/**
* Extract related types referenced in this type
*/
private extractRelatedTypes;
/**
* Parse function/method parameters
*/
private parseParameters;
private readFile;
private getRelativePath;
private getAllProjectFiles;
/**
* Clear caches
*/
clearCache(): void;
}
//# sourceMappingURL=type-analyzer.d.ts.map