Add generated type to README (#365)

This commit is contained in:
Gustavo Shigueo
2024-11-03 11:25:15 -03:00
committed by GitHub
parent 592898a764
commit 0ff3c816ed
2 changed files with 14 additions and 2 deletions
+7 -1
View File
@@ -56,7 +56,13 @@ struct User {
last_name: String,
}
```
When running `cargo test` or `cargo test export_bindings`, the TypeScript bindings will be exported to the file `bindings/User.ts`.
When running `cargo test` or `cargo test export_bindings`, the TypeScript bindings will be exported to the file `bindings/User.ts`
and will contain the following code:
```ts
export type User = { user_id: number, first_name: string, last_name: string, };
```
### Features
- generate type declarations from rust structs
+7 -1
View File
@@ -54,7 +54,13 @@
//! last_name: String,
//! }
//! ```
//! When running `cargo test` or `cargo test export_bindings`, the TypeScript bindings will be exported to the file `bindings/User.ts`.
//!
//! When running `cargo test` or `cargo test export_bindings`, the TypeScript bindings will be exported to the file `bindings/User.ts`
//! and will contain the following code:
//!
//! ```ts
//! export type User = { user_id: number, first_name: string, last_name: string, };
//! ```
//!
//! ## Features
//! - generate type declarations from rust structs