Expand description
Generate Flow type declarations from Rust types.
§Usage
#[derive(flowjs_rs::Flow)]
struct User {
user_id: i32,
first_name: String,
last_name: String,
}When running cargo test, the following Flow type will be exported:
type User = {|
+user_id: number,
+first_name: string,
+last_name: string,
|};Modules§
- flow_
type - Flow built-in type names.
Structs§
- Config
- Configuration for Flow type generation.
- Dependency
- A Flow type which is depended upon by other types. This information is required for generating the correct import statements.
- Dummy
- Dummy type used as a placeholder for generic parameters during codegen.
Enums§
- Export
Error - Export error.
Traits§
- Flow
- The core trait. Derive it on your types to generate Flow declarations.
- Type
Visitor - A visitor used to iterate over all dependencies or generics of a type.
When an instance of
TypeVisitoris passed toFlow::visit_dependenciesorFlow::visit_generics, theTypeVisitor::visitmethod will be invoked for every dependency or generic parameter respectively.
Derive Macros§
- Flow
- Derive the
Flowtrait for a struct or enum.