typeshare
typeshare copied to clipboard
Allow generated types to be namespaced
Today all generated types will be put in a single module. I'd like to be able to allow types to optionally be defined in separate namespaces/modules.
For example for Typescript.
#[typeshare::typeshare(namespace = mymodule)]
pub struct MyType {
some_field: String
};
File mymodule.ts
export interface MyType {
someField: string
}
Just came here to create the same Feature Request. :)
I have an approach that generates module files per source crate: https://github.com/darrell-roberts/typeshare/pull/4. This is a prototype right now. There are further changes that would have to be made to make this an add on feature so no to impact existing behavior.
Moved to MR https://github.com/1Password/typeshare/pull/166