Skip to content

Commit 43b02e7

Browse files
improved README
1 parent 4c7a67a commit 43b02e7

File tree

1 file changed

+33
-7
lines changed

1 file changed

+33
-7
lines changed

README.md

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ Supported types include:
3333
- enum
3434
- array
3535
- `List` and `Map` (including derived interfaces and implementation classes)
36+
- customized type mapping
37+
38+
For more details see [Type Mapping Wiki page](../../wiki/Type-Mapping).
3639

3740

3841
Maven
@@ -51,11 +54,13 @@ In Maven build you can use `typescript-generator-maven-plugin` like this:
5154
<goal>generate</goal>
5255
</goals>
5356
<configuration>
57+
<jsonLibrary>jackson2</jsonLibrary>
5458
<classes>
5559
<class>cz.habarta.typescript.generator.Person</class>
5660
</classes>
57-
<namespace>Rest</namespace>
5861
<outputFile>target/rest.d.ts</outputFile>
62+
<outputKind>global</outputKind>
63+
<namespace>Rest</namespace>
5964
</configuration>
6065
</execution>
6166
</executions>
@@ -81,16 +86,13 @@ buildscript {
8186
}
8287
}
8388
generateTypeScript {
84-
outputFile = 'build/sample.d.ts'
89+
jsonLibrary = 'jackson2'
8590
classes = [
8691
'cz.habarta.typescript.generator.sample.Person'
8792
]
88-
jsonLibrary = 'jackson2'
93+
outputFile = 'build/sample.d.ts'
94+
outputKind = 'global'
8995
namespace = 'Rest';
90-
// module = 'my-module'
91-
// declarePropertiesAsOptional = false
92-
// removeTypeNameSuffix = 'Json'
93-
// mapDate = 'asNumber'
9496
}
9597
```
9698

@@ -103,6 +105,30 @@ Direct invocation
103105
If you do not use Maven or Gradle you can invoke typescript-generator directly using `TypeScriptGenerator.generateTypeScript()` method.
104106

105107

108+
Input classes
109+
-------------
110+
Input classes can be specified using several parameters:
111+
- **`classes`** - list of fully qualified class names, includes all listed classes and their dependencies, `$` character is used for nested classes like `com.example.ClassName$NestedClassName`
112+
- **`classPatterns`** - list of glob patterns like `com.example.*Json`, includes all classes matched by the pattern, supported are `*` and `**` wildcards
113+
- **`classesFromJaxrsApplication`** - fully qualified name of JAX-RS application class, all classes used by application resources will be included, recommended if you have JAX-RS application class
114+
- **`classesFromAutomaticJaxrsApplication`** - value `true` will include classes from automatically discovered REST resources, recommended if you have JAX-RS application without `Application` subclass
115+
- **`excludeClasses`** - list of fully qualified class names, excluded classes will be mapped to TypeScript `any` type, if exluded class is a resource then this resource will not be scanned for used classes
116+
117+
> Note: it is possible to use multiple parameters at the same time.
118+
119+
For more details see [Class Names Glob Patterns](../../wiki/Class-Names-Glob-Patterns) and [JAX RS Application](../../wiki/JAX-RS-Application) Wiki pages.
120+
121+
122+
Output parameters
123+
-----------------
124+
Output is configured using several parameters, two of them are mandatory:
125+
- `outputFile` - specifies path and name of output file
126+
- `outputKind` - determines if and how module will be generated
127+
- values are: `global`, `module`, `ambientModule`
128+
129+
For more details see [Modules and Namespaces](http://vojtechhabarta.github.io/typescript-generator/doc/ModulesAndNamespaces.html) page.
130+
131+
106132
Download
107133
--------
108134
Releases are available from Maven Central Repository.

0 commit comments

Comments
 (0)