1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! [TypeScript](https://www.typescriptlang.org) language exporter.
//!
//! # Usage
//!
//! Add `specta` and `specta-typescript` to your project:
//!
//! ```bash
//! cargo add specta@2.0.0-rc.24 --features derive,export
//! cargo add specta-typescript@0.0.11
//! cargo add specta-serde@0.0.11
//! ```
//!
//! Next copy the following into your `main.rs` file:
//!
//! ```rust
//! use specta::{ResolvedTypes, Type, Types};
//! use specta_typescript::Typescript;
//!
//! #[derive(Type)]
//! pub struct MyType {
//! pub field: MyOtherType,
//! }
//!
//!
//! #[derive(Type)]
//! pub struct MyOtherType {
//! pub other_field: String,
//! }
//!
//! let mut types = Types::default()
//! // We don't need to specify `MyOtherType` because it's referenced by `MyType`
//! .register::<MyType>();
//! let resolved_types = ResolvedTypes::from_resolved_types(types);
//!
//! Typescript::default()
//! .export_to("./bindings.ts", &resolved_types)
//! .unwrap();
//! ```
//!
//! Now your setup with Specta!
//!
//! If you get tired of listing all your types manually? Checkout `specta::collect`!
//!
// TODO: Remove this
pub
pub use Branded;
pub use Error;
pub use ;
pub use JSDoc;
pub use define;
pub use collect_references;
pub use ;
pub use Typescript;