/** * Base Language Plugin * * Provides common functionality for all language plugins. */ import type { Parser, Node as SyntaxNode } from 'web-tree-sitter'; import type { TypeInfo, CallInfo, ImportInfo } from '../../types/index.js'; import type { LanguagePlugin, LanguageNodeTypes, ExtractionContext, FrameworkInfo, TaintSourcePattern, TaintSinkPattern, SupportedLanguage } from '../types.js'; /** * Abstract base class for language plugins. * Provides default implementations for common methods. */ export declare abstract class BaseLanguagePlugin implements LanguagePlugin { abstract readonly id: SupportedLanguage; abstract readonly name: string; abstract readonly extensions: string[]; abstract readonly wasmPath: string; abstract readonly nodeTypes: LanguageNodeTypes; protected parser: Parser | null; initialize(parser: Parser): Promise; canHandle(filePath: string): boolean; abstract extractTypes(context: ExtractionContext): TypeInfo[]; abstract extractCalls(context: ExtractionContext): CallInfo[]; abstract extractImports(context: ExtractionContext): ImportInfo[]; abstract extractPackage(context: ExtractionContext): string | undefined; abstract getBuiltinSources(): TaintSourcePattern[]; abstract getBuiltinSinks(): TaintSinkPattern[]; detectFramework(context: ExtractionContext): FrameworkInfo | undefined; getReceiverType(node: SyntaxNode, context: ExtractionContext): string | undefined; isStringLiteral(node: SyntaxNode): boolean; getStringValue(node: SyntaxNode): string | undefined; /** * Helper to get text from a node */ protected getNodeText(node: SyntaxNode): string; /** * Helper to find all nodes of a given type */ protected findNodes(root: SyntaxNode, type: string): SyntaxNode[]; /** * Helper to find first child of given type */ protected findChildByType(node: SyntaxNode, type: string): SyntaxNode | null; } //# sourceMappingURL=base.d.ts.map