Class RecordType
- java.lang.Object
-
- com.google.javascript.rhino.jstype.JSType
-
- com.google.javascript.rhino.jstype.ObjectType
-
- com.google.javascript.rhino.jstype.PrototypeObjectType
-
- com.google.javascript.rhino.jstype.RecordType
-
public class RecordType extends PrototypeObjectType
A record (structural) type. Subtyping: The subtyping of a record type is defined via structural comparison of a record type's properties. For example, a record type of the form { a : TYPE_1 } is a supertype of a record type of the form { b : TYPE_2, a : TYPE_1 } because B can be assigned to A and matches all constraints. Similarly, a defined type can be assigned to a record type so long as that defined type matches all property constraints of the record type. A record type of the form { a : A, b : B } can be assigned to a record of type { a : A }.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.javascript.rhino.jstype.JSType
JSType.HasPropertyKind, JSType.Nullability, JSType.SubtypingMode, JSType.TypePair
-
-
Field Summary
-
Fields inherited from class com.google.javascript.rhino.jstype.JSType
templateTypeMap
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectTypegetImplicitPrototype()Gets the implicit prototype (a.k.a.booleanisStructuralType()RecordTypetoMaybeRecordType()Downcasts this to a RecordType, or returns null if this is not a RecordType.-
Methods inherited from class com.google.javascript.rhino.jstype.PrototypeObjectType
getConstructor, getCtorExtendedInterfaces, getCtorImplementedInterfaces, getOwnerFunction, getReferenceName, getTemplateParamCount, isAnonymous, isNativeObjectType, matchConstraint, matchesNumberContext, matchesObjectContext, matchesStringContext, matchesSymbolContext, matchRecordTypeConstraint, removeProperty, setPropertyJSDocInfo, setPropertyNode
-
Methods inherited from class com.google.javascript.rhino.jstype.ObjectType
cast, clearCachedValues, createDelegateSuffix, defineDeclaredProperty, defineInferredProperty, defineSynthesizedProperty, findClosestDefinition, findPropertyTypeWithoutConsideringTemplateTypes, getClosestDefiningType, getDisplayName, getEnumeratedTypeOfEnumObject, getImplicitPrototypeChain, getJSDocInfo, getNormalizedReferenceName, getOwnPropertyDefSite, getOwnPropertyJSDocInfo, getOwnPropertyKind, getOwnPropertyNames, getOwnSlot, getPossibleToBooleanOutcomes, getPropertiesCount, getPropertyDefSite, getPropertyJSDocInfo, getPropertyKind, getPropertyNames, getPropertyNode, getPropertyType, getPropertyTypeMap, getRawType, getSlot, getSuperClassConstructor, getTemplateTypes, getTypeOfThis, hasCachedValues, hasOwnProperty, hasReferenceName, isFunctionPrototypeType, isObject, isPropertyInExterns, isPropertyTypeDeclared, isPropertyTypeInferred, isUnknownType, setJSDocInfo, testForEquality, visit
-
Methods inherited from class com.google.javascript.rhino.jstype.JSType
areIdentical, areSimilar, assertFunctionType, assertObjectType, autobox, autoboxesTo, canBeCalled, canCastTo, canTestForEqualityWith, canTestForShallowEqualityWith, collapseUnion, containsReferenceAncestor, dereference, differsFrom, equals, findPropertyType, getEnumeratedTypeOfEnumElement, getGreatestSubtype, getLeastSupertype, getPropertyKind, getRestrictedTypeGivenOutcome, getTemplateTypeMap, getTypeParameters, getTypesUnderEquality, getTypesUnderInequality, getTypesUnderShallowEquality, getTypesUnderShallowInequality, getUnionMembers, hasAnyTemplateTypes, hasDisplayName, hashCode, hasProperty, isAllType, isArrayType, isBigIntObjectType, isBigIntOrNumber, isBigIntValueType, isBooleanObjectType, isBooleanValueType, isBoxableScalar, isCheckedUnknownType, isConstructor, isDateType, isDict, isEmptyType, isEnumElementType, isEnumType, isExplicitlyVoidable, isFunctionType, isGlobalThisType, isInstanceType, isInterface, isLiteralObject, isNamedType, isNominalConstructorOrInterface, isNominalType, isNoObjectType, isNoResolvedType, isNoType, isNullable, isNullType, isNumber, isNumberObjectType, isNumberValueType, isObjectType, isOnlyBigInt, isOrdinaryFunction, isRawTypeOfTemplatizedType, isRecordType, isRegexpType, isResolved, isSomeUnknownType, isString, isStringObjectType, isStringValueType, isStruct, isStructuralInterface, isSubtype, isSubtype, isSubtypeOf, isSubtypeOf, isSubtypeWithoutStructuralTyping, isSuccessfullyResolved, isSymbol, isSymbolObjectType, isSymbolValueType, isTemplateType, isTemplatizedType, isUnionType, isUnresolved, isUnresolvedOrResolvedUnknown, isUnsuccessfullyResolved, isVoidable, isVoidType, loosenTypecheckingDueToForwardReferencedSupertype, mergeSupertypeTemplateTypes, resolve, restrictByNotNull, restrictByNotNullOrUndefined, restrictByNotUndefined, setValidator, toAnnotationString, toMaybeEnumElementType, toMaybeEnumType, toMaybeFunctionType, toMaybeFunctionType, toMaybeNamedType, toMaybeObjectType, toMaybeTemplateType, toMaybeTemplatizedType, toMaybeUnionType, toObjectType, toString
-
-
-
-
Method Detail
-
getImplicitPrototype
public ObjectType getImplicitPrototype()
Description copied from class:ObjectTypeGets the implicit prototype (a.k.a. the[[Prototype]]property).- Overrides:
getImplicitPrototypein classPrototypeObjectType
-
toMaybeRecordType
public RecordType toMaybeRecordType()
Description copied from class:JSTypeDowncasts this to a RecordType, or returns null if this is not a RecordType.- Overrides:
toMaybeRecordTypein classJSType
-
isStructuralType
public boolean isStructuralType()
- Overrides:
isStructuralTypein classObjectType
-
-