/** Creates an instance for a function that is an interface. */ static FunctionType forInterface( JSTypeRegistry registry, String name, Node source, TemplateTypeMap typeParameters) { return new FunctionType(registry, name, source, typeParameters); }
/** Construct a new function type. */ public FunctionType build() { return new FunctionType(registry, name, sourceNode, new ArrowType(registry, parametersNode, returnType, inferredReturnType), typeOfThis, templateTypeMap, isConstructor, isNativeType); } }
/** * Creates a constructor function type. * @param name the function's name or {@code null} to indicate that the * function is anonymous. * @param source the node defining this function. Its type * ({@link Node#getType()}) must be {@link Token#FUNCTION}. * @param parameters the function's parameters or {@code null} * to indicate that the parameter types are unknown. * @param returnType the function's return type or {@code null} to indicate * that the return type is unknown. * @param templateKeys the templatized types for the class. */ public FunctionType createConstructorType(String name, Node source, Node parameters, JSType returnType, ImmutableList<TemplateType> templateKeys) { Preconditions.checkArgument(source == null || source.isFunction()); return new FunctionType(this, name, source, createArrowType(parameters, returnType), null, createTemplateTypeMap(templateKeys, null), true, false); }
/** Create a new constructor with the parameters and return type stripped. */ public FunctionType forgetParameterAndReturnTypes() { FunctionType result = new FunctionType( registry, getReferenceName(), source, registry.createArrowType(null, null), getInstanceType(), null, true, false); result.setPrototypeBasedOn(getInstanceType()); return result; }
FunctionType ft = new FunctionType( registry, name,
call.returnTypeInferred || other.call.returnTypeInferred; return new FunctionType( registry, null, null, new ArrowType(
new FunctionType(this, "Object", null, createArrowType(createOptionalParameters(ALL_TYPE), null), null, new FunctionType(this, "Function", null, createArrowType( createParametersWithVarArgs(ALL_TYPE), UNKNOWN_TYPE), new FunctionType(this, "Array", null, createArrowType(createParametersWithVarArgs(ALL_TYPE), null), null, new FunctionType(this, "Boolean", null, createArrowType(createOptionalParameters(ALL_TYPE), BOOLEAN_TYPE), null, null, true, true); new FunctionType(this, "Date", null, createArrowType( createOptionalParameters(UNKNOWN_TYPE, UNKNOWN_TYPE, UNKNOWN_TYPE, new FunctionType(this, "Number", null, createArrowType(createOptionalParameters(ALL_TYPE), NUMBER_TYPE), null, null, true, true); new FunctionType(this, "RegExp", null, createArrowType(createOptionalParameters(ALL_TYPE, ALL_TYPE)), null, null, true, true); new FunctionType(this, "String", null,