Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/typescript/enums/typeFlags.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export declare enum TypeFlags {
Intersection = 1 << 28,
Reserved1 = 1 << 29,
Reserved2 = 1 << 30,
Reserved3 = 1 << 31,
RegisteredESSymbol = 1 << 31,
AnyOrUnknown = Any | Unknown,
Nullable = Undefined | Null,
Literal = StringLiteral | NumberLiteral | BigIntLiteral | BooleanLiteral,
Expand All @@ -49,7 +49,7 @@ export declare enum TypeFlags {
BigIntLike = BigInt | BigIntLiteral,
BooleanLike = Boolean | BooleanLiteral,
EnumLike = Enum | EnumLiteral,
ESSymbolLike = ESSymbol | UniqueESSymbol,
ESSymbolLike = ESSymbol | UniqueESSymbol | RegisteredESSymbol,
VoidLike = Void | Undefined,
Primitive = StringLike | NumberLike | BigIntLike | BooleanLike | EnumLike | ESSymbolLike | VoidLike | Null,
DefinitelyNonNullable = StringLike | NumberLike | BigIntLike | BooleanLike | EnumLike | ESSymbolLike | Object | NonPrimitive,
Expand All @@ -58,13 +58,13 @@ export declare enum TypeFlags {
StructuredType = Object | Union | Intersection,
TypeVariable = TypeParameter | IndexedAccess,
InstantiableNonPrimitive = TypeVariable | Conditional | Substitution,
InstantiablePrimitive = Index | TemplateLiteral | StringMapping,
InstantiablePrimitive = Index | TemplateLiteral | StringMapping | RegisteredESSymbol,
Instantiable = InstantiableNonPrimitive | InstantiablePrimitive,
StructuredOrInstantiable = StructuredType | Instantiable,
ObjectFlagsType = Any | Nullable | Never | Object | Union | Intersection,
Simplifiable = IndexedAccess | Conditional | Index,
Singleton = Any | Unknown | String | Number | Boolean | BigInt | ESSymbol | Void | Undefined | Null | Never | NonPrimitive,
Narrowable = Any | Unknown | StructuredOrInstantiable | StringLike | NumberLike | BigIntLike | BooleanLike | ESSymbol | UniqueESSymbol | NonPrimitive,
Narrowable = Any | Unknown | StructuredOrInstantiable | StringLike | NumberLike | BigIntLike | BooleanLike | ESSymbolLike | NonPrimitive,
IncludesMask = Any | Unknown | Primitive | Never | Object | Union | Intersection | NonPrimitive | TemplateLiteral | StringMapping,
IncludesMissingType = TypeParameter,
IncludesNonWideningType = Index,
Expand Down
20 changes: 10 additions & 10 deletions packages/typescript/enums/typeFlags.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export var TypeFlags;
TypeFlags[TypeFlags["Intersection"] = 268435456] = "Intersection";
TypeFlags[TypeFlags["Reserved1"] = 536870912] = "Reserved1";
TypeFlags[TypeFlags["Reserved2"] = 1073741824] = "Reserved2";
TypeFlags[TypeFlags["Reserved3"] = -2147483648] = "Reserved3";
TypeFlags[TypeFlags["RegisteredESSymbol"] = -2147483648] = "RegisteredESSymbol";
TypeFlags[TypeFlags["AnyOrUnknown"] = 3] = "AnyOrUnknown";
TypeFlags[TypeFlags["Nullable"] = 12] = "Nullable";
TypeFlags[TypeFlags["Literal"] = 15360] = "Literal";
Expand All @@ -49,23 +49,23 @@ export var TypeFlags;
TypeFlags[TypeFlags["BigIntLike"] = 4224] = "BigIntLike";
TypeFlags[TypeFlags["BooleanLike"] = 8448] = "BooleanLike";
TypeFlags[TypeFlags["EnumLike"] = 98304] = "EnumLike";
TypeFlags[TypeFlags["ESSymbolLike"] = 16896] = "ESSymbolLike";
TypeFlags[TypeFlags["ESSymbolLike"] = -2147466752] = "ESSymbolLike";
TypeFlags[TypeFlags["VoidLike"] = 20] = "VoidLike";
TypeFlags[TypeFlags["Primitive"] = 12713980] = "Primitive";
TypeFlags[TypeFlags["DefinitelyNonNullable"] = 13893600] = "DefinitelyNonNullable";
TypeFlags[TypeFlags["DisjointDomains"] = 12812284] = "DisjointDomains";
TypeFlags[TypeFlags["Primitive"] = -2134769668] = "Primitive";
TypeFlags[TypeFlags["DefinitelyNonNullable"] = -2133590048] = "DefinitelyNonNullable";
TypeFlags[TypeFlags["DisjointDomains"] = -2134671364] = "DisjointDomains";
TypeFlags[TypeFlags["UnionOrIntersection"] = 402653184] = "UnionOrIntersection";
TypeFlags[TypeFlags["StructuredType"] = 403701760] = "StructuredType";
TypeFlags[TypeFlags["TypeVariable"] = 34078720] = "TypeVariable";
TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 117964800] = "InstantiableNonPrimitive";
TypeFlags[TypeFlags["InstantiablePrimitive"] = 14680064] = "InstantiablePrimitive";
TypeFlags[TypeFlags["Instantiable"] = 132644864] = "Instantiable";
TypeFlags[TypeFlags["StructuredOrInstantiable"] = 536346624] = "StructuredOrInstantiable";
TypeFlags[TypeFlags["InstantiablePrimitive"] = -2132803584] = "InstantiablePrimitive";
TypeFlags[TypeFlags["Instantiable"] = -2014838784] = "Instantiable";
TypeFlags[TypeFlags["StructuredOrInstantiable"] = -1611137024] = "StructuredOrInstantiable";
TypeFlags[TypeFlags["ObjectFlagsType"] = 403963917] = "ObjectFlagsType";
TypeFlags[TypeFlags["Simplifiable"] = 102760448] = "Simplifiable";
TypeFlags[TypeFlags["Singleton"] = 394239] = "Singleton";
TypeFlags[TypeFlags["Narrowable"] = 536575971] = "Narrowable";
TypeFlags[TypeFlags["IncludesMask"] = 416808959] = "IncludesMask";
TypeFlags[TypeFlags["Narrowable"] = -1610907677] = "Narrowable";
TypeFlags[TypeFlags["IncludesMask"] = -1730674689] = "IncludesMask";
TypeFlags[TypeFlags["IncludesMissingType"] = 524288] = "IncludesMissingType";
TypeFlags[TypeFlags["IncludesNonWideningType"] = 2097152] = "IncludesNonWideningType";
TypeFlags[TypeFlags["IncludesWildcard"] = 33554432] = "IncludesWildcard";
Expand Down
2 changes: 1 addition & 1 deletion tsc/internal/api/enum_values_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion tsc/internal/bundled/libs/lib.es2015.symbol.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface SymbolConstructor {
* Otherwise, returns a new symbol with this key.
* @param key key to search for.
*/
for(key: string): symbol;
for<Key extends StringConvertible>(key: Key): RegisteredSymbol<Key>;

/**
* Returns a key from the global symbol registry matching the given Symbol if found.
Expand All @@ -41,3 +41,8 @@ interface SymbolConstructor {
}

declare var Symbol: SymbolConstructor;

/** Excludes primitive symbols; converting an object to a string can still throw. */
type StringConvertible = string | number | bigint | boolean | null | undefined | object;

type RegisteredSymbol<Key extends StringConvertible> = intrinsic;
Loading