mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Document ObjectLiteralElementLike (#26024)
This commit is contained in:
parent
57d425169a
commit
644ceab02f
@ -858,6 +858,7 @@ namespace ts {
|
||||
name?: PropertyName;
|
||||
}
|
||||
|
||||
/** Unlike ObjectLiteralElement, excludes JSXAttribute and JSXSpreadAttribute. */
|
||||
export type ObjectLiteralElementLike
|
||||
= PropertyAssignment
|
||||
| ShorthandPropertyAssignment
|
||||
|
||||
@ -6632,18 +6632,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
export function isObjectLiteralElement(node: Node): node is ObjectLiteralElement {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.JsxAttribute:
|
||||
case SyntaxKind.JsxSpreadAttribute:
|
||||
case SyntaxKind.PropertyAssignment:
|
||||
case SyntaxKind.ShorthandPropertyAssignment:
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
case SyntaxKind.GetAccessor:
|
||||
case SyntaxKind.SetAccessor:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return node.kind === SyntaxKind.JsxAttribute || node.kind === SyntaxKind.JsxSpreadAttribute || isObjectLiteralElementLike(node);
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
|
||||
@ -616,6 +616,7 @@ declare namespace ts {
|
||||
_objectLiteralBrandBrand: any;
|
||||
name?: PropertyName;
|
||||
}
|
||||
/** Unlike ObjectLiteralElement, excludes JSXAttribute and JSXSpreadAttribute. */
|
||||
type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | MethodDeclaration | AccessorDeclaration;
|
||||
interface PropertyAssignment extends ObjectLiteralElement, JSDocContainer {
|
||||
parent: ObjectLiteralExpression;
|
||||
|
||||
@ -616,6 +616,7 @@ declare namespace ts {
|
||||
_objectLiteralBrandBrand: any;
|
||||
name?: PropertyName;
|
||||
}
|
||||
/** Unlike ObjectLiteralElement, excludes JSXAttribute and JSXSpreadAttribute. */
|
||||
type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | MethodDeclaration | AccessorDeclaration;
|
||||
interface PropertyAssignment extends ObjectLiteralElement, JSDocContainer {
|
||||
parent: ObjectLiteralExpression;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user