Skip to main content
The SymbolFlags enum contains bit flags that classify symbols in the TypeScript compiler. Every Symbol object has a flags property indicating what kind of declaration(s) it represents.

Variable Flags

FlagDescription
FunctionScopedVariableVariable declared with var or parameter
BlockScopedVariableVariable declared with let or const
PropertyProperty or enum member
EnumMemberEnum member

Composite Variable Flags

Represents any kind of variable.

Callable Flags

FlagDescription
FunctionFunction declaration or expression
MethodClass or object method
ConstructorClass constructor
GetAccessorGetter accessor
SetAccessorSetter accessor
SignatureCall, construct, or index signature

Composite Accessor Flags

Represents property accessors.

Type Declaration Flags

FlagDescription
ClassClass declaration
InterfaceInterface declaration
ConstEnumConst enum declaration
RegularEnumRegular enum declaration
TypeLiteralType literal or mapped type
TypeParameterType parameter
TypeAliasType alias declaration

Composite Enum Flags

Represents any enum.

Module Flags

FlagDescription
ValueModuleInstantiated module (namespace with runtime value)
NamespaceModuleNon-instantiated module (type-only namespace)

Composite Module Flags

Special Flags

FlagDescription
ObjectLiteralObject literal
AliasImport alias or type alias
PrototypePrototype property (no source representation)
ExportValueExported value marker
ExportStarexport * declaration
OptionalOptional property
TransientTransient symbol (created during type checking)
AssignmentAssignment treated as declaration (e.g., this.prop = 1)
ModuleExportsCommonJS module.exports

Composite Meaning Flags

These flags group symbols by their semantic meaning:

Value Flags

Symbols that contribute a value to the JavaScript runtime.

Type Flags

Symbols that contribute a type to the type system.

Namespace Flags

Symbols that contribute a namespace.

Exclusion Flags

Exclusion flags determine what cannot be merged with a symbol:

Variable Exclusions

var declarations can be redeclared with other var declarations, but block-scoped variables cannot be redeclared.

Declaration Exclusions

Enum Exclusions

Regular enums can merge with other regular enums and modules. Const enums can only merge with other const enums.

Module and Accessor Exclusions

Type Exclusions

Module Member Flags

Symbols that can be members of a module.

Scope Flags

Symbols that are block-scoped.

Export Flags

Exports that have a local symbol.

Class Member Flags

Symbols that can be class members.

Usage Examples

Checking Symbol Flags

Distinguishing Variable Types

Checking for Functions and Methods

Working with Enums

Checking Multiple Meanings

Finding Declarations

Type Guards

Advanced Patterns

Declaration Merging

Finding Symbol Kind

See Also