Full name:
cz.habarta.typescript-generator:typescript-generator-maven-plugin:2.36.1070:generate
Description:
Attributes:
compile
.process-classes
.Name | Type | Since | Description |
---|---|---|---|
<jsonLibrary> |
JsonLibrary |
- |
Library used in JSON classes. Supported values are:
jackson2 . |
<outputKind> |
TypeScriptOutputKind |
- |
Kind of generated TypeScript output. Allowed values are:
|
Name | Type | Since | Description |
---|---|---|---|
<addTypeNamePrefix> |
String |
- |
Prefix which will be added to names of classes, interfaces, enums.
For example if set to I then mapping for
Data will be IData . |
<addTypeNameSuffix> |
String |
- |
Suffix which will be added to names of classes, interfaces, enums.
For example if set to Data then mapping for
Person will be PersonData . |
<additionalDataLibraries> |
List |
- |
Allows to add support for specified libraries. Some libraries have
special Jackson serializers and deserializers for their data types
so this parameter allows to reflect actual JSON format of those
data types. Note: specified library must be present in project
dependencies (typescript-generator itself doesn't depend on those
libraries). Supported libraries are:
|
<classPatterns> |
List |
- |
Classes to process specified using glob patterns so it is possible
to specify package or class name suffix. Glob patterns support two
wildcards:
|
<classes> |
List |
- |
Classes to process. |
<classesExtendingClasses> |
List |
- |
Classes to process specified by extended superclasses. |
<classesFromAutomaticJaxrsApplication> |
boolean |
- |
Scans JAX-RS resources for JSON classes to process. It is possible
to exclude particular REST resource classes using
excludeClasses parameter. |
<classesFromJaxrsApplication> |
String |
- |
Scans specified JAX-RS Application for classes to
process. Parameter contains fully-qualified class name. It is
possible to exclude particular REST resource classes using
excludeClasses parameter. |
<classesImplementingInterfaces> |
List |
- |
Classes to process specified by implemented interface. |
<classesWithAnnotations> |
List |
- |
Classes to process specified by annotations. |
<customTypeAliases> |
List |
- |
List of custom type aliases. Each item it this list specifies type
alias name (possibly with generic parameters) and its definition.
Item format is: name:definition . For example for
Unwrap<T>:T following type alias will be
generated type Unwrap<T> = T . Other examples:
SimpleName:VeryLongGeneratedName ,
StringID<T>:string . |
<customTypeMappings> |
List |
- |
List of custom mappings. Each item specifies TypeScript type which
will be used for particular Java class. Item format is:
javaClassName:typescriptType . For example mapping
Joda-Time LocalDateTime to string would
be added as org.joda.time.LocalDateTime:string .
Mappings of generic classes must use syntax
com.package.MyGenericClass<T1,T2>:TsGenericType2<T1,T2> .
Instead of <T1,T2> it is also possible to use
[T1,T2] . |
<customTypeNaming> |
List |
- |
Specifies custom TypeScript names for Java classes. Multiple
mappings can be specified, each using this format:
javaClassName:typescriptName . This takes precedence
over other naming settings. For more information and example see Type
Mapping Wiki page. |
<customTypeNamingFunction> |
String |
- |
Specifies JavaScript function for getting custom TypeScript names
for Java classes. Function can return undefined if default name
should be used. Function signature: function getName(className: string,
classSimpleName: string): string | null | undefined; Example function: function(name, simpleName) { if
(name.startsWith('cz.')) return 'Test' + simpleName; } |
<customTypeProcessor> |
String |
- |
Specifies custom class implementing TypeProcessor .
This allows to customize how Java types are mapped to TypeScript.
For example it is possible to implement TypeProcessor for
Optional from guava. |
<debug> |
boolean |
- |
Deprecated, use loggingLevel parameter. |
<declarePropertiesAsOptional> |
boolean |
- |
Deprecated, use optionalProperties parameter. |
<declarePropertiesAsReadOnly> |
boolean |
- |
If true declared properties will be
readonly . |
<disableJackson2ModuleDiscovery> |
boolean |
- |
Deprecated, see jackson2ModuleDiscovery and
jackson2Modules parameters. |
<disableTaggedUnionAnnotations> |
List |
- |
Specifies annotations used for disabling tagged union created from
classes. In case of Jackson2 library this means class hierarchy
formed using @JsonTypeInfo and
@JsonSubTypes annotations. While
disableTaggedUnions parameter only disables creation
of TypeScript discriminated union types this parameter allows to
disable also processing of discriminant property. |
<disableTaggedUnions> |
boolean |
- |
If true tagged unions will not be generated for
Jackson 2 polymorphic types. This parameter does not disable
processing of discriminant property. See also
disableTaggedUnionAnnotations parameter. |
<displaySerializerWarning> |
boolean |
- |
Deprecated. |
<enumMemberCasing> |
IdentifierCasing |
- |
Specifies how enum members will be named. Supported values are:
keepOriginal . |
<excludeClassPatterns> |
List |
- |
Excluded classes specified using glob patterns. For more
information and examples see Class
Names Glob Patterns Wiki page. |
<excludeClasses> |
List |
- |
List of classes excluded from processing. |
<excludePropertyAnnotations> |
List |
- |
Properties with any of these annotations will be excluded. |
<extensions> |
List |
- |
List of extensions specified as fully qualified class name. Known
extensions:
extensionsWithConfiguration can be used in
case extension needs some configuration. |
<extensionsWithConfiguration> |
List |
- |
List of extensions with their configurations. This parameter has
the same purpose as extensions parameter. Each item of
this list has
|
<generateConstructors> |
boolean |
- |
If true generated classes will also have constructors.
Generated constructors use "named parameters" pattern so when
calling such constructor parameters need to be wrapped in "options"
object. This parameter can only be used when
mapClasses parameter is set to asClasses
value. |
<generateInfoJson> |
boolean |
- |
If true JSON file describing generated module will be
generated. In following typescript-generator run this allows to
generate another module which could depend on currently generated
module. Generated JSON file contains mapping from Java classes to
TypeScript types which typescript-generator needs when the module
is referenced from another module using
moduleDependencies parameter. Only applicable when
outputKind is set to module . |
<generateJaxrsApplicationClient> |
boolean |
- |
If true client for JAX-RS REST application will be
generated. |
<generateJaxrsApplicationInterface> |
boolean |
- |
If true interface for JAX-RS REST application will be
generated. |
<generateNpmPackageJson> |
boolean |
- |
If true NPM package.json will be
generated. Only applicable when outputKind is set to
module . NPM package name and version can be specified
using npmName and npmVersion parameters. |
<generateReadonlyAndWriteonlyJSDocTags> |
boolean |
- |
If true JSDoc tags @readonly and
@writeonly will be generated on properties with
read-only or write-only access. |
<generateSpringApplicationClient> |
boolean |
- |
If true client for Spring REST application will be
generated. |
<generateSpringApplicationInterface> |
boolean |
- |
If true interface for Spring REST application will be
generated. |
<gsonConfiguration> |
GsonConfiguration |
- |
Specifies Gson global configuration. Description of individual
parameters is in GsonConfiguration
class on GitHub (latest version). |
<ignoreSwaggerAnnotations> |
boolean |
- |
If true Swagger annotations will not be used. |
<importDeclarations> |
List |
- |
List of import declarations which will be added to generated
output. This can be used with customTypeMappings to
provide needed TypeScript types. |
<includePropertyAnnotations> |
List |
- |
If this list is not empty then only properties with any of these
annotations will be included. |
<indentString> |
String |
- |
Specifies indentation string. In Maven pom.xml file it is needed to
set xml:space attribute to
preserve .Example: <indentString xml:space="preserve">
</indentString> . |
<jackson2Configuration> |
Jackson2Configuration |
- |
Specifies Jackson 2 global configuration. Description of individual
parameters is in Jackson2Configuration
class on GitHub (latest version). |
<jackson2ModuleDiscovery> |
boolean |
- |
Turns on Jackson2 automatic module discovery. |
<jackson2Modules> |
List |
- |
Specifies Jackson2 modules to use. |
<javadocXmlFiles> |
List |
- |
List of Javadoc XML files to search for documentation comments.
These files should be created using
com.github.markusbernhardt.xmldoclet.XmlDoclet from
com.github.markusbernhardt:xml-doclet artifact.
Javadoc comments are added to output declarations as JSDoc
comments. For more information see Javadoc
Wiki page. |
<jaxrsNamespacing> |
RestNamespacing |
- |
Deprecated, use restNamespacing . |
<jaxrsNamespacingAnnotation> |
String |
- |
Deprecated, use restNamespacingAnnotation . |
<jsonbConfiguration> |
JsonbConfiguration |
- |
Specifies JSON-B global configuration. Description of individual
parameters is in Jackson2Configuration
class on GitHub (latest version). |
<loggingLevel> |
Logger$Level |
- |
Specifies level of logging output. Supported values are:
Verbose . |
<mapClasses> |
ClassMapping |
- |
Specifies whether Java classes will be mapped to TypeScript classes
or interfaces. Java interfaces are always mapped as TypeScript
interfaces. Supported values are:
asInterfaces .Value asClasses can only be used in implementation
files (.ts). In this case it is also possible to generate
constructors by setting generateConstructors parameter
to true . It is also possible to generate mix of
classes and interfaces by setting mapClasses parameter
to asClasses value and specifying which classes should
be mapped as classes using mapClassesAsClassesPatterns
parameter. |
<mapClassesAsClassesPatterns> |
List |
- |
Specifies which Java classes should be mapped as TypeScript
classes. Classes which are matched by any of these patters are
mapped as classes otherwise they are mapped as interfaces. This
parameter can only be used when mapClasses parameter
is set to asClasses value. |
<mapDate> |
DateMapping |
- |
Specifies how Date will be mapped. Supported values
are:
asDate . |
<mapEnum> |
EnumMapping |
- |
Specifies how enums will be mapped. Supported values are:
asUnion .See also nonConstEnums parameter. |
<mapMap> |
MapMapping |
- |
Specifies how Map and similar types will be mapped.
Supported values are:
asIndexedArray . |
<mapPackagesToNamespaces> |
boolean |
- |
Generates TypeScript namespaces from Java packages. Default is
false . |
<module> |
String |
- |
Name of generated ambient module. Used when outputKind is set to
ambientModule . |
<moduleDependencies> |
List |
- |
List of modules (generated by typescript-generator!) on which
currently generated module depends on. Each item of this list has
outputKind is set to
module . |
<namespace> |
String |
- |
Generates specified namespace. Not recommended to combine with modules. Default is no namespace. |
<noEslintDisable> |
boolean |
- |
If true generated file will not be prevented from
linting by ESLint. By default there is a
eslint-disable comment that will force ESLint to
ignore the generated file. This can be enabled to suppress this
comment so that the file can be linted by ESLint. |
<noFileComment> |
boolean |
- |
If true generated file will not contain comment at the
top. By default there is a comment with timestamp and
typescript-generator version. So it might be useful to suppress
this comment if the file is in source control and is regenerated in
build. |
<noTslintDisable> |
boolean |
- |
If true generated file will not be prevented from
linting by TSLint. By default there is a
tslint:disable comment that will force TSLint to
ignore the generated file. This can be enabled to suppress this
comment so that the file can be linted by TSLint. |
<nonConstEnumAnnotations> |
List |
- |
If this list is not empty, then generated enums will not have
const keyword, if the enum contains one of the
annotations defined in this list. See nonConstEnums |
<nonConstEnums> |
boolean |
- |
If true generated enums will not have
const keyword.This can be used only in implementation files. |
<npmBuildScript> |
String |
- |
Specifies NPM "build" script. Only applicable when generateNpmPackageJson parameter
is true and generating implementation file
(.ts).Default value is tsc --module umd --moduleResolution node
--typeRoots --target es5 --lib es6 --declaration --sourceMap
$outputFile . |
<npmDependencies> |
List |
- |
List of additional NPM dependencies .Only applicable when generateNpmPackageJson parameter
is true and generating implementation file
(.ts).Each item it this list specifies dependency with its version. Item format is: name:version . |
<npmDevDependencies> |
List |
- |
List of additional NPM devDependencies .Only applicable when generateNpmPackageJson parameter
is true and generating implementation file
(.ts).Each item it this list specifies dependency with its version. Item format is: name:version . |
<npmName> |
String |
- |
Specifies NPM package name. Only applicable when generateNpmPackageJson parameter
is true .Default value is ${project.artifactId} . |
<npmPeerDependencies> |
List |
- |
List of additional NPM peerDependencies .Only applicable when generateNpmPackageJson parameter
is true and generating implementation file
(.ts).Each item it this list specifies dependency with its version. Item format is: name:version . |
<npmTypescriptVersion> |
String |
- |
Specifies TypeScript version declared in NPM
package.json .Default value is ^2.4 . |
<npmVersion> |
String |
- |
Specifies NPM package version. Only applicable when generateNpmPackageJson parameter
is true .Default value is 1.0.0 . |
<nullabilityDefinition> |
NullabilityDefinition |
- |
Specifies how nullable types will be created in generated file.
Nullable types are marked in Java by annotations specified using
nullableAnnotations parameter like
List<@Nullable String> . In Kotlin nullable types
are marked using ? character like
List<String?> . Value of this parameter specifies
how nullable type is created from regular type T :
nullInlineUnion . |
<nullableAnnotations> |
List |
- |
When any of specified annotations is used on a Java type
typescript-generator treats this type as nullable. For example Java
type List<@Nullable String> can be transformed
to TypeScript as (string | null)[] (instead of just
string[] ). Exact nullability form depends on
nullabilityDefinition parameter. Unlike optional
properties nullable types can also be used "inside" other types
like in previous example. Specified annotations must have target
set to TYPE_PARAMETER or TYPE_USE .
Example optional annotation:
org.checkerframework.checker.nullness.qual.Nullable |
<optionalAnnotations> |
List |
- |
The presence of any annotation in this list on a JSON property will
cause the typescript-generator to treat that property as optional
when generating the corresponding TypeScript interface. Example
optional annotation: javax.annotation.Nullable . This
parameter is "opposite" of requiredAnnotations , only
one of them could be used. |
<optionalProperties> |
OptionalProperties |
- |
Specifies how properties are defined to be optional. Supported
values are:
useSpecifiedAnnotations . |
<optionalPropertiesDeclaration> |
OptionalPropertiesDeclaration |
- |
Specifies how optional properties will be declared in generated
file. This parameter applies to properties detected as optional.
The detection can be specified using
optionalProperties parameter. Supported values are:
questionMark . |
<outputFile> |
File |
- |
Path and name of generated TypeScript file. |
<outputFileType> |
TypeScriptFileType |
- |
Output file format, can be:
implementationFile allows to
generate runnable TypeScript code.Default value is declarationFile . |
<primitivePropertiesRequired> |
boolean |
- |
When using requiredAnnotations to mark properties as
not optional then setting this parameter to true marks
also all properties of primitive type without explicit annotation. |
<referencedFiles> |
List |
- |
List of files which will be referenced using triple-slash
directive: /// <reference path="file" /> . This
can be used with customTypeMappings to provide needed
TypeScript types. |
<removeTypeNamePrefix> |
String |
- |
Prefix which will be removed from names of classes, interfaces,
enums. For example if set to Json then mapping for
JsonData will be Data . |
<removeTypeNameSuffix> |
String |
- |
Suffix which will be removed from names of classes, interfaces,
enums. For example if set to JSON then mapping for
DataJSON will be Data . |
<requiredAnnotations> |
List |
- |
Properties will be treated as optional except those annotated with
any of specified annotations. This parameter is "opposite" of
optionalAnnotations , only one of them could be used. |
<restNamespacing> |
RestNamespacing |
- |
Specifies how JAX-RS REST operations will be grouped into objects.
Supported values are:
singleObject . |
<restNamespacingAnnotation> |
String |
- |
Specifies annotation used for grouping JAX-RS REST operations.
Format is annotationClass#annotationElement where
annotationClass is fully-qualified class name and
annotationElement is element name and defaults to
value . Examples:
|
<restOptionsType> |
String |
- |
Specifies HTTP request options type in REST application. By default
no options parameter is generated. Useful when passing
additional parameters to underlying HTTP request method (like
jQuery ajax settings or AxiosRequestConfig ). Can be
specific (for example AxiosRequestConfig ) or generic
(for example <O> ). |
<restResponseType> |
String |
- |
Specifies HTTP response type in REST application. Default value is
Promise<R> which means data object returned
asynchronously. This parameter is useful for example when
underlying HTTP response object (like XMLHttpRequest
or AxiosPromise ) is returned instead of actual
response data. |
<scanSpringApplication> |
boolean |
- |
If true Spring REST application will be loaded and
scanned for classes to process. It is needed to specify application
class using another parameter (for example classes ). |
<scanningAcceptedPackages> |
List |
- |
Allows to speed up classpath scanning by limiting scanning to
specified packages. This optimization applies to following
parameters:
|
<skip> |
boolean |
- |
(no description) User property is: typescript.generator.skip . |
<sortDeclarations> |
boolean |
- |
If true TypeScript declarations (interfaces,
properties) will be sorted alphabetically. |
<sortTypeDeclarations> |
boolean |
- |
If true TypeScript type declarations (interfaces) will
be sorted alphabetically. |
<stringQuotes> |
StringQuotes |
- |
Specifies how strings will be quoted. Supported values are:
doubleQuotes . |
<tsNoCheck> |
boolean |
- |
If true generated file will have disabled TypeScript
semantic checks using @ts-nocheck comment. |
<umdNamespace> |
String |
- |
Turns proper module into UMD (Universal Module Definition) with
specified namespace. Only applicable to declaration files. |
I
then mapping for
Data
will be IData
.java.lang.String
No
Data
then mapping for
Person
will be PersonData
.java.lang.String
No
guava
(source) (definition)joda
(source) (definition)vavr
(source) (definition)java.util.List
No
*
wildcard matches any character except for
.
and $
.**
wildcard matches any character.java.util.List
No
java.util.List
No
java.util.List
No
excludeClasses
parameter.boolean
No
Application
for classes to
process. Parameter contains fully-qualified class name. It is
possible to exclude particular REST resource classes using
excludeClasses
parameter.java.lang.String
No
java.util.List
No
java.util.List
No
name:definition
. For example for
Unwrap<T>:T
following type alias will be
generated type Unwrap<T> = T
. Other examples:
SimpleName:VeryLongGeneratedName
,
StringID<T>:string
.java.util.List
No
javaClassName:typescriptType
. For example mapping
Joda-Time LocalDateTime
to string
would
be added as org.joda.time.LocalDateTime:string
.
Mappings of generic classes must use syntax
com.package.MyGenericClass<T1,T2>:TsGenericType2<T1,T2>
.
Instead of <T1,T2>
it is also possible to use
[T1,T2]
.java.util.List
No
javaClassName:typescriptName
. This takes precedence
over other naming settings. For more information and example see Type
Mapping Wiki page.java.util.List
No
function getName(className: string,
classSimpleName: string): string | null | undefined;
function(name, simpleName) { if
(name.startsWith('cz.')) return 'Test' + simpleName; }
java.lang.String
No
TypeProcessor
.
This allows to customize how Java types are mapped to TypeScript.
For example it is possible to implement TypeProcessor for
Optional
from guava.java.lang.String
No
loggingLevel
parameter.boolean
No
optionalProperties
parameter.boolean
No
true
declared properties will be
readonly
.boolean
No
jackson2ModuleDiscovery
and
jackson2Modules
parameters.boolean
No
@JsonTypeInfo
and
@JsonSubTypes
annotations. While
disableTaggedUnions
parameter only disables creation
of TypeScript discriminated union types this parameter allows to
disable also processing of discriminant property.java.util.List
No
true
tagged unions will not be generated for
Jackson 2 polymorphic types. This parameter does not disable
processing of discriminant property. See also
disableTaggedUnionAnnotations
parameter.boolean
No
boolean
No
keepOriginal
- keeps member name as isPascalCase
- converts name to Pascal case (upper
camel case) conventioncamelCase
- converts name to lower camel case
conventionkeepOriginal
.cz.habarta.typescript.generator.IdentifierCasing
No
java.util.List
No
java.util.List
No
java.util.List
No
cz.habarta.typescript.generator.ext.AxiosClientExtension}
- generates client for JAX-RS service using Axios library, see JAX
RS ApplicationWiki pagecz.habarta.typescript.generator.ext.BeanPropertyPathExtension}
- generates type-safe property path getterscz.habarta.typescript.generator.ext.TypeGuardsForJackson2PolymorphismExtension}
extensionsWithConfiguration
can be used in
case extension needs some configuration.java.util.List
No
extensions
parameter. Each item of
this list has
className
- required fully-qualified class name of
the extensionconfiguration
- optional Map
with
String
keys and String
valuesjava.util.List
No
true
generated classes will also have constructors.
Generated constructors use "named parameters" pattern so when
calling such constructor parameters need to be wrapped in "options"
object. This parameter can only be used when
mapClasses
parameter is set to asClasses
value.boolean
No
true
JSON file describing generated module will be
generated. In following typescript-generator run this allows to
generate another module which could depend on currently generated
module. Generated JSON file contains mapping from Java classes to
TypeScript types which typescript-generator needs when the module
is referenced from another module using
moduleDependencies
parameter. Only applicable when
outputKind
is set to module
.boolean
No
true
client for JAX-RS REST application will be
generated.boolean
No
true
interface for JAX-RS REST application will be
generated.boolean
No
true
NPM package.json
will be
generated. Only applicable when outputKind
is set to
module
. NPM package name and version can be specified
using npmName
and npmVersion
parameters.boolean
No
true
JSDoc tags @readonly
and
@writeonly
will be generated on properties with
read-only or write-only access.boolean
No
true
client for Spring REST application will be
generated.boolean
No
true
interface for Spring REST application will be
generated.boolean
No
cz.habarta.typescript.generator.GsonConfiguration
No
true
Swagger annotations will not be used.boolean
No
customTypeMappings
to
provide needed TypeScript types.java.util.List
No
java.util.List
No
xml:space
attribute to
preserve
.<indentString xml:space="preserve">
</indentString>
.java.lang.String
No
cz.habarta.typescript.generator.Jackson2Configuration
No
boolean
No
java.util.List
No
com.github.markusbernhardt.xmldoclet.XmlDoclet
from
com.github.markusbernhardt:xml-doclet
artifact.
Javadoc comments are added to output declarations as JSDoc
comments. For more information see Javadoc
Wiki page.java.util.List
No
restNamespacing
.cz.habarta.typescript.generator.RestNamespacing
No
restNamespacingAnnotation
.java.lang.String
No
jackson1
- annotations from
`org.codehaus.jackson.annotate` packagejackson2
- annotations from
`com.fasterxml.jackson.annotation` packagejaxb
- annotations from
`javax.xml.bind.annotation` packagegson
- annotations from
`com.google.gson.annotations` packagejsonb
- annotations from
`javax.json.bind.annotation` packagejackson2
.cz.habarta.typescript.generator.JsonLibrary
Yes
cz.habarta.typescript.generator.JsonbConfiguration
No
Debug
Verbose
Info
Warning
Error
Verbose
.cz.habarta.typescript.generator.Logger$Level
No
asInterfaces
asClasses
asInterfaces
.asClasses
can only be used in implementation
files (.ts). In this case it is also possible to generate
constructors by setting generateConstructors
parameter
to true
. It is also possible to generate mix of
classes and interfaces by setting mapClasses
parameter
to asClasses
value and specifying which classes should
be mapped as classes using mapClassesAsClassesPatterns
parameter.cz.habarta.typescript.generator.ClassMapping
No
mapClasses
parameter
is set to asClasses
value.java.util.List
No
Date
will be mapped. Supported values
are:
asDate
- type Date
asNumber
- type number
asString
- type string
asDate
.cz.habarta.typescript.generator.DateMapping
No
asUnion
- creates type alias to union of string
enum valuesasInlineUnion
- creates union of enum values on
places where the enum is usedasEnum
- creates string enum. Requires TypeScript
2.4asNumberBasedEnum
- creates enum of named number
valuesasUnion
.nonConstEnums
parameter.cz.habarta.typescript.generator.EnumMapping
No
Map
and similar types will be mapped.
Supported values are:
asIndexedArray
- creates indexed
array type, example: { [index: string]: Person }
(original way)asRecord
- creates Record
type, example: Record<string, Person>
(from
TypeScript 2.1)asIndexedArray
.cz.habarta.typescript.generator.MapMapping
No
false
.boolean
No
outputKind
is set to
ambientModule
.java.lang.String
No
importFrom
- (required) module name in generated
import
statement, can be relative pathimportAs
- (required) name that will be used when
referring to the importsinfoJson
- (required) file path to the module info
JSON generated by preceding typescript-generator run, see
generateInfoJson
parameternpmPackageName
- (required when generating
package.json) NPM dependency package namenpmVersionRange
- (required when generating
package.json) NPM dependency version (or other identification)outputKind
is set to
module
.java.util.List
No
java.lang.String
No
true
generated file will not be prevented from
linting by ESLint. By default there is a
eslint-disable
comment that will force ESLint to
ignore the generated file. This can be enabled to suppress this
comment so that the file can be linted by ESLint.boolean
No
true
generated file will not contain comment at the
top. By default there is a comment with timestamp and
typescript-generator version. So it might be useful to suppress
this comment if the file is in source control and is regenerated in
build.boolean
No
true
generated file will not be prevented from
linting by TSLint. By default there is a
tslint:disable
comment that will force TSLint to
ignore the generated file. This can be enabled to suppress this
comment so that the file can be linted by TSLint.boolean
No
const
keyword, if the enum contains one of the
annotations defined in this list. See nonConstEnums
java.util.List
No
true
generated enums will not have
const
keyword.boolean
No
generateNpmPackageJson
parameter
is true
and generating implementation file
(.ts).tsc --module umd --moduleResolution node
--typeRoots --target es5 --lib es6 --declaration --sourceMap
$outputFile
.java.lang.String
No
dependencies
.generateNpmPackageJson
parameter
is true
and generating implementation file
(.ts).name:version
.java.util.List
No
devDependencies
.generateNpmPackageJson
parameter
is true
and generating implementation file
(.ts).name:version
.java.util.List
No
generateNpmPackageJson
parameter
is true
.${project.artifactId}
.java.lang.String
No
peerDependencies
.generateNpmPackageJson
parameter
is true
and generating implementation file
(.ts).name:version
.java.util.List
No
package.json
.^2.4
.java.lang.String
No
generateNpmPackageJson
parameter
is true
.1.0.0
.java.lang.String
No
nullableAnnotations
parameter like
List<@Nullable String>
. In Kotlin nullable types
are marked using ?
character like
List<String?>
. Value of this parameter specifies
how nullable type is created from regular type T
:
nullAndUndefinedUnion
- type alias
Nullable<T>
which is defined as union of T
| null | undefined
nullUnion
- type alias
Nullable<T>
which is defined as union of T
| null
undefinedUnion
- type alias
Nullable<T>
which is defined as union of T
| undefined
nullAndUndefinedInlineUnion
- union of T |
null | undefined
without type aliasnullInlineUnion
- union of T | null
without type aliasundefinedInlineUnion
- union of T |
undefined
without type aliasnullInlineUnion
.cz.habarta.typescript.generator.NullabilityDefinition
No
List<@Nullable String>
can be transformed
to TypeScript as (string | null)[]
(instead of just
string[]
). Exact nullability form depends on
nullabilityDefinition
parameter. Unlike optional
properties nullable types can also be used "inside" other types
like in previous example. Specified annotations must have target
set to TYPE_PARAMETER
or TYPE_USE
.
Example optional annotation:
org.checkerframework.checker.nullness.qual.Nullable
java.util.List
No
javax.annotation.Nullable
. This
parameter is "opposite" of requiredAnnotations
, only
one of them could be used.java.util.List
No
useSpecifiedAnnotations
- annotations specified
using optionalAnnotations
or
requiredAnnotations
parameteruseLibraryDefinition
- examples:
@JsonProperty(required = false)
when using
jackson2
library or @XmlElement(required =
false)
when using jaxb
libraryall
- all properties are optionaluseSpecifiedAnnotations
.cz.habarta.typescript.generator.OptionalProperties
No
optionalProperties
parameter. Supported values are:
questionMark
- property will be marked using
?
character as optionalquestionMarkAndNullableType
- property will be
optional and it will also have union with null
valuenullableType
- property will not be optional but
its type will be union with null
valuenullableAndUndefinableType
- property will not be
optional but its type will be union with null
and
undefined
valuesundefinableType
- property will not be optional
but its type will be union with undefined
valuequestionMark
.cz.habarta.typescript.generator.OptionalPropertiesDeclaration
No
java.io.File
No
declarationFile
(.d.ts)implementationFile
(.ts)implementationFile
allows to
generate runnable TypeScript code.declarationFile
.cz.habarta.typescript.generator.TypeScriptFileType
No
global
- means that declarations will be in global
scope or namespace (no module)module
- means that generated file will contain
top-level export
declarationsambientModule
- means that generated declarations
will be wrapped in declare module "mod" { }
declarationcz.habarta.typescript.generator.TypeScriptOutputKind
Yes
requiredAnnotations
to mark properties as
not optional then setting this parameter to true
marks
also all properties of primitive type without explicit annotation.boolean
No
/// <reference path="file" />
. This
can be used with customTypeMappings
to provide needed
TypeScript types.java.util.List
No
Json
then mapping for
JsonData
will be Data
.java.lang.String
No
JSON
then mapping for
DataJSON
will be Data
.java.lang.String
No
optionalAnnotations
, only one of them could be used.java.util.List
No
singleObject
- means that one object with all
operations will be generatedperResource
- means that for each root resource
one object will be generatedbyAnnotation
- means that operations will be
grouped by annotation specified using
jaxrsNamespacingAnnotation
singleObject
.cz.habarta.typescript.generator.RestNamespacing
No
annotationClass#annotationElement
where
annotationClass
is fully-qualified class name and
annotationElement
is element name and defaults to
value
. Examples:
io.swagger.annotations.Api
io.swagger.annotations.Api#value
java.lang.String
No
options
parameter is generated. Useful when passing
additional parameters to underlying HTTP request method (like
jQuery ajax settings or AxiosRequestConfig
). Can be
specific (for example AxiosRequestConfig
) or generic
(for example <O>
).java.lang.String
No
Promise<R>
which means data object returned
asynchronously. This parameter is useful for example when
underlying HTTP response object (like XMLHttpRequest
or AxiosPromise
) is returned instead of actual
response data.java.lang.String
No
true
Spring REST application will be loaded and
scanned for classes to process. It is needed to specify application
class using another parameter (for example classes
).boolean
No
classPatterns
classesImplementingInterfaces
classesExtendingClasses
classesWithAnnotations
classesFromAutomaticJaxrsApplication
java.util.List
No
boolean
No
typescript.generator.skip
true
TypeScript declarations (interfaces,
properties) will be sorted alphabetically.boolean
No
true
TypeScript type declarations (interfaces) will
be sorted alphabetically.boolean
No
doubleQuotes
singleQuotes
doubleQuotes
.cz.habarta.typescript.generator.StringQuotes
No
true
generated file will have disabled TypeScript
semantic checks using @ts-nocheck
comment.boolean
No
java.lang.String
No