@@ -11115,11 +11115,10 @@ namespace ts {
11115
11115
}
11116
11116
11117
11117
/**
11118
- * Get the attributes type which is the type that indicate which attributes are valid on the given JSXOpeningLikeElement.
11119
- * @param node a JSXOpeningLikeElement node
11120
- * @return an attributes type of the given node
11118
+ *
11119
+ * @param node
11121
11120
*/
11122
- function getJsxElementAttributesType (node: JsxOpeningLikeElement ): Type {
11121
+ function getIntrinsicJsxElementAttributesType (node: JsxOpeningElement ): Type {
11123
11122
const links = getNodeLinks(node);
11124
11123
if (!links.resolvedJsxElementAttributesType) {
11125
11124
if (isJsxIntrinsicIdentifier(node.tagName)) {
@@ -11134,14 +11133,31 @@ namespace ts {
11134
11133
return links.resolvedJsxElementAttributesType = unknownType;
11135
11134
}
11136
11135
}
11137
- else {
11136
+ }
11137
+ return links.resolvedJsxElementAttributesType;
11138
+ }
11139
+
11140
+ function getCustomJsxElementAttributesType(node: JsxOpeningElement): Type {
11141
+ const links = getNodeLinks(node);
11142
+ if (!links.resolvedJsxElementAttributesType) {
11143
+ if (!isJsxIntrinsicIdentifier(node.tagName)) {
11138
11144
const elemClassType = getJsxGlobalElementClassType();
11139
11145
return links.resolvedJsxElementAttributesType = resolveJsxElementAttributesType(node, undefined, elemClassType);
11140
11146
}
11141
11147
}
11142
11148
return links.resolvedJsxElementAttributesType;
11143
11149
}
11144
11150
11151
+ /**
11152
+ * Get the attributes type which is the type that indicate which attributes are valid on the given JSXOpeningLikeElement.
11153
+ * @param node a JSXOpeningLikeElement node
11154
+ * @return an attributes type of the given node
11155
+ */
11156
+ function getJsxElementAttributesType(node: JsxOpeningLikeElement): Type {
11157
+ const intrinsicAttributesType = getIntrinsicJsxElementAttributesType(node);
11158
+ return intrinsicAttributesType ? intrinsicAttributesType : getCustomJsxElementAttributesType(node);
11159
+ }
11160
+
11145
11161
/**
11146
11162
* Given a JSX attribute, returns the symbol for the corresponds property
11147
11163
* of the element attributes type. Will return unknownSymbol for attributes
0 commit comments