Expand description
Minimal compatible Types shared between nym-bridges and other crates.
§Abstract
- This crate contains all types necessary for interaction with crates (nym-vpn-lib-types) and others
- Types visible via bindings should contain proper attributes and feature gated to
uniffi-bindingsfor uniffi,typescript-bindingsfor TypeScript bindings. - TypeScript bindings use serde for conversion from Rust to TS and feature-gated to
typescript-bindings. - Be mindful of limitations of TypeScript and uniffi limitations. Keep exported types simple.
§Dependency considerations
Please keep direct dependencies to other crates to a minimum to avoid dependency conflicts which can happen, especially when using it in other large projects such as Tauri.
§Supported bindings
- uniffi bindings (feature flag: uniffi-bindings). The following limitations apply:
- Namespaces are not supported, all exported types should have unique names.
- Not all types are supported or can be bridged. Keep exported types simple.
-
TypeScript bindings using ts-rs (feature flag:
typescript-bindings). Serialization (using serde) usessnake_case.Run the following command to generate TypeScript bindings:
cargo test -p nym-vpn-lib-types -F typescript-bindings
§Serde support
Serde can be enabled using serde feature flag.