Skip to content

Commit

Permalink
Fix custom plugin example
Browse files Browse the repository at this point in the history
  • Loading branch information
oscartbeaumont committed Apr 30, 2024
1 parent 1c261aa commit fde6f0b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
30 changes: 16 additions & 14 deletions examples/custom-plugin/plugin/bindings.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
// This file was generated by [tauri-specta](https://github.com/oscartbeaumont/tauri-specta). Do not edit this file manually.
// This file was generated by [tauri-specta](https://github.com/oscartbeaumont/tauri-specta). Do not edit this file manually.

export const commands = {
/**
* Adds two numbers, returning the result.
*/
async addNumbers(a: number, b: number): Promise<number> {
return await TAURI_INVOKE("plugin:custom-plugin|add_numbers", { a, b });
},
};
export const commands = {
/**
* Adds two numbers, returning the result.
*/
async addNumbers(a: number, b: number) : Promise<number> {
return await TAURI_INVOKE("plugin:specta-example|add_numbers", { a, b });
}
}

export const events = __makeEvents__<{
randomNumber: RandomNumber;
randomNumber: RandomNumber
}>({
randomNumber: "plugin:custom-plugin:random-number",
});
randomNumber: "plugin:specta-example:random-number"
})

/** user-defined types **/

export type RandomNumber = number;
export type RandomNumber = number

/** tauri-specta globals **/

import { invoke as TAURI_INVOKE } from "@tauri-apps/api/core";
import { invoke as TAURI_INVOKE } from "@tauri-apps/api/core";
import * as TAURI_API_EVENT from "@tauri-apps/api/event";
import { type WebviewWindow as __WebviewWindow__ } from "@tauri-apps/api/webviewWindow";

Expand Down Expand Up @@ -75,3 +75,5 @@ function __makeEvents__<T extends Record<string, any>>(
}
);
}


2 changes: 1 addition & 1 deletion examples/custom-plugin/plugin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ macro_rules! specta_builder {
};
}

const PLUGIN_NAME: &str = "custom-plugin";
const PLUGIN_NAME: &str = "specta-example";

pub fn init<R: Runtime>() -> TauriPlugin<R> {
let (invoke_handler, register_events) =
Expand Down

0 comments on commit fde6f0b

Please sign in to comment.