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

Composite Variable Flags

Represents any kind of variable.

Callable Flags

Composite Accessor Flags

Represents property accessors.

Type Declaration Flags

Composite Enum Flags

Represents any enum.

Module Flags

Composite Module Flags

Special Flags

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