@greenlabs/ppx-ts
Advanced tools
Comparing version 0.1.2 to 0.1.3
{ | ||
"name": "@greenlabs/ppx-ts", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "ReScript PPX helps binding to typescript modules", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -124,2 +124,40 @@ # PPX_ts | ||
### Extension `%` | ||
#### `keyOf` | ||
```rescript | ||
module Error = { | ||
type t = { | ||
name: string, | ||
age: int | ||
} | ||
} | ||
type t1 = %ppx_ts.keyOf(Error.t) // type t1 = Name | Age | ||
// automatically generated | ||
let t1_keyToString = key => | ||
switch key { | ||
| Name => "name" | ||
| Age => "age" | ||
} | ||
``` | ||
#### `toGeneric` | ||
```rescript | ||
type t = { | ||
name: string, | ||
age: int | ||
} | ||
type t1 = %ppx_ts.toGeneric(t) | ||
// changed | ||
type t1<'a> = { | ||
name: 'a | ||
age: 'a | ||
} | ||
``` | ||
## Contribution | ||
@@ -126,0 +164,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33347174
196