public final class FunctionTypeBuilder extends Object
FunctionType
and DeclaredFunctionType
.
The builder is called during both JSDoc parsing and type inference, and
these parts use different warning systems, so expect the context to handle
the exception appropriately.Constructor and Description |
---|
FunctionTypeBuilder() |
Modifier and Type | Method and Description |
---|---|
FunctionTypeBuilder |
addLoose() |
FunctionTypeBuilder |
addNominalType(JSType t) |
FunctionTypeBuilder |
addOptFormal(JSType t) |
FunctionTypeBuilder |
addOuterVarPrecondition(String name,
JSType t) |
FunctionTypeBuilder |
addPlaceholderFormal()
Used when the order of required/optional/rest formals in a function jsdoc is wrong.
|
FunctionTypeBuilder |
addReceiverType(JSType t) |
FunctionTypeBuilder |
addReqFormal(JSType t) |
FunctionTypeBuilder |
addRestFormals(JSType t) |
FunctionTypeBuilder |
addRetType(JSType t) |
FunctionTypeBuilder |
addTypeParameters(com.google.common.collect.ImmutableList<String> typeParameters) |
DeclaredFunctionType |
buildDeclaration() |
FunctionType |
buildFunction() |
public FunctionTypeBuilder addPlaceholderFormal()
public FunctionTypeBuilder addReqFormal(JSType t) throws com.google.javascript.jscomp.newtypes.FunctionTypeBuilder.WrongParameterOrderException
com.google.javascript.jscomp.newtypes.FunctionTypeBuilder.WrongParameterOrderException
public FunctionTypeBuilder addOptFormal(JSType t) throws com.google.javascript.jscomp.newtypes.FunctionTypeBuilder.WrongParameterOrderException
com.google.javascript.jscomp.newtypes.FunctionTypeBuilder.WrongParameterOrderException
public FunctionTypeBuilder addOuterVarPrecondition(String name, JSType t)
public FunctionTypeBuilder addRestFormals(JSType t)
public FunctionTypeBuilder addRetType(JSType t)
public FunctionTypeBuilder addLoose()
public FunctionTypeBuilder addNominalType(JSType t)
public FunctionTypeBuilder addTypeParameters(com.google.common.collect.ImmutableList<String> typeParameters)
public FunctionTypeBuilder addReceiverType(JSType t)
public DeclaredFunctionType buildDeclaration()
public FunctionType buildFunction()
Copyright © 2009–2023 Google. All rights reserved.