import { ConsoleInterface } from '../common/console'; import { CodeFlowReferenceExpressionNode, FlowNode } from './codeFlowTypes'; import { SpeculativeTypeTracker } from './typeCacheUtils'; import { Reachability, TypeEvaluator, TypeResult } from './typeEvaluatorTypes'; import { Type, TypeVarType } from './types'; export interface FlowNodeTypeResult { type: Type | undefined; isIncomplete: boolean; generationCount: number | undefined; incompleteSubtypes: IncompleteSubtypeInfo[] | undefined; } export declare namespace FlowNodeTypeResult { function create(type: Type | undefined, isIncomplete: boolean, generationCount?: number, incompleteSubtypes?: IncompleteSubtypeInfo[]): FlowNodeTypeResult; } export interface FlowNodeTypeOptions { targetSymbolId?: number; typeAtStart?: TypeResult; skipConditionalNarrowing?: boolean; } export interface CodeFlowAnalyzer { getTypeFromCodeFlow: (flowNode: FlowNode, reference: CodeFlowReferenceExpressionNode | undefined, options?: FlowNodeTypeOptions) => FlowNodeTypeResult; } export interface CodeFlowEngine { createCodeFlowAnalyzer: () => CodeFlowAnalyzer; getFlowNodeReachability: (flowNode: FlowNode, sourceFlowNode?: FlowNode, ignoreNoReturn?: boolean) => Reachability; narrowConstrainedTypeVar: (flowNode: FlowNode, typeVar: TypeVarType) => Type | undefined; printControlFlowGraph: (flowNode: FlowNode, reference: CodeFlowReferenceExpressionNode | undefined, callName: string, logger: ConsoleInterface) => void; } export interface IncompleteSubtypeInfo { type: Type; isIncomplete: boolean; isPending: boolean; evaluationCount: number; } export interface IncompleteType { isIncompleteType?: true; type: Type | undefined; incompleteSubtypes: IncompleteSubtypeInfo[]; generationCount: number; isRecursionSentinel?: boolean; } export declare function isIncompleteType(cachedType: CachedType): cachedType is IncompleteType; export type CachedType = Type | IncompleteType; export declare function getCodeFlowEngine(evaluator: TypeEvaluator, speculativeTypeTracker: SpeculativeTypeTracker): CodeFlowEngine;