Class TemplateTypeReplacer
java.lang.Object
com.google.javascript.rhino.jstype.TemplateTypeReplacer
Specializes
TemplatizedTypes according to provided bindings.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.javascript.rhino.jstype.Visitor
Visitor.WithDefaultCase<T> -
Method Summary
Modifier and TypeMethodDescriptionAll type's case.BigInt value type's case.Boolean value type's case.Enum element type's case.caseFunctionType(FunctionType type) Function type's case.caseNamedType(NamedType type) Named type's case.Bottom Object type's case.caseNoType(NoType type) Bottom type's case.Null type's case.Number value type's case.caseObjectType(ObjectType objType) Object type's case.Proxy type's case.String value type's case.Symbol value type's case.caseTemplateType(TemplateType type) Template type's case.Templatized type's case.caseUnionType(UnionType type) Union type's case.Unknown type's case.Void type's case.static TemplateTypeReplacerforInference(JSTypeRegistry registry, Map<TemplateType, JSType> bindings) Creates a replacer for use duringTypeInference.static TemplateTypeReplacerforPartialReplacement(JSTypeRegistry registry, TemplateTypeMap bindings) Creates a replacer that may not totally eliminateTemplateTypes from the definitions of the types it performs replacement on.static TemplateTypeReplacerforTotalReplacement(JSTypeRegistry registry, TemplateTypeMap bindings) Creates a replacer that will always totally eliminateTemplateTypes from the definitions of the types it performs replacement on.boolean
-
Method Details
-
forInference
public static TemplateTypeReplacer forInference(JSTypeRegistry registry, Map<TemplateType, JSType> bindings) Creates a replacer for use duringTypeInference. -
forTotalReplacement
public static TemplateTypeReplacer forTotalReplacement(JSTypeRegistry registry, TemplateTypeMap bindings) Creates a replacer that will always totally eliminateTemplateTypes from the definitions of the types it performs replacement on.If a binding for a
TemplateTypeis required but not provided, `?` will be used. -
forPartialReplacement
public static TemplateTypeReplacer forPartialReplacement(JSTypeRegistry registry, TemplateTypeMap bindings) Creates a replacer that may not totally eliminateTemplateTypes from the definitions of the types it performs replacement on.If a binding for a
TemplateTypeis required but not provided, uses of that type will not be replaced. -
hasMadeReplacement
public boolean hasMadeReplacement() -
caseNoType
Description copied from interface:VisitorBottom type's case.- Specified by:
caseNoTypein interfaceVisitor<JSType>
-
caseEnumElementType
Description copied from interface:VisitorEnum element type's case.- Specified by:
caseEnumElementTypein interfaceVisitor<JSType>
-
caseAllType
Description copied from interface:VisitorAll type's case.- Specified by:
caseAllTypein interfaceVisitor<JSType>
-
caseBooleanType
Description copied from interface:VisitorBoolean value type's case.- Specified by:
caseBooleanTypein interfaceVisitor<JSType>
-
caseNoObjectType
Description copied from interface:VisitorBottom Object type's case.- Specified by:
caseNoObjectTypein interfaceVisitor<JSType>
-
caseFunctionType
Description copied from interface:VisitorFunction type's case.- Specified by:
caseFunctionTypein interfaceVisitor<JSType>
-
caseObjectType
Description copied from interface:VisitorObject type's case.- Specified by:
caseObjectTypein interfaceVisitor<JSType>
-
caseTemplatizedType
Description copied from interface:VisitorTemplatized type's case.- Specified by:
caseTemplatizedTypein interfaceVisitor<JSType>
-
caseUnknownType
Description copied from interface:VisitorUnknown type's case.- Specified by:
caseUnknownTypein interfaceVisitor<JSType>
-
caseNullType
Description copied from interface:VisitorNull type's case.- Specified by:
caseNullTypein interfaceVisitor<JSType>
-
caseNumberType
Description copied from interface:VisitorNumber value type's case.- Specified by:
caseNumberTypein interfaceVisitor<JSType>
-
caseBigIntType
Description copied from interface:VisitorBigInt value type's case.- Specified by:
caseBigIntTypein interfaceVisitor<JSType>
-
caseStringType
Description copied from interface:VisitorString value type's case.- Specified by:
caseStringTypein interfaceVisitor<JSType>
-
caseSymbolType
Description copied from interface:VisitorSymbol value type's case.- Specified by:
caseSymbolTypein interfaceVisitor<JSType>
-
caseVoidType
Description copied from interface:VisitorVoid type's case.- Specified by:
caseVoidTypein interfaceVisitor<JSType>
-
caseUnionType
Description copied from interface:VisitorUnion type's case.- Specified by:
caseUnionTypein interfaceVisitor<JSType>
-
caseTemplateType
Description copied from interface:VisitorTemplate type's case.- Specified by:
caseTemplateTypein interfaceVisitor<JSType>
-
caseNamedType
Description copied from interface:VisitorNamed type's case.- Specified by:
caseNamedTypein interfaceVisitor<JSType>
-
caseProxyObjectType
Description copied from interface:VisitorProxy type's case.- Specified by:
caseProxyObjectTypein interfaceVisitor<JSType>
-