Skip to content
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

Add support for functions #92

Open
caleidon opened this issue Mar 22, 2022 · 3 comments · May be fixed by #249
Open

Add support for functions #92

caleidon opened this issue Mar 22, 2022 · 3 comments · May be fixed by #249
Labels
enhancement New feature or request Next Major Release

Comments

@caleidon
Copy link

It would be cool if just like with types and structs, we could also add a prefix before a function, and we'd get full TS support for that rust function. This would be very useful when working with things like Tauri, because we use "Invoke("functionName")" which is very error prone and you don't really get intellisense autocompletion.

Something like this could be auto-generated:
https://github.com/tauri-apps/tauri-plugin-store/blob/dev/webview-src/index.ts

@NyxCode NyxCode added enhancement New feature or request Next Major Release labels Jul 28, 2022
@itsezc
Copy link

itsezc commented Nov 10, 2022

Would also be very useful for wasm_bindgen when exporting

@escritorio-gustavo
Copy link
Collaborator

Can you show us what you'd like this to look like?

@escritorio-gustavo escritorio-gustavo linked a pull request Mar 4, 2024 that will close this issue
@escritorio-gustavo
Copy link
Collaborator

escritorio-gustavo commented Mar 5, 2024

I'm currently working on a way to export function signatures as types, check out #249.

For the case of Tauri commands, I don't think we can export the invoke command itself, only the signature, the idea is that you'd then create a function with the exported signature that uses invoke inside it, then you'd call that function instead of invoke

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Next Major Release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants