Code tells anything, then intellisense will tell you the rest.
If you get confused, fell free to open an issue, then I will add that part to this document.
Types.
means type in schema2ts
Typescript.
means type provided by Typescript package
- boolean (
true
,false
) - number (
-1
,0.5
,100
, ...) - string (
'Hello'
,'World'
, ...)
- null
- undefined
- any
- void
- array (
Type[]
) - object (with type definition by an
interface
of course)
- or (
TypeA | TypeB
) - and (
TypeA & TypeB
) - tuple (
[TypeA, TypeB]
)
- enum
- type reference
This method return the Typescript TypeNode of it self.
For example, Types.Literal(true) express a boolean type, this method gives you a boolean
TypeNode.
Then, Types.EnumOf(name, members...) express an enum, this method gives you the name
, not declaration.
This method make type more clear.
For example, Types.And([ TypeA, TypeA ]).reduce() (which express TypeA & TypeA
) will give you TypeA
This method gives you all type declaration you need to add to the output file, otherwise, result of .toTypescript() will not pass type checking.
This method add JSDoc to the type.
Important!: But JSDoc maybe not emit in some types!