diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 1cfaa903f7279..6fa57cc0a7143 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -45779,6 +45779,70 @@ namespace ts { } } + export function isBigIntLiteralType(type: Type): type is BigIntLiteralType { + return !!(type.flags & TypeFlags.BigIntLiteral); + } + + export function isConditionalType(type: Type): type is ConditionalType { + return !!(type.flags & TypeFlags.Conditional); + } + + export function isIndexType(type: Type): type is IndexType { + return !!(type.flags & TypeFlags.Index); + } + + export function isIndexedAccessType(type: Type): type is IndexedAccessType { + return !!(type.flags & TypeFlags.IndexedAccess); + } + + export function isIntersectionType(type: Type): type is IntersectionType { + return !!(type.flags & TypeFlags.Intersection); + } + + export function isNumberLiteralType(type: Type): type is NumberLiteralType { + return !!(type.flags & TypeFlags.NumberLiteral); + } + + export function isObjectType(type: Type): type is ObjectType { + return !!(type.flags & TypeFlags.Object); + } + + export function isStringMappingType(type: Type): type is StringMappingType { + return !!(type.flags & TypeFlags.StringMapping); + } + + export function isSubstitutionType(type: Type): type is SubstitutionType { + return !!(type.flags & TypeFlags.Substitution); + } + + export function isStringLiteralType(type: Type): type is StringLiteralType { + return !!(type.flags & TypeFlags.StringLiteral); + } + + export function isTemplateLiteralType(type: Type): type is TemplateLiteralType { + return !!(type.flags & TypeFlags.TemplateLiteral); + } + + export function isTypeParameterType(type: Type): type is TypeParameter { + return !!(type.flags & TypeFlags.TypeParameter); + } + + export function isThisTypeParameter(type: Type): boolean { + return isTypeParameterType(type) && !!type.isThisType; + } + + export function isTypeVariableType(type: Type): type is TypeVariable { + return !!(type.flags & TypeFlags.TypeVariable); + } + + export function isUnionType(type: Type): type is UnionType { + return !!(type.flags & TypeFlags.Union); + } + + export function isUnionOrIntersectionType(type: Type): type is IntersectionType | UnionType { + return !!(type.flags & TypeFlags.UnionOrIntersection); + } + namespace JsxNames { export const JSX = "JSX" as __String; export const IntrinsicElements = "IntrinsicElements" as __String; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 921d75d14ebab..17bd2ec6f5ca8 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -7670,70 +7670,6 @@ namespace ts { factory.createStringLiteral(name, !!singleQuote); } - export function isBigIntLiteralType(type: Type): type is BigIntLiteralType { - return !!(type.flags & TypeFlags.BigIntLiteral); - } - - export function isConditionalType(type: Type): type is ConditionalType { - return !!(type.flags & TypeFlags.Conditional); - } - - export function isIndexType(type: Type): type is IndexType { - return !!(type.flags & TypeFlags.Index); - } - - export function isIndexedAccessType(type: Type): type is IndexedAccessType { - return !!(type.flags & TypeFlags.IndexedAccess); - } - - export function isIntersectionType(type: Type): type is IntersectionType { - return !!(type.flags & TypeFlags.Intersection); - } - - export function isNumberLiteralType(type: Type): type is NumberLiteralType { - return !!(type.flags & TypeFlags.NumberLiteral); - } - - export function isObjectType(type: Type): type is ObjectType { - return !!(type.flags & TypeFlags.Object); - } - - export function isStringMappingType(type: Type): type is StringMappingType { - return !!(type.flags & TypeFlags.StringMapping); - } - - export function isSubstitutionType(type: Type): type is SubstitutionType { - return !!(type.flags & TypeFlags.Substitution); - } - - export function isStringLiteralType(type: Type): type is StringLiteralType { - return !!(type.flags & TypeFlags.StringLiteral); - } - - export function isTemplateLiteralType(type: Type): type is TemplateLiteralType { - return !!(type.flags & TypeFlags.TemplateLiteral); - } - - export function isTypeParameterType(type: Type): type is TypeParameter { - return !!(type.flags & TypeFlags.TypeParameter); - } - - export function isThisTypeParameter(type: Type): boolean { - return isTypeParameterType(type) && !!type.isThisType; - } - - export function isTypeVariableType(type: Type): type is TypeVariable { - return !!(type.flags & TypeFlags.TypeVariable); - } - - export function isUnionType(type: Type): type is UnionType { - return !!(type.flags & TypeFlags.Union); - } - - export function isUnionOrIntersectionType(type: Type): type is IntersectionType | UnionType { - return !!(type.flags & TypeFlags.UnionOrIntersection); - } - export interface NodeModulePathParts { readonly topLevelNodeModulesIndex: number; readonly topLevelPackageNameIndex: number;