Hi! I want to use tsify to generate types (duh :D) for a public API, and I would like my rustdoc comments on my structs and fields to transport over to the TS definitions.
E.g. I have
/// JSON-compatible and human readable format of transactions. E.g. addresses are presented in their human-readable
/// format and address types and the network are represented as strings. Data and proof are serialized as an object
/// describing their contents.
#[derive(serde::Serialize, serde::Deserialize, Tsify)]
#[serde(rename_all = "camelCase")]
pub struct PlainTransaction {
/// The transaction's unique hash, used as its identifier. Sometimes also called `txId`.
pub transaction_hash: String,
// [...]
}
but unfortunately the generated TS types don't include those doc comments:
/**
* JSON-compatible and human readable format of transactions. E.g. addresses are presented in their human-readable
* format and address types and the network are represented as strings. Data and proof are serialized as an object
* describing their contents.
*/
export interface PlainTransaction {
/**
* The transaction's unique hash, used as its identifier. Sometimes also called `txId`.
*/
transactionHash: string;
}
wasm-bindgen does this, it converts the rustdoc into JSDoc annotations.
Hi! I want to use tsify to generate types (duh :D) for a public API, and I would like my rustdoc comments on my structs and fields to transport over to the TS definitions.
E.g. I have
but unfortunately the generated TS types don't include those doc comments:
I would like the output to be this instead:
wasm-bindgen does this, it converts the rustdoc into JSDoc annotations.
Is this complicated?