mirror of
https://github.com/xazukx/ts-rs.git
synced 2026-11-19 22:40:25 +00:00
Add generated type to README (#365)
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user