import * as ts from 'typescript' ; export function isConditionalType ( type ) { return ( type . flags & ts . TypeFlags . Conditional ) !== 0 ; } export function isEnumType ( type ) { return ( type . flags & ts . TypeFlags . Enum ) !== 0 ; } export function isGenericType ( type ) { return ( type . flags & ts . TypeFlags . Object ) !== 0 && ( ( < ts . ObjectType > type ) . objectFlags & ts . ObjectFlags . ClassOrInterface ) !== 0 && ( ( < ts . ObjectType > type ) . objectFlags & ts . ObjectFlags . Reference ) !== 0 ; } export function isIndexedAccessType ( type ) { return ( type . flags & ts . TypeFlags . IndexedAccess ) !== 0 ; } export function isIndexedAccessype ( type ) { return ( type . flags & ts . TypeFlags . Index ) !== 0 ; } export function isInstantiableType ( type ) { return ( type . flags & ts . TypeFlags . Instantiable ) !== 0 ; } export function isInterfaceType ( type ) { return ( type . flags & ts . TypeFlags . Object ) !== 0 && ( ( < ts . ObjectType > type ) . objectFlags & ts . ObjectFlags . ClassOrInterface ) !== 0 ; } export function isIntersectionType ( type ) { return ( type . flags & ts . TypeFlags . Intersection ) !== 0 ; } export function isLiteralType ( type ) { return ( type . flags & ( ts . TypeFlags . StringOrNumberLiteral | ts . TypeFlags . BigIntLiteral ) ) !== 0 ; } export function isObjectType ( type ) { return ( type . flags & ts . TypeFlags . Object ) !== 0 ; } export function isSubstitutionType ( type ) { return ( type . flags & ts . TypeFlags . Substitution ) !== 0 ; } export function isTypeParameter ( type ) { return ( type . flags & ts . TypeFlags . TypeParameter ) !== 0 ; } export function isTypeReference ( type ) { return ( type . flags & ts . TypeFlags . Object ) !== 0 && ( ( < ts . ObjectType > type ) . objectFlags & ts . ObjectFlags . Reference ) !== 0 ; } export function isTypeVariable ( type ) { return ( type . flags & ts . TypeFlags . TypeVariable ) !== 0 ; } export function isUnionOrIntersectionType ( type ) { return ( type . flags & ts . TypeFlags . UnionOrIntersection ) !== 0 ; } export function isUnionType ( type ) { return ( type . flags & ts . TypeFlags . Union ) !== 0 ; } export function isUniqueESSymbolType ( type ) { return ( type . flags & ts . TypeFlags . UniqueESSymbol ) !== 0 ; }