export declare interface ApplyFixesRequest { fileContent: string; diagnostics: Diagnostic[]; } export declare interface ApplyFixesResponse { fixedContent: string[]; wasFixed: boolean; appliedCount: number; unappliedCount: number; } export declare interface Diagnostic { ruleName: string; message: string; messageId: string; filePath: string; range: Range; severity?: string; suggestions: any[]; } /** * Edge in the flow graph (from antecedent to current) */ declare interface FlowEdge { from: number; to: number; } /** * Flow graph for visualization */ declare interface FlowGraph { nodes: FlowGraphNode[]; edges: FlowEdge[]; } /** * Node in the flow graph */ declare interface FlowGraphNode { id: number; flags: number; flagNames?: string[]; nodePos?: number; nodeEnd?: number; nodeKindName?: string; } /** * Control flow analysis information */ export declare interface FlowInfo { flags: number; flagNames?: string[]; nodeKind?: number; nodeKindName?: string; nodePos?: number; nodeEnd?: number; antecedent?: FlowInfo; antecedents?: FlowInfo[]; graph?: FlowGraph; } /** * Request for AST info at a specific position */ export declare interface GetAstInfoRequest { fileContent: string; position: number; end?: number; kind?: number; depth?: number; fileName?: string; compilerOptions?: Record; } /** * Response containing detailed AST information */ export declare interface GetAstInfoResponse { node?: NodeInfo; type?: TypeInfo; symbol?: SymbolInfo; signature?: SignatureInfo; flow?: FlowInfo; } /** * Index signature information */ export declare interface IndexInfo { keyType: TypeInfo; valueType: TypeInfo; isReadonly: boolean; } export declare interface LanguageOptions { parserOptions?: ParserOptions; } export declare interface LintOptions { files?: string[]; config?: string; workingDirectory?: string; ruleOptions?: Record; fileContents?: Record; languageOptions?: LanguageOptions; includeEncodedSourceFiles?: boolean; } export declare interface LintResponse { diagnostics: Diagnostic[]; errorCount: number; fileCount: number; ruleCount: number; duration: string; encodedSourceFiles?: Record; } /** * Detailed information about an AST node */ export declare interface NodeInfo { id?: number; kind: number; kindName: string; pos: number; end: number; flags: number; flagNames?: string[]; text?: string; fileName?: string; parent?: NodeInfo; name?: NodeInfo; expression?: NodeInfo; left?: NodeInfo; right?: NodeInfo; operatorToken?: NodeInfo; operand?: NodeInfo; condition?: NodeInfo; whenTrue?: NodeInfo; whenFalse?: NodeInfo; thenStatement?: NodeInfo; elseStatement?: NodeInfo; body?: NodeInfo; initializer?: NodeInfo; type?: NodeInfo; members?: NodeInfo[]; heritageClauses?: NodeInfo[]; typeParameters?: NodeInfo[]; parameters?: NodeInfo[]; modifiers?: NodeInfo[]; arguments?: NodeInfo[]; statements?: NodeInfo[]; properties?: NodeInfo[]; elements?: NodeInfo[]; declarationList?: NodeInfo; declarations?: NodeInfo[]; importClause?: NodeInfo; moduleSpecifier?: NodeInfo; namedBindings?: NodeInfo; exportClause?: NodeInfo; incrementor?: NodeInfo; statement?: NodeInfo; caseBlock?: NodeInfo; clauses?: NodeInfo[]; tryBlock?: NodeInfo; catchClause?: NodeInfo; finallyBlock?: NodeInfo; variableDeclaration?: NodeInfo; block?: NodeInfo; argumentExpression?: NodeInfo; equalsToken?: NodeInfo; objectAssignmentInitializer?: NodeInfo; head?: NodeInfo; templateSpans?: NodeInfo[]; literal?: NodeInfo; tag?: NodeInfo; template?: NodeInfo; questionToken?: NodeInfo; dotDotDotToken?: NodeInfo; exclamationToken?: NodeInfo; asteriskToken?: NodeInfo; equalsGreaterThanToken?: NodeInfo; questionDotToken?: NodeInfo; typeArguments?: NodeInfo[]; constraint?: NodeInfo; defaultType?: NodeInfo; locals?: SymbolInfo[]; endOfFileToken?: NodeInfo; imports?: NodeInfo[]; isDeclarationFile?: boolean; scriptKind?: number; identifierCount?: number; symbolCount?: number; nodeCount?: number; listMetas?: Record; } /** * NodeList metadata (Pos, End, HasTrailingComma) */ declare interface NodeListMeta { pos: number; end: number; hasTrailingComma: boolean; } /** * Function parameter information (deprecated - use SymbolInfo instead) */ export declare interface ParameterInfo { name: string; type?: TypeInfo; optional: boolean; rest: boolean; } export declare interface ParserOptions { projectService?: boolean; project?: string[] | string; } /** * Shared types for rslint IPC protocol across all environments */ declare interface Position { line: number; column: number; } declare interface Range { start: Position; end: Position; } export declare interface RSlintOptions { rslintPath?: string; workingDirectory?: string; } /** * Main RslintService class that automatically uses the appropriate implementation */ export declare class RSLintService { private readonly service; constructor(service: RslintServiceInterface); /** * Run the linter on specified files */ lint(options?: LintOptions): Promise; /** * Apply fixes to a file based on diagnostics */ applyFixes(options: ApplyFixesRequest): Promise; /** * Get detailed AST information at a specific position * Returns Node, Type, Symbol, Signature, and Flow information */ getAstInfo(options: GetAstInfoRequest): Promise; /** * Close the service */ close(): Promise; } export declare interface RslintServiceInterface { sendMessage(kind: string, data: any): Promise; terminate(): void; } /** * Detailed information about a function/method signature */ export declare interface SignatureInfo { flags: number; flagNames?: string[]; minArgumentCount: number; pos?: number; fileName?: string; parameters?: SymbolInfo[]; thisParameter?: SymbolInfo; typeParameters?: TypeInfo[]; returnType?: TypeInfo; typePredicate?: TypePredicateInfo; declaration?: NodeInfo; } /** * Detailed information about a TypeScript symbol */ export declare interface SymbolInfo { id?: number; name: string; escapedName?: string; flags: number; flagNames?: string[]; checkFlags?: number; checkFlagNames?: string[]; pos?: number; fileName?: string; declarations?: NodeInfo[]; valueDeclaration?: NodeInfo; members?: SymbolInfo[]; exports?: SymbolInfo[]; } /** * Detailed information about a TypeScript type */ export declare interface TypeInfo { id?: number; flags: number; flagNames?: string[]; objectFlags?: number; objectFlagNames?: string[]; intrinsicName?: string; typeString: string; pos?: number; fileName?: string; value?: unknown; freshType?: TypeInfo; regularType?: TypeInfo; symbol?: SymbolInfo; aliasSymbol?: SymbolInfo; typeArguments?: TypeInfo[]; baseTypes?: TypeInfo[]; properties?: SymbolInfo[]; callSignatures?: SignatureInfo[]; constructSignatures?: SignatureInfo[]; indexInfos?: IndexInfo[]; types?: TypeInfo[]; constraint?: TypeInfo; default?: TypeInfo; target?: TypeInfo; } /** * Generic type parameter information */ export declare interface TypeParamInfo { name: string; constraint?: TypeInfo; default?: TypeInfo; } /** * Type predicate information for type guards */ export declare interface TypePredicateInfo { kind: number; kindName: string; parameterName?: string; parameterIndex?: number; type?: TypeInfo; } export { }