How to export named interface in generated bindings.ts #119
Answered
by
oscartbeaumont
ofofofofo
asked this question in
Specta Help
-
When I have a Struct
I want specta generate interface like this
instead of anonymous type
|
Beta Was this translation helpful? Give feedback.
Answered by
oscartbeaumont
Jan 31, 2023
Replies: 1 comment 1 reply
-
You shouldn't be relying on the format of the rspc bindings because they may change between releases. I need to mention this more in the documentation. You can do something like this in your code. import { inferProcedureResult } from "@rspc/client";
import { Procedures } from "./my-bindings-from-rust.ts";
export type User = inferProcedureResult<Procedures, "query", "me">; |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ofofofofo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You shouldn't be relying on the format of the rspc bindings because they may change between releases. I need to mention this more in the documentation. You can do something like this in your code.