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
| Flag | Description |
|---|---|
FunctionScopedVariable | Variable declared with var or parameter |
BlockScopedVariable | Variable declared with let or const |
Property | Property or enum member |
EnumMember | Enum member |
Composite Variable Flags
Callable Flags
| Flag | Description |
|---|---|
Function | Function declaration or expression |
Method | Class or object method |
Constructor | Class constructor |
GetAccessor | Getter accessor |
SetAccessor | Setter accessor |
Signature | Call, construct, or index signature |
Composite Accessor Flags
Type Declaration Flags
| Flag | Description |
|---|---|
Class | Class declaration |
Interface | Interface declaration |
ConstEnum | Const enum declaration |
RegularEnum | Regular enum declaration |
TypeLiteral | Type literal or mapped type |
TypeParameter | Type parameter |
TypeAlias | Type alias declaration |
Composite Enum Flags
Module Flags
| Flag | Description |
|---|---|
ValueModule | Instantiated module (namespace with runtime value) |
NamespaceModule | Non-instantiated module (type-only namespace) |
Composite Module Flags
Special Flags
| Flag | Description |
|---|---|
ObjectLiteral | Object literal |
Alias | Import alias or type alias |
Prototype | Prototype property (no source representation) |
ExportValue | Exported value marker |
ExportStar | export * declaration |
Optional | Optional property |
Transient | Transient symbol (created during type checking) |
Assignment | Assignment treated as declaration (e.g., this.prop = 1) |
ModuleExports | CommonJS module.exports |
Composite Meaning Flags
These flags group symbols by their semantic meaning:Value Flags
Type Flags
Namespace Flags
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
Module and Accessor Exclusions
Type Exclusions
Module Member Flags
Scope Flags
Export Flags
Class Member Flags
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
- Node Types - AST node types
- TypeFlags - Type system flags
- Type Checker API - Working with symbols and types