@prometx/trpc-navigation-plugin
Version:
TypeScript Language Service Plugin that fixes broken 'go to definition' for tRPC when using declaration emit
28 lines • 1.09 kB
TypeScript
import * as ts from 'typescript/lib/tsserverlibrary';
import type { PluginConfigWithDefaults } from './config';
import type { Logger } from './types';
export interface RouterTypeInfo {
routerSymbol: ts.Symbol;
routerFile: string;
}
export declare class TypeResolver {
private logger;
private serverHost;
private config;
constructor(logger: Logger, serverHost: ts.server.ServerHost, config: PluginConfigWithDefaults);
/**
* Extracts router type information using configured router location
*/
extractRouterType(variableName: string, _sourceFile: ts.SourceFile, _position: number, typeChecker: ts.TypeChecker, program: ts.Program): RouterTypeInfo | null;
/**
* Find a router variable in a source file by name
*/
private findRouterVariable;
/**
* Checks if a variable is a tRPC client
*/
isTrpcClient(variableName: string, sourceFile: ts.SourceFile, position: number, typeChecker: ts.TypeChecker): boolean;
private findIdentifierAtPosition;
private findInitializer;
}
//# sourceMappingURL=type-resolver.d.ts.map