Package com.vaadin.hilla.generator.model
Interface TypeModel
- All Known Implementing Classes:
TypeModel.ArrayOf,TypeModel.EntityRef,TypeModel.MapOf,TypeModel.Provided,TypeModel.Scalar,TypeModel.TypeVariable
public sealed interface TypeModel
permits TypeModel.Scalar, TypeModel.ArrayOf, TypeModel.MapOf, TypeModel.EntityRef, TypeModel.Provided, TypeModel.TypeVariable
A type as the TypeScript generator needs it: what to write, with the
questions a Java type raises already answered.
Notably, whether a value can be absent is decided here, from the Java type, the nullability annotations and the Kotlin metadata, rather than being rediscovered by whatever writes the TypeScript.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordstatic final recordA reference to a type generated as a TypeScript declaration of its own.static final recordstatic final recordA type the generated TypeScript refers to by name rather than by declaring it: one the browser has, such as a file, or one a module of the framework exports, such as a signal.static final recordstatic enumThe types which TypeScript expresses without a declaration of their own.static final recordA reference to a type parameter of the declaration being written, which is written as it is. -
Method Summary
Modifier and TypeMethodDescriptionThe annotations of a value which a form model is told about: whether a value is the id of an entity is nothing TypeScript can see, and a form or a grid built from the model decides with it what to do with the value.What a value of the type has to satisfy, which a form model binds as the validators of the property holding it.booleanoptional()Whether the value may be absent, which TypeScript spells as a union withundefined.withOptional(boolean optional) The same type, said to be absent or not as given.
-
Method Details
-
optional
boolean optional()Whether the value may be absent, which TypeScript spells as a union withundefined. -
constraints
List<ConstraintModel> constraints()What a value of the type has to satisfy, which a form model binds as the validators of the property holding it. The constraints belong to the type rather than to the property, since the values of a collection can be constrained as well as the collection itself. -
annotations
List<AnnotationModel> annotations()The annotations of a value which a form model is told about: whether a value is the id of an entity is nothing TypeScript can see, and a form or a grid built from the model decides with it what to do with the value. -
withOptional
The same type, said to be absent or not as given.
-