@@ -49,58 +49,6 @@ macro_rules! collect_commands {
4949 } ;
5050}
5151
52- /// Collect queries for TanStack Query integration.
53- ///
54- /// Like [`collect_commands!`] but marks functions as queries, generating
55- /// `queryOptions` wrappers in TypeScript output.
56- ///
57- /// # Usage
58- /// ```rust,ignore
59- /// use tauri_specta::{collect_queries, Builder};
60- ///
61- /// #[tauri::command]
62- /// #[specta::specta]
63- /// fn get_user(id: u32) -> User { /* ... */ }
64- ///
65- /// let builder = Builder::<tauri::Wry>::new()
66- /// .queries(collect_queries![get_user]);
67- /// ```
68- #[ macro_export]
69- macro_rules! collect_queries {
70- ( $( $b: ident $( :: $( $p: ident) ? $( <$( $g: path) ,* >) ? ) * ) ,* $( , ) ?) => {
71- $crate:: internal:: query(
72- :: tauri:: generate_handler![ $( $b $( $( :: $p) ? ) * ) ,* ] ,
73- :: specta:: function:: collect_functions![ $( $b $( $( :: $p) ? $( :: <$( $g) ,* >) ? ) * ) ,* ] ,
74- )
75- } ;
76- }
77-
78- /// Collect mutations for TanStack Query integration.
79- ///
80- /// Like [`collect_commands!`] but marks functions as mutations, generating
81- /// `mutationOptions` wrappers in TypeScript output.
82- ///
83- /// # Usage
84- /// ```rust,ignore
85- /// use tauri_specta::{collect_mutations, Builder};
86- ///
87- /// #[tauri::command]
88- /// #[specta::specta]
89- /// fn create_user(name: String) -> User { /* ... */ }
90- ///
91- /// let builder = Builder::<tauri::Wry>::new()
92- /// .mutations(collect_mutations![create_user]);
93- /// ```
94- #[ macro_export]
95- macro_rules! collect_mutations {
96- ( $( $b: ident $( :: $( $p: ident) ? $( <$( $g: path) ,* >) ? ) * ) ,* $( , ) ?) => {
97- $crate:: internal:: mutation(
98- :: tauri:: generate_handler![ $( $b $( $( :: $p) ? ) * ) ,* ] ,
99- :: specta:: function:: collect_functions![ $( $b $( $( :: $p) ? $( :: <$( $g) ,* >) ? ) * ) ,* ] ,
100- )
101- } ;
102- }
103-
10452/// Collect events and their types.
10553///
10654/// This returns a [`Events`](crate::Events) struct that can be passed to [`Builder::events`](crate::Builder::events).
0 commit comments