36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import * as ts from 'typescript/lib/tsserverlibrary';
|
|
import { OakBuildChecksConfig, CustomDiagnostic } from './checker';
|
|
export declare class AsyncContextChecker {
|
|
private pwd;
|
|
private config;
|
|
private program;
|
|
private typeChecker;
|
|
private tsLib;
|
|
private functionsWithContextCalls;
|
|
private functionDeclarations;
|
|
private functionCallGraph;
|
|
private directContextCalls;
|
|
private ignoreCommentNodes;
|
|
private isInitialized;
|
|
constructor(pwd: string, config: OakBuildChecksConfig, program: ts.Program, typeChecker: ts.TypeChecker, tsLib: typeof ts);
|
|
/**
|
|
* 初始化:构建全局调用图
|
|
*/
|
|
private initialize;
|
|
/**
|
|
* 检查单个文件
|
|
*/
|
|
checkFile(sourceFile: ts.SourceFile): CustomDiagnostic[];
|
|
private isFileInCheckScope;
|
|
private preprocessIgnoreComments;
|
|
private collectCallGraph;
|
|
private filterAsyncContextCalls;
|
|
private propagateContextMarks;
|
|
private checkDirectContextCalls;
|
|
private checkIndirectCalls;
|
|
/**
|
|
* 清除缓存(当文件变化时)
|
|
*/
|
|
clearCache(): void;
|
|
}
|