-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Can the generated index.ts export the other types? #81
Comments
I agree that it would be useful to have this built in. As a workaround, I created a top-level export * from "./src"; // Directory that qubit exports type defs to
export type { JsonValue } from "./src/serde_json/JsonValue";
export type { RpcError } from "./src/RpcError"; |
I've had a bit of a play around with this, and managed to get something simple enough working. I'm foreseeing the a potential issue if the same type name is used in multiple places, as the current type exporting setup looses the 'namespaced' nature of Rust modules. For example, This can be solved with the |
Re-export all types within `index.ts`. Closes #81
# Version Updates Merging this PR will release new versions of the following packages based on your change files. # @qubit-rs/client ## [0.4.5] - b6ef950 Bump dependencies # @qubit-rs/svelte ## [0.0.6] - b6ef950 Bump dependencies ### Dependencies - Upgraded to `@qubit-rs/client@0.4.5` # qubit ## [0.10.1] - 6998257 Alter router type generation to re-export all types. (close #81) - 88ef762 (#84) Update `ts-rs` to 10.1.0 (thanks @epatters)
Give |
This worked thanks so much! |
Works for me too. Thank you! |
Is there a way to have our custom types exported from the
index.ts
file somehow?Just a QoL question I'm wondering if I can minimize imports like `import type { RpcError } from "./bindings/RpcError.ts";
For instance, if I wanted that
RpcError
exported from that index file for whatever reason.I tried:
Curious if this is possible!
The text was updated successfully, but these errors were encountered: