( declaration: LocalType, context: TypeContext, module: SourceModule, kindOfKey: KindOfKey, depth: number, argNodes: readonly TSType[] | undefined, argModule: SourceModule | undefined, callerTypeArgs: TypeArgs | undefined, state: TypeEvalState )
| 2739 | } |
| 2740 | |
| 2741 | private declaredTypeKindOf( |
| 2742 | declaration: LocalType, |
| 2743 | context: TypeContext, |
| 2744 | module: SourceModule, |
| 2745 | kindOfKey: KindOfKey, |
| 2746 | depth: number, |
| 2747 | argNodes: readonly TSType[] | undefined, |
| 2748 | argModule: SourceModule | undefined, |
| 2749 | callerTypeArgs: TypeArgs | undefined, |
| 2750 | state: TypeEvalState |
| 2751 | ): KindBits | undefined { |
| 2752 | if (this.resolving.has(declaration)) { |
| 2753 | const activeDepth = state.active.get(declaration) |
| 2754 | state.minCycle = Math.min( |
| 2755 | state.minCycle, |
| 2756 | activeDepth === undefined ? -1 : activeDepth |
| 2757 | ) |
| 2758 | return kinds.data |
| 2759 | } |
| 2760 | if (state.recursion >= maxTypeRecursion) { |
| 2761 | state.aborted = true |
| 2762 | return |
| 2763 | } |
| 2764 | state.recursion++ |
| 2765 | const topLevel = isTopLevelType(declaration) |
| 2766 | try { |
| 2767 | const params = declaration.typeParameters?.params |
| 2768 | const boundArgs = this.bindTypeArgs( |
| 2769 | params, |
| 2770 | argNodes, |
| 2771 | context, |
| 2772 | argModule ?? module, |
| 2773 | declaration, |
| 2774 | module, |
| 2775 | kindOfKey, |
| 2776 | depth, |
| 2777 | callerTypeArgs, |
| 2778 | topLevel, |
| 2779 | state |
| 2780 | ) |
| 2781 | if (state.aborted) return |
| 2782 | let cacheKey: string | undefined |
| 2783 | let byKey: Map<string, KindBits | undefined> | undefined |
| 2784 | if (topLevel) { |
| 2785 | cacheKey = typeCacheKeyOf(depth, params, boundArgs) |
| 2786 | byKey = this.declaredTypeKinds.get(declaration) |
| 2787 | if (byKey?.has(cacheKey)) return byKey.get(cacheKey) |
| 2788 | } |
| 2789 | const myDepth = state.active.size |
| 2790 | const outerMinCycle = state.minCycle |
| 2791 | const outerQueried = state.queried |
| 2792 | state.minCycle = Infinity |
| 2793 | state.queried = false |
| 2794 | this.resolving.add(declaration) |
| 2795 | state.active.set(declaration, myDepth) |
| 2796 | let result: KindBits | undefined |
| 2797 | try { |
| 2798 | if (declaration.type === "TSInterfaceDeclaration") { |
no test coverage detected