public class GlobalTypeInfo extends Object implements TypeIRegistry
Used by the new type inference. See go/jscompiler-new-type-checker for the latest updates.
| Modifier and Type | Method and Description |
|---|---|
TypeI |
buildRecordTypeFromObject(ObjectTypeI obj) |
String |
createGetterPropName(String originalPropName)
For NTI, this method returns an obfuscated name that represents the getter.
|
TypeI |
createRecordType(Map<String,? extends TypeI> props)
Creates an anonymous structural type with the given properties.
|
String |
createSetterPropName(String originalPropName)
For NTI, this method returns an obfuscated name that represents the setter.
|
TypeI |
createTypeFromCommentNode(Node n) |
TypeI |
createUnionType(List<? extends TypeI> members) |
TypeI |
evaluateTypeExpression(JSTypeExpression expr,
TypeIEnv<TypeI> typeEnv)
This method is only called by TTL and the typeEnv passed is the global scope.
|
TypeI |
evaluateTypeExpressionInGlobalScope(JSTypeExpression expr) |
JSType |
getNativeFunctionType(JSTypeNative typeId) |
JSType |
getNativeObjectType(JSTypeNative typeId) |
JSType |
getNativeType(JSTypeNative typeId) |
String |
getReadableTypeName(Node n) |
JSType |
getType(String typeName)
Returns the type represented by typeName or null if not found.
|
JSTypeCreatorFromJSDoc |
getTypeParser() |
UniqueNameGenerator |
getVarNameGen() |
TypeI |
instantiateGenericType(ObjectTypeI genericType,
com.google.common.collect.ImmutableList<? extends TypeI> typeArgs)
Instantiates genericType using typeArgs.
|
public JSTypeCreatorFromJSDoc getTypeParser()
public UniqueNameGenerator getVarNameGen()
public TypeI createTypeFromCommentNode(Node n)
createTypeFromCommentNode in interface TypeIRegistrypublic JSType getNativeFunctionType(JSTypeNative typeId)
getNativeFunctionType in interface TypeIRegistrypublic JSType getNativeObjectType(JSTypeNative typeId)
getNativeObjectType in interface TypeIRegistrypublic JSType getNativeType(JSTypeNative typeId)
getNativeType in interface TypeIRegistrypublic String getReadableTypeName(Node n)
getReadableTypeName in interface TypeIRegistrypublic JSType getType(String typeName)
TypeIRegistrygetType in interface TypeIRegistrypublic String createGetterPropName(String originalPropName)
TypeIRegistrycreateGetterPropName in interface TypeIRegistrypublic String createSetterPropName(String originalPropName)
TypeIRegistrycreateSetterPropName in interface TypeIRegistrypublic TypeI createUnionType(List<? extends TypeI> members)
createUnionType in interface TypeIRegistrypublic TypeI evaluateTypeExpression(JSTypeExpression expr, TypeIEnv<TypeI> typeEnv)
evaluateTypeExpression in interface TypeIRegistrypublic TypeI evaluateTypeExpressionInGlobalScope(JSTypeExpression expr)
evaluateTypeExpressionInGlobalScope in interface TypeIRegistrypublic TypeI createRecordType(Map<String,? extends TypeI> props)
TypeIRegistrycreateRecordType in interface TypeIRegistrypublic TypeI instantiateGenericType(ObjectTypeI genericType, com.google.common.collect.ImmutableList<? extends TypeI> typeArgs)
TypeIRegistryinstantiateGenericType in interface TypeIRegistrypublic TypeI buildRecordTypeFromObject(ObjectTypeI obj)
buildRecordTypeFromObject in interface TypeIRegistryCopyright © 2009-2017 Google. All Rights Reserved.