https://github.com/aaadddfgh/types-from-java
generate typescript type definion from java data class
https://github.com/aaadddfgh/types-from-java
generator java types typescript
Last synced: 3 months ago
JSON representation
generate typescript type definion from java data class
- Host: GitHub
- URL: https://github.com/aaadddfgh/types-from-java
- Owner: aaadddfgh
- Created: 2023-03-24T09:35:35.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-04-04T16:21:54.000Z (about 2 years ago)
- Last Synced: 2025-01-16T03:15:42.594Z (5 months ago)
- Topics: generator, java, types, typescript
- Language: JavaScript
- Homepage:
- Size: 284 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# types-from-java
generate typescript type definion from java data class
can only generate one class in one time, can not parse `import`,
can parse Annotion and Method, but without any effect.npm: https://www.npmjs.com/package/types-from-java
online: [gitpage](https://aaadddfgh.github.io/types-from-java/)## useage
``` js
const {getType} = require("types-from-java");
//or es
//import {getType} from "types-from-java";/*class MyClass{
Interger var;
}*/
var typeString=getType("class MyClass{Integer var;}")
/*type MyClass = {"var":number, }; */
```## map
defualt map, you can change second parm of `getType` to overwrite or add new
| java | typescript |
| --- | --- |
| boolean | boolean|
|char |string|
|byte |number|
|short |number|
|int |number|
|long |string|
|float |number|
|double |number|
|Boolean | boolean|
|Character| string|
|Byte| number|
|Short| number|
|Integer| number|
|Long| string|
|Float| number|
|Double| number|
|String| string|
|Object| any|peg grammar defined in parser fold.
github: https://github.com/aaadddfgh/types-from-java