SymbolFlags

Symbols have SymbolFlags. Below we have them in their verbatim, as of TypeScript 2.2

  1. export const enum SymbolFlags {
  2. None = 0,
  3. FunctionScopedVariable = 1 << 0, // Variable (var) or parameter
  4. BlockScopedVariable = 1 << 1, // A block-scoped variable (let or const)
  5. Property = 1 << 2, // Property or enum member
  6. EnumMember = 1 << 3, // Enum member
  7. Function = 1 << 4, // Function
  8. Class = 1 << 5, // Class
  9. Interface = 1 << 6, // Interface
  10. ConstEnum = 1 << 7, // Const enum
  11. RegularEnum = 1 << 8, // Enum
  12. ValueModule = 1 << 9, // Instantiated module
  13. NamespaceModule = 1 << 10, // Uninstantiated module
  14. TypeLiteral = 1 << 11, // Type Literal or mapped type
  15. ObjectLiteral = 1 << 12, // Object Literal
  16. Method = 1 << 13, // Method
  17. Constructor = 1 << 14, // Constructor
  18. GetAccessor = 1 << 15, // Get accessor
  19. SetAccessor = 1 << 16, // Set accessor
  20. Signature = 1 << 17, // Call, construct, or index signature
  21. TypeParameter = 1 << 18, // Type parameter
  22. TypeAlias = 1 << 19, // Type alias
  23. ExportValue = 1 << 20, // Exported value marker (see comment in declareModuleMember in binder)
  24. ExportType = 1 << 21, // Exported type marker (see comment in declareModuleMember in binder)
  25. ExportNamespace = 1 << 22, // Exported namespace marker (see comment in declareModuleMember in binder)
  26. Alias = 1 << 23, // An alias for another symbol (see comment in isAliasSymbolDeclaration in checker)
  27. Prototype = 1 << 24, // Prototype property (no source representation)
  28. ExportStar = 1 << 25, // Export * declaration
  29. Optional = 1 << 26, // Optional property
  30. Transient = 1 << 27, // Transient symbol (created during type check)
  31. Enum = RegularEnum | ConstEnum,
  32. Variable = FunctionScopedVariable | BlockScopedVariable,
  33. Value = Variable | Property | EnumMember | Function | Class | Enum | ValueModule | Method | GetAccessor | SetAccessor,
  34. Type = Class | Interface | Enum | EnumMember | TypeLiteral | ObjectLiteral | TypeParameter | TypeAlias,
  35. Namespace = ValueModule | NamespaceModule | Enum,
  36. Module = ValueModule | NamespaceModule,
  37. Accessor = GetAccessor | SetAccessor,
  38. // Variables can be redeclared, but can not redeclare a block-scoped declaration with the
  39. // same name, or any other value that is not a variable, e.g. ValueModule or Class
  40. FunctionScopedVariableExcludes = Value & ~FunctionScopedVariable,
  41. // Block-scoped declarations are not allowed to be re-declared
  42. // they can not merge with anything in the value space
  43. BlockScopedVariableExcludes = Value,
  44. ParameterExcludes = Value,
  45. PropertyExcludes = None,
  46. EnumMemberExcludes = Value | Type,
  47. FunctionExcludes = Value & ~(Function | ValueModule),
  48. ClassExcludes = (Value | Type) & ~(ValueModule | Interface), // class-interface mergability done in checker.ts
  49. InterfaceExcludes = Type & ~(Interface | Class),
  50. RegularEnumExcludes = (Value | Type) & ~(RegularEnum | ValueModule), // regular enums merge only with regular enums and modules
  51. ConstEnumExcludes = (Value | Type) & ~ConstEnum, // const enums merge only with const enums
  52. ValueModuleExcludes = Value & ~(Function | Class | RegularEnum | ValueModule),
  53. NamespaceModuleExcludes = 0,
  54. MethodExcludes = Value & ~Method,
  55. GetAccessorExcludes = Value & ~SetAccessor,
  56. SetAccessorExcludes = Value & ~GetAccessor,
  57. TypeParameterExcludes = Type & ~TypeParameter,
  58. TypeAliasExcludes = Type,
  59. AliasExcludes = Alias,
  60. ModuleMember = Variable | Function | Class | Interface | Enum | Module | TypeAlias | Alias,
  61. ExportHasLocal = Function | Class | Enum | ValueModule,
  62. HasExports = Class | Enum | Module,
  63. HasMembers = Class | Interface | TypeLiteral | ObjectLiteral,
  64. BlockScoped = BlockScopedVariable | Class | Enum,
  65. PropertyOrAccessor = Property | Accessor,
  66. Export = ExportNamespace | ExportType | ExportValue,
  67. ClassMember = Method | Accessor | Property,
  68. /* @internal */
  69. // The set of things we consider semantically classifiable. Used to speed up the LS during
  70. // classification.
  71. Classifiable = Class | Enum | TypeAlias | Interface | TypeParameter | Module,
  72. }

ValueModule

ValueModule // Instantiated module is the SymbolFlag used for SourceFile if it an external module.