Skip to content

Commit

Permalink
refactor member-like.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyab committed Sep 18, 2024
1 parent 0c4da6d commit 7d31de1
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/ast/member-like.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,24 @@ export const MemberTypes = Object.fromEntries(

export type MemberType = (typeof MemberLikeNodeTypesArray)[number];

export type MemberNode<K extends MemberType = MemberType> = // babel-ast
(| TSESTree.PropertyDefinition
type TSESTreeMemberNode =
| TSESTree.PropertyDefinition
| TSESTree.MethodDefinition
| TSESTree.TSAbstractMethodDefinition
| TSESTree.TSAbstractPropertyDefinition
| TSESTree.TSConstructSignatureDeclaration
| TSESTree.TSIndexSignature
| TSESTree.TSMethodSignature
| TSESTree.TSPropertySignature
| TSESTree.TSPropertySignature;

// ts-es-tree
type BabelMemberNode =
| BabelTypes.ClassMethod
| BabelTypes.ClassPrivateMethod
| BabelTypes.ClassPrivateProperty
| BabelTypes.ClassProperty
| BabelTypes.TSDeclareMethod
| BabelTypes.TSDeclareMethod;

export type MemberNode<K extends MemberType = MemberType> = (
| TSESTreeMemberNode
| BabelMemberNode
) & { type: K };

0 comments on commit 7d31de1

Please sign in to comment.