getDeclaration method
Resolves the most specific declaration type.
Returns:
- The declaration as its most specific type (Class, Enum, etc.)
null
if the type doesn't match any known declaration variant
Checks types in this order:
- ClassDeclaration
- EnumDeclaration
- TypedefDeclaration
- RecordDeclaration
- MixinDeclaration
- TypeVariableDeclaration
Implementation
SourceDeclaration? getDeclaration() => asClass() ?? asEnum() ?? asTypedef() ?? asRecord() ?? asMixin() ?? asTypeVariable();